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;
|
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");
|
TRACE("ata_identify_device: wait failed\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,15 +157,19 @@ fix_infoblock_endian(ide_device_info *device)
|
|||||||
status_t
|
status_t
|
||||||
scan_device(ide_device_info *device, bool isAtapi)
|
scan_device(ide_device_info *device, bool isAtapi)
|
||||||
{
|
{
|
||||||
|
status_t result;
|
||||||
dprintf("ATA: scan_device\n");
|
dprintf("ATA: scan_device\n");
|
||||||
|
|
||||||
if (ata_identify_device(device, isAtapi) != B_OK) {
|
retry:
|
||||||
isAtapi = !isAtapi;
|
result = ata_identify_device(device, isAtapi);
|
||||||
dprintf("ATA: scan_device: retrying identify for different device type (atapi=%d)\n", isAtapi);
|
if (result != B_OK && !isAtapi) {
|
||||||
if (ata_identify_device(device, isAtapi) != B_OK) {
|
dprintf("ATA: scan_device: possibly ATAPI, retrying identify\n");
|
||||||
dprintf("ATA: couldn't read infoblock for device %p\n", device);
|
isAtapi = true;
|
||||||
return B_ERROR;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
if (result != B_OK) {
|
||||||
|
dprintf("ATA: couldn't read infoblock for device %p\n", device);
|
||||||
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
fix_infoblock_endian(device);
|
fix_infoblock_endian(device);
|
||||||
|
|||||||
Reference in New Issue
Block a user