mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-13 22:23:45 +00:00
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:
parent
53316bfd55
commit
24f97f9593
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user