Do a shorter wait during identify command, and retry it once to find atapi drives that report a wrong signature
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23463 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1115,7 +1115,7 @@ ata_identify_device(ide_device_info *device, bool isAtapi)
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
if (ata_wait(bus, ide_status_drq, ide_status_bsy, 0, 4000000) != B_OK) {
|
||||
if (ata_wait(bus, ide_status_drq, ide_status_bsy, 0, 500000) != B_OK) {
|
||||
TRACE("ata_identify_device: wait failed\n");
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
@@ -157,15 +157,19 @@ fix_infoblock_endian(ide_device_info *device)
|
||||
status_t
|
||||
scan_device(ide_device_info *device, bool isAtapi)
|
||||
{
|
||||
status_t result;
|
||||
dprintf("ATA: scan_device\n");
|
||||
|
||||
if (ata_identify_device(device, isAtapi) != B_OK) {
|
||||
isAtapi = !isAtapi;
|
||||
dprintf("ATA: scan_device: retrying identify for different device type (atapi=%d)\n", isAtapi);
|
||||
if (ata_identify_device(device, isAtapi) != B_OK) {
|
||||
dprintf("ATA: couldn't read infoblock for device %p\n", device);
|
||||
return B_ERROR;
|
||||
}
|
||||
retry:
|
||||
result = ata_identify_device(device, isAtapi);
|
||||
if (result != B_OK && !isAtapi) {
|
||||
dprintf("ATA: scan_device: possibly ATAPI, retrying identify\n");
|
||||
isAtapi = true;
|
||||
goto retry;
|
||||
}
|
||||
if (result != B_OK) {
|
||||
dprintf("ATA: couldn't read infoblock for device %p\n", device);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
fix_infoblock_endian(device);
|
||||
|
||||
Reference in New Issue
Block a user