mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bean Huo <beanhuo@iokpp.de>
To: Kiwoong Kim <kwmad.kim@samsung.com>,
	linux-scsi@vger.kernel.org,  linux-kernel@vger.kernel.org,
	alim.akhtar@samsung.com, jejb@linux.ibm.com,
	 martin.petersen@oracle.com, bvanassche@acm.org,
	kwangwon.min@samsung.com,  hy50.seo@samsung.com,
	cpgs@samsung.com, h10.kim@samsung.com
Cc: stable@vger.kernel.org, stanleyjhu@google.com
Subject: Re: [PATCH v5 2/2] ufs: mcq: poll OCS after sq cleanup for device management commands
Date: Wed, 04 Nov 2026 21:17:58 +0100	[thread overview]
Message-ID: <41f787035d4a5d68b403bb0f443fe6ab533ff1ca.camel@iokpp.de> (raw)
In-Reply-To: <20261104094914.180788-3-kwmad.kim@samsung.com>

On Wed, 2026-11-04 at 18:49 +0900, Kiwoong Kim wrote:
> Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
> ---
>  drivers/ufs/core/ufs-mcq.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
> index 8106d55f4041..100295d02c62 100644
> --- a/drivers/ufs/core/ufs-mcq.c
> +++ b/drivers/ufs/core/ufs-mcq.c
> @@ -609,6 +609,24 @@ int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int
> task_tag)
>                          __func__, id,
>                          FIELD_GET(SQ_ICU_ERR_CODE_MASK, readl(reg)));
>  
> +       /*
> +        * For device management commands, there is no order guaranteed
> between
> +        * OCS update and CUS update, which is why we need to wait here. SCSI
> +        * commands are excluded because the OCS in their UTRD is not updated
> +        * from the CQE.
> +        */
> +       if (!err && blk_mq_is_reserved_rq(rq)) {
> +               enum utp_ocs ocs;
> +
> +               err = read_poll_timeout(READ_ONCE, ocs,

Bart, 

READ_ONCE() is enough to read OCS, but the lock also is to make sure   
ufshcd_compl_one_cqe() has finished?  the window is very small, and the lock
only costs something on this error handling path. 

tell me if I missed something.

Kind regards, 
Bean





  reply	other threads:[~2026-11-04 20:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20261104094922epcas2p275e9b663a40b1a6f86f208f11e21ae64@epcas2p2.samsung.com>
2026-11-04  9:49 ` [PATCH v5 0/2] ufs: fix the abort path of device management commands in MCQ mode Kiwoong Kim
     [not found]   ` <CGME20261104094924epcas2p2318e84e3593e6e77e4c933dd3e4adfc6@epcas2p2.samsung.com>
2026-11-04  9:49     ` [PATCH v5 1/2] ufs: core: skip ABORT TASK for device management commands Kiwoong Kim
     [not found]   ` <CGME20261104094925epcas2p1f25905de00c2548e1e1349fba5f18551@epcas2p1.samsung.com>
2026-11-04  9:49     ` [PATCH v5 2/2] ufs: mcq: poll OCS after sq cleanup " Kiwoong Kim
2026-11-04 20:17       ` Bean Huo [this message]
2026-11-04 21:34         ` Bart Van Assche
2026-11-04 20:19       ` Bean Huo

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=41f787035d4a5d68b403bb0f443fe6ab533ff1ca.camel@iokpp.de \
    --to=beanhuo@iokpp.de \
    --cc=alim.akhtar@samsung.com \
    --cc=bvanassche@acm.org \
    --cc=cpgs@samsung.com \
    --cc=h10.kim@samsung.com \
    --cc=hy50.seo@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=kwangwon.min@samsung.com \
    --cc=kwmad.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.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®