Skip to content

Commit

Permalink
uas: move transfer kickoff
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kraxel committed Aug 31, 2012
1 parent adf4783 commit 347e40f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions hw/usb/dev-uas.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit 347e40f

Please sign in to comment.