Re: [PATCH 1/1] core: ufs: fix racing issue between force complete and isr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/24/23 01:43, alice.chao@xxxxxxxxxxxx wrote:
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 8382e8cfa414..ef6bd146a767 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -5518,13 +5518,13 @@ static void ufshcd_mcq_compl_pending_transfer(struct ufs_hba *hba,
  			 * For those cmds of which the cqes are not present
  			 * in the cq, complete them explicitly.
  			 */
+			spin_lock_irqsave(&hwq->cq_lock, flags);
  			if (cmd && !test_bit(SCMD_STATE_COMPLETE, &cmd->state)) {
-				spin_lock_irqsave(&hwq->cq_lock, flags);
  				set_host_byte(cmd, DID_REQUEUE);
  				ufshcd_release_scsi_cmd(hba, lrbp);
  				scsi_done(cmd);
-				spin_unlock_irqrestore(&hwq->cq_lock, flags);
  			}
+			spin_unlock_irqrestore(&hwq->cq_lock, flags);
  		} else {
  			ufshcd_mcq_poll_cqe_lock(hba, hwq);
  		}

Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux