From: Peter Wang <peter.wang@mediatek.com>
To: Stanley Jhu <stanleyjhu@google.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Bean Huo <beanhuo@micron.com>,
"Bart Van Assche" <bvanassche@acm.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
"James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
Manivannan Sadhasivam <mani@kernel.org>,
<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<stable@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] scsi: ufs: core: Decouple CQ sweep from request iterator in MCQ
Date: Wed, 30 Sep 2026 15:32:41 +0800 [thread overview]
Message-ID: <c7ce0c71efb432696a40a1ee8b4d403822c8cbec.camel@mediatek.com> (raw)
In-Reply-To: <20260928035816.1294326-3-stanleyjhu@google.com>
On Mon, 2026-09-28 at 11:58 +0800, Stanley Jhu wrote:
> In MCQ mode, ufshcd_mcq_compl_pending_transfer() uses
> blk_mq_tagset_busy_iter() to iterate over busy requests during error
> recovery and host reset. However, both iterator callbacks perform
> whole-queue operations redundantly for each visited request:
>
> - force_compl == true: ufshcd_mcq_force_compl_one() calls
> ufshcd_mcq_compl_all_cqes_lock() on every busy request, sweeping
> the
> entire completion ring (hwq->max_entries slots) once per active
> request under spin_lock_irqsave even though the first sweep already
> cleared all completion entries.
> - force_compl == false: ufshcd_mcq_compl_one() acquires cq_lock and
> polls CQTPy over MMIO via ufshcd_mcq_poll_cqe_lock() for every busy
> request without doing any per-request work.
>
> Sweep or poll each hardware queue (hba->uhq[i]) once at the start of
> ufshcd_mcq_compl_pending_transfer(). When force_compl is true, run
> blk_mq_tagset_busy_iter() afterward to complete residual in-flight
> requests with DID_REQUEUE, and remove the now-unused
> ufshcd_mcq_compl_one() callback.
>
> Fixes: ab248643d3d6 ("scsi: ufs: core: Add error handling for MCQ
> mode")
> Cc: stable@vger.kernel.org
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
> Signed-off-by: Stanley Jhu <stanleyjhu@google.com>
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
next prev parent reply other threads:[~2026-09-30 7:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 3:58 [PATCH v3 0/2] scsi: ufs: core: Fix unsafe MMIO reads and redundant CQ sweeps in MCQ reset Stanley Jhu
2026-09-28 3:58 ` [PATCH v3 1/2] scsi: ufs: core: Avoid unsafe MMIO reads in ufshcd_mcq_compl_all_cqes_lock() Stanley Jhu
2026-09-28 17:45 ` Bart Van Assche
2026-09-28 3:58 ` [PATCH v3 2/2] scsi: ufs: core: Decouple CQ sweep from request iterator in MCQ Stanley Jhu
2026-09-30 7:32 ` Peter Wang [this message]
2026-10-06 2:43 ` [PATCH v3 0/2] scsi: ufs: core: Fix unsafe MMIO reads and redundant CQ sweeps in MCQ reset Martin K. Petersen (Oracle)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c7ce0c71efb432696a40a1ee8b4d403822c8cbec.camel@mediatek.com \
--to=peter.wang@mediatek.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=stable@vger.kernel.org \
--cc=stanleyjhu@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®