mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Stanley Jhu <stanleyjhu@google.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Bean Huo <beanhuo@micron.com>
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>,
	Peter Wang <peter.wang@mediatek.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 1/2] scsi: ufs: core: Avoid unsafe MMIO reads in ufshcd_mcq_compl_all_cqes_lock()
Date: Fri, 25 Sep 2026 10:37:17 -0700	[thread overview]
Message-ID: <e48b50c2-fa01-4733-bc2b-aca9266212d2@acm.org> (raw)
In-Reply-To: <20260918143809.3034592-2-stanleyjhu@google.com>

On 9/18/26 7:38 AM, Stanley Jhu wrote:
> +	/* After processed the cqe, mark it empty (invalid) entry */

Please fix the grammar in the above source code comment and use capital
letters for "CQE".

> +	/*
> +	 * All completion entries have been processed and cleared.
> +	 * Synchronize tail to head in software to mark the queue empty,
> +	 * avoiding an MMIO read of CQTPy while the controller is disabled.
> +	 */
> +	hwq->cq_tail_slot = hwq->cq_head_slot;

This assignment can be removed because if the above code is reached
it is guaranteed that hwq->cq_tail_slot == hwq->cq_head_slot and later
code zeroes both slot indexes anyway (ufshcd_host_reset_and_restore()
-> ufshcd_mcq_config_resource()).

Thanks,

Bart.

  parent reply	other threads:[~2026-09-25 17:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01 12:23 [PATCH] " Stanley Jhu
2026-09-18 14:38 ` [PATCH v2 0/2] scsi: ufs: core: Fix unsafe MMIO reads and redundant CQ sweeps in MCQ reset Stanley Jhu
2026-09-18 14:38   ` [PATCH v2 1/2] scsi: ufs: core: Avoid unsafe MMIO reads in ufshcd_mcq_compl_all_cqes_lock() Stanley Jhu
2026-09-22  3:05     ` Peter Wang
2026-09-25 17:37     ` Bart Van Assche [this message]
2026-09-18 14:38   ` [PATCH v2 2/2] scsi: ufs: core: Decouple CQ sweep from request iterator in MCQ Stanley Jhu
2026-09-18 16:06     ` Bart Van Assche
2026-09-20 13:49       ` Stanley Jhu
2026-09-21 17:13         ` Bart Van Assche
2026-09-22  7:37           ` Peter Wang
2026-09-22 16:30             ` Bart Van Assche
2026-09-23  6:09               ` Peter Wang
2026-09-23 11:18                 ` Stanley Jhu
2026-09-23 17:02                   ` Bart Van Assche
2026-09-25 17:26                     ` Bart Van Assche
2026-09-23 16:50                 ` Bart Van Assche
2026-09-22  7:36         ` Peter Wang
2026-09-25 17:44     ` Bart Van Assche
2026-09-18 22:15 ` [PATCH] scsi: ufs: core: Avoid unsafe MMIO reads in ufshcd_mcq_compl_all_cqes_lock() Bart Van Assche

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=e48b50c2-fa01-4733-bc2b-aca9266212d2@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=peter.wang@mediatek.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®