[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <590cbc0e-51a5-5738-cb2e-7619adf2e4be@acm.org>
Date: Wed, 10 May 2023 15:00:57 -0700
From: Bart Van Assche <bvanassche@....org>
To: "Bao D. Nguyen" <quic_nguyenb@...cinc.com>,
quic_asutoshd@...cinc.com, quic_cang@...cinc.com, mani@...nel.org,
stanley.chu@...iatek.com, adrian.hunter@...el.com,
beanhuo@...ron.com, avri.altman@....com, martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org, Alim Akhtar <alim.akhtar@...sung.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
Arthur Simchaev <Arthur.Simchaev@....com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 4/7] ufs: mcq: Add support for clean up mcq resources
On 5/9/23 22:24, Bao D. Nguyen wrote:
> +bool ufshcd_cmd_inflight(struct scsi_cmnd *cmd)
> +{
> + struct request *rq;
> +
> + if (!cmd)
> + return false;
> +
> + rq = scsi_cmd_to_rq(cmd);
> + if (!rq || !blk_mq_request_started(rq))
> + return false;
> +
> + return true;
The return value of scsi_cmd_to_rq() is never NULL so please remove the
!rq test.
> @@ -7450,8 +7499,8 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
>
> ufshcd_hold(hba, false);
> reg = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
> - /* If command is already aborted/completed, return FAILED. */
> - if (!(test_bit(tag, &hba->outstanding_reqs))) {
> + if (!is_mcq_enabled(hba) && !test_bit(tag, &hba->outstanding_reqs)) {
> + /* If command is already aborted/completed, return FAILED. */
> dev_err(hba->dev,
> "%s: cmd at tag %d already completed, outstanding=0x%lx, doorbell=0x%x\n",
> __func__, tag, hba->outstanding_reqs, reg);
With the above change, the doorbell register is read even in MCQ mode.
Shouldn't reading the doorbell register be skipped in MCQ mode?
Thanks,
Bart.
Powered by blists - more mailing lists