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:
Marcus Overhagen 2008-01-09 19:45:44 +00:00
parent a0183a22a1
commit d688a5ad65
2 changed files with 19 additions and 2 deletions

View File

@ -1023,16 +1023,18 @@ ata_read_infoblock(ide_device_info *device, bool isAtapi)
goto error;
}
// XXX fix me
IDE_LOCK(bus);
bus->state = ata_state_idle;
bus->state = ata_state_busy;
IDE_UNLOCK(bus);
TRACE("ata_read_infoblock: success\n");
return B_OK;
error:
// XXX fix me
IDE_LOCK(bus);
bus->state = ata_state_idle;
bus->state = ata_state_busy;
IDE_UNLOCK(bus);
return B_ERROR;
}

View File

@ -191,6 +191,14 @@ scan_bus(ide_bus_info *bus)
if (bus->disconnected)
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) {
if (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);
}