[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b9a95d55856c0530659cb2f364e5a525@codeaurora.org>
Date: Wed, 23 Jun 2021 15:39:46 +0800
From: Can Guo <cang@...eaurora.org>
To: asutoshd@...eaurora.org, nguyenb@...eaurora.org,
hongwus@...eaurora.org, ziqichen@...eaurora.org,
linux-scsi@...r.kernel.org, kernel-team@...roid.com,
cang@...eaurora.org
Cc: Alim Akhtar <alim.akhtar@...sung.com>,
Avri Altman <avri.altman@....com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Stanley Chu <stanley.chu@...iatek.com>,
Bean Huo <beanhuo@...ron.com>,
Jaegeuk Kim <jaegeuk@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/10] scsi: ufs: Complete the cmd before returning in
queuecommand
Sorry, please ignore this change, it is wrongly sent out along with this
series...
On 2021-06-23 15:35, Can Guo wrote:
> Commit 7a7e66c65d4148fc3f23b058405bc9f102414fcb ("scsi: ufs: Fix a race
> condition between ufshcd_abort() and eh_work()") forgot to complete the
> cmd, which takes an occupied lrb, before returning in queuecommand.
> This
> change adds the missing codes.
>
> Fixes: 7a7e66c65d414 ("scsi: ufs: Fix a race condition between
> ufshcd_abort() and eh_work()")
> Signed-off-by: Can Guo <cang@...eaurora.org>
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 5f837c4..7fbc63e 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->wlu_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->wlu_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;
Powered by blists - more mailing lists