From: David Vrabel Date: Thu, 11 Sep 2014 13:20:04 +0000 (+0100) Subject: xen-scsifront: don't deadlock if the ring becomes full X-Git-Tag: firefly_0821_release~176^2~3080^2~8 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7921a11c7b2929f3ed6fe9081edcf695c60b23c6;p=firefly-linux-kernel-4.4.55.git xen-scsifront: don't deadlock if the ring becomes full scsifront_action_handler() will deadlock on host->host_lock, if the ring is full and it has to wait for entries to become available. Signed-off-by: David Vrabel Reviewed-by: Juergen Gross --- diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c index 7e88659bf5af..cc14c8ddd369 100644 --- a/drivers/scsi/xen-scsifront.c +++ b/drivers/scsi/xen-scsifront.c @@ -541,8 +541,9 @@ static int scsifront_action_handler(struct scsi_cmnd *sc, uint8_t act) if (!shadow) return FAILED; + spin_lock_irq(host->host_lock); + for (;;) { - spin_lock_irq(host->host_lock); if (!RING_FULL(&info->ring)) { ring_req = scsifront_command2ring(info, sc, shadow); if (ring_req)