lkml.org 
[lkml]   [2021]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 4/9] scsi: ufs: Complete the cmd before returning in queuecommand
From
Date
On 6/9/21 9:43 PM, Can Guo wrote:
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 0c9d2ee..7dc0fda 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -2758,6 +2758,16 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
> goto out;
> }
>
> + if (unlikely(test_bit(tag, &hba->outstanding_reqs))) {
> + if (hba->wl_pm_op_in_progress) {
> + set_host_byte(cmd, DID_BAD_TARGET);
> + cmd->scsi_done(cmd);
> + } else {
> + err = SCSI_MLQUEUE_HOST_BUSY;
> + }
> + goto out;
> + }
> +
> hba->req_abort_count = 0;
>
> err = ufshcd_hold(hba, true);
> @@ -2768,15 +2778,6 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
> WARN_ON(ufshcd_is_clkgating_allowed(hba) &&
> (hba->clk_gating.state != CLKS_ON));
>
> - if (unlikely(test_bit(tag, &hba->outstanding_reqs))) {
> - if (hba->wl_pm_op_in_progress)
> - set_host_byte(cmd, DID_BAD_TARGET);
> - else
> - err = SCSI_MLQUEUE_HOST_BUSY;
> - ufshcd_release(hba);
> - goto out;
> - }
> -
> lrbp = &hba->lrb[tag];
> WARN_ON(lrbp->cmd);
> lrbp->cmd = cmd;

Can the code under "if (unlikely(test_bit(tag,
&hba->outstanding_reqs)))" be deleted instead of moving it? I don't
think that it is useful to verify whether the block layer tag allocator
works correctly. Additionally, I'm not aware of any similar code in any
other SCSI LLD.

Thanks,

Bart.


\
 
 \ /
  Last update: 2021-06-11 22:53    [W:0.364 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site