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;
|
cmnd->request = &req;
|
||||||
|
|
||||||
/* send command to host driver */
|
/* send command to host driver */
|
||||||
if (_sdev->host->hostt->queuecommand(_sdev->host, cmnd)) {
|
while((_sdev->host->hostt->queuecommand(_sdev->host, cmnd)) != 0) {
|
||||||
throw Request_congestion();
|
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);
|
device->ack_packet(*packet);
|
||||||
Genode::destroy(Genode::env()->heap(), packet);
|
Genode::destroy(Genode::env()->heap(), packet);
|
||||||
|
scsi_free_buffer(cmnd);
|
||||||
_scsi_free_command(cmnd);
|
_scsi_free_command(cmnd);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue