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>
This commit is contained in:
parent
84e017fe91
commit
a8886a5856
1 changed files with 2 additions and 0 deletions
|
@ -2436,6 +2436,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
|
||||||
|
|
||||||
err = ufshcd_send_command(hba, tag);
|
err = ufshcd_send_command(hba, tag);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
spin_unlock_irqrestore(hba->host->host_lock, flags);
|
||||||
scsi_dma_unmap(lrbp->cmd);
|
scsi_dma_unmap(lrbp->cmd);
|
||||||
lrbp->cmd = NULL;
|
lrbp->cmd = NULL;
|
||||||
clear_bit_unlock(tag, &hba->lrb_in_use);
|
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",
|
dev_err(hba->dev, "%s: failed sending command, %d\n",
|
||||||
__func__, err);
|
__func__, err);
|
||||||
err = DID_ERROR;
|
err = DID_ERROR;
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
|
|
Loading…
Add table
Reference in a new issue