summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilad Broner <gbroner@codeaurora.org>2014-12-16 23:24:54 +0200
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 10:58:18 -0700
commita8886a5856a4443f00dcff860285c5eb9d318d17 (patch)
tree4a233a2fba72be0d9f3f369af266a4c4b67a49e4
parent84e017fe916fea0cb9407ab73cc73c99072f624a (diff)
scsi: ufs: fix spinlock recursion in ufshcd_queuecommand()
Before calling ufshcd_send_command() the host spinlock is taken. In case error is returned ufshcd_release_all() is called, which in turn attempts to lock the host spinlock again. Unlocked the host spinlock in case error was returned to prevent the spinlock recursion. Change-Id: I630ac8b901f03285a37547bfbcd49ec575e7545a Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
-rw-r--r--drivers/scsi/ufs/ufshcd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index ebfbac0f567c..69c71035bf28 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2436,6 +2436,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
err = ufshcd_send_command(hba, tag);
if (err) {
+ spin_unlock_irqrestore(hba->host->host_lock, flags);
scsi_dma_unmap(lrbp->cmd);
lrbp->cmd = NULL;
clear_bit_unlock(tag, &hba->lrb_in_use);
@@ -2443,6 +2444,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
dev_err(hba->dev, "%s: failed sending command, %d\n",
__func__, err);
err = DID_ERROR;
+ goto out;
}
out_unlock: