Re: [PATCH v1 1/2] ufs: core: complete scsi command after release

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

 



On 8/23/24 3:07 AM, peter.wang@xxxxxxxxxxxx wrote:
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 0b3d0c8e0dda..4bcd4e5b62bd 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -6482,8 +6482,12 @@ static bool ufshcd_abort_one(struct request *rq, void *priv)
  		if (!hwq)
  			return 0;
  		spin_lock_irqsave(&hwq->cq_lock, flags);
-		if (ufshcd_cmd_inflight(lrbp->cmd))
+		if (ufshcd_cmd_inflight(lrbp->cmd)) {
+			struct scsi_cmnd *cmd = lrbp->cmd;
+			set_host_byte(cmd, DID_REQUEUE);
  			ufshcd_release_scsi_cmd(hba, lrbp);
+			scsi_done(cmd);
+		}
  		spin_unlock_irqrestore(&hwq->cq_lock, flags);
  	}

Hmm ... isn't the ufshcd_complete_requests() call in ufshcd_abort_all()
expected to complete these commands? Can the above change lead to
scsi_done() being called twice, something that is not allowed?

Bart.





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux