diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2012-08-31 14:34:19 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-08-31 15:47:57 +0200 |
commit | 347e40ffe61b7cc8d4565be476c20acd00611669 (patch) | |
tree | 12569c970e2ef4f46d7d3d34e3c5d48b986c5f42 /hw/usb/dev-uas.c | |
parent | adf478342b11cf9f540baf1f387b669210d3bea1 (diff) | |
download | qemu-347e40ffe61b7cc8d4565be476c20acd00611669.zip qemu-347e40ffe61b7cc8d4565be476c20acd00611669.tar.gz qemu-347e40ffe61b7cc8d4565be476c20acd00611669.tar.bz2 |
uas: move transfer kickoff
Kick next scsi transfer from request release callback instead of command
completion callback, otherwise we might get stuck in case scsi_req_unref()
doesn't release the request instantly due to someone else holding a
reference too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/dev-uas.c')
-rw-r--r-- | hw/usb/dev-uas.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c index b13eeba..5a0057a 100644 --- a/hw/usb/dev-uas.c +++ b/hw/usb/dev-uas.c @@ -424,6 +424,7 @@ static void usb_uas_scsi_free_request(SCSIBus *bus, void *priv) } QTAILQ_REMOVE(&uas->requests, req, next); g_free(req); + usb_uas_start_next_transfer(uas); } static UASRequest *usb_uas_find_request(UASDevice *uas, uint16_t tag) @@ -456,7 +457,6 @@ static void usb_uas_scsi_command_complete(SCSIRequest *r, uint32_t status, size_t resid) { UASRequest *req = r->hba_private; - UASDevice *uas = req->uas; trace_usb_uas_scsi_complete(req->uas->dev.addr, req->tag, status, resid); req->complete = true; @@ -465,7 +465,6 @@ static void usb_uas_scsi_command_complete(SCSIRequest *r, } usb_uas_queue_sense(req, status); scsi_req_unref(req->req); - usb_uas_start_next_transfer(uas); } static void usb_uas_scsi_request_cancelled(SCSIRequest *r) |