set bus state to ata_state_busy during device scanning
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23327 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1023,16 +1023,18 @@ ata_read_infoblock(ide_device_info *device, bool isAtapi)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX fix me
|
||||||
IDE_LOCK(bus);
|
IDE_LOCK(bus);
|
||||||
bus->state = ata_state_idle;
|
bus->state = ata_state_busy;
|
||||||
IDE_UNLOCK(bus);
|
IDE_UNLOCK(bus);
|
||||||
|
|
||||||
TRACE("ata_read_infoblock: success\n");
|
TRACE("ata_read_infoblock: success\n");
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
// XXX fix me
|
||||||
IDE_LOCK(bus);
|
IDE_LOCK(bus);
|
||||||
bus->state = ata_state_idle;
|
bus->state = ata_state_busy;
|
||||||
IDE_UNLOCK(bus);
|
IDE_UNLOCK(bus);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,6 +191,14 @@ scan_bus(ide_bus_info *bus)
|
|||||||
if (bus->disconnected)
|
if (bus->disconnected)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
// XXX fix me
|
||||||
|
IDE_LOCK(bus);
|
||||||
|
ASSERT(bus->state == ata_state_idle);
|
||||||
|
bus->state = ata_state_busy;
|
||||||
|
IDE_UNLOCK(bus);
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < bus->max_devices; ++i) {
|
for (i = 0; i < bus->max_devices; ++i) {
|
||||||
if (bus->devices[i])
|
if (bus->devices[i])
|
||||||
destroy_device(bus->devices[i]);
|
destroy_device(bus->devices[i]);
|
||||||
@@ -220,6 +228,13 @@ scan_bus(ide_bus_info *bus)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// XXX fix me
|
||||||
|
IDE_LOCK(bus);
|
||||||
|
ASSERT(bus->state == ata_state_busy);
|
||||||
|
bus->state = ata_state_idle;
|
||||||
|
IDE_UNLOCK(bus);
|
||||||
|
|
||||||
TRACE("ATA: scan_bus: bus %p finished\n", bus);
|
TRACE("ATA: scan_bus: bus %p finished\n", bus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user