usb_drv: Check SCSI command queue state

In case the storage-entry point dispatches more then one packet, wait for the
previous command to finish before setting a new request. This has to be done
because the 'queuecommand' does actually *not* queue things, but can only handle
one request at the time.

Fix #1143
This commit is contained in:
Sebastian Sumpf 2014-05-06 17:00:34 +02:00 committed by Norman Feske
parent 53316bfd55
commit 24f97f9593
1 changed files with 4 additions and 2 deletions

View File

@ -116,8 +116,9 @@ class Storage_device : public Genode::List<Storage_device>::Element,
cmnd->request = &req;
/* send command to host driver */
if (_sdev->host->hostt->queuecommand(_sdev->host, cmnd)) {
throw Request_congestion();
while((_sdev->host->hostt->queuecommand(_sdev->host, cmnd)) != 0) {
Server::wait_and_dispatch_one_signal();
__wait_event();
}
}
@ -211,5 +212,6 @@ void Storage_device::_async_done(struct scsi_cmnd *cmnd)
device->ack_packet(*packet);
Genode::destroy(Genode::env()->heap(), packet);
scsi_free_buffer(cmnd);
_scsi_free_command(cmnd);
}