On 6/26/23 18:26, hoyoung seo wrote:
@@ -5408,7 +5406,6 @@ static void ufshcd_release_scsi_cmd(struct ufs_hba *hba,
struct scsi_cmnd *cmd = lrbp->cmd;
scsi_dma_unmap(cmd);
- lrbp->cmd = NULL; /* Mark the command as completed. */
ufshcd_release(hba);
ufshcd_clk_scaling_update_busy(hba);
}
Hi,
Is there any reason to delete "lrbp->cmd = NULL"?
As far as I know, clear to NULL to indicate that cmd is completed.
When the UFS MCQ mode is activated, check that lrbp->cmd is NULL to check the completion of the command.
https://lore.kernel.org/linux-scsi/f0d923ee1f009f171a55c258d044e814ec0917ab.1685396241.git.quic_nguyenb@xxxxxxxxxxx/
If there is no special reason, why don't you add "lrb->cmd = NULL" again?
The lrbp->cmd = NULL assignment has been removed because if it would be kept
the SCSI error handler would crash if it reuses a SCSI command. See also the
scsi_eh_prep_cmnd() and scsi_eh_restore_cmnd() callers. The MCQ code should
still work because it uses blk_mq_request_started() to check whether or not
a request is still active.
Bart.