From: sashiko-bot@kernel.org
To: "HOYOUNG SEO" <hy50.seo@samsung.com>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH v1] scsi: ufs: Change the error check sequence for auto hibern8
Date: Wed, 21 Oct 2026 05:35:35 +0000 [thread overview]
Message-ID: <sashiko-outbox-179808@kernel.org> (raw)
In-Reply-To: <20261021051951.1687479-1-hy50.seo@samsung.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] scsi: ufs: fallthrough after auto hibern8 error in ufshcd_uic_cmd_compl()
--
commit 5bb3d85e5945c6dc3a3a1bb37e02acd5c7703a06
Author: HOYOUNG SEO <hy50.seo@samsung.com>
scsi: ufs: Change the error check sequence for auto hibern8
This commit moves the ufshcd_is_auto_hibern8_error() check in
ufshcd_uic_cmd_compl() ahead of the active_uic_cmd check so that
auto-hibern8 errors are recorded even when no UIC command is active.
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index cc75384c65021..e15b08488187f 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -5928,6 +5928,9 @@ static irqreturn_t ufshcd_uic_cmd_compl(struct ufs_hba *hba, u32 intr_status)
> struct uic_command *cmd;
>
> guard(spinlock_irqsave)(&hba->host->host_lock);
> + if (ufshcd_is_auto_hibern8_error(hba, intr_status))
> + hba->errors |= (UFSHCD_UIC_HIBERN8_MASK & intr_status);
> +
> cmd = hba->active_uic_cmd;
> if (!cmd) {
> dev_err(hba->dev,
> @@ -5935,9 +5938,6 @@ static irqreturn_t ufshcd_uic_cmd_compl(struct ufs_hba *hba, u32 intr_status)
> return retval;
> }
>
> - if (ufshcd_is_auto_hibern8_error(hba, intr_status))
> - hba->errors |= (UFSHCD_UIC_HIBERN8_MASK & intr_status);
> -
> if (intr_status & UIC_COMMAND_COMPL) {
> /*
> * Store the UIC command result in the lowest byte of
[Severity: Medium]
When ufshcd_is_auto_hibern8_error() returns true in ufshcd_uic_cmd_compl(),
execution still falls through after setting hba->errors:
drivers/ufs/core/ufshcd.c:ufshcd_uic_cmd_compl() {
...
if (ufshcd_is_auto_hibern8_error(hba, intr_status))
hba->errors |= (UFSHCD_UIC_HIBERN8_MASK & intr_status);
cmd = hba->active_uic_cmd;
if (!cmd) {
dev_err(hba->dev,
"No active UIC command. Maybe a timeout occurred?\n");
return retval;
}
...
if (intr_status & UFSHCD_UIC_PWR_MASK && hba->uic_async_done) {
cmd->cmd_active = false;
complete(hba->uic_async_done);
retval = IRQ_HANDLED;
}
...
}
In the normal auto-hibern8 case where no UIC command is active
(hba->active_uic_cmd is NULL), won't falling through to the !cmd check
always log a misleading "No active UIC command. Maybe a timeout occurred?"
error and return IRQ_NONE?
Also, if an asynchronous UIC command such as UIC_CMD_DME_SET is active with
hba->uic_async_done set when an auto-hibern8 error interrupt arrives,
UFSHCD_UIC_PWR_MASK includes UFSHCD_UIC_HIBERN8_MASK. Could falling through
with UFSHCD_UIC_HIBERN8_MASK still set in intr_status prematurely complete
hba->uic_async_done?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261021051951.1687479-1-hy50.seo@samsung.com?part=1
next prev parent reply other threads:[~2026-10-21 5:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20261021052403epcas2p43e1a022f46314c1a9d1ffb66502c29eb@epcas2p4.samsung.com>
2026-10-21 5:19 ` [PATCH v1] scsi: ufs: Change the error check sequence for auto hibern8 HOYOUNG SEO
2026-10-21 5:35 ` sashiko-bot [this message]
[not found] <CGME20261026052306epcas2p166bb6661beb7b60ba1c294034103469e@epcas2p1.samsung.com>
2026-10-26 5:18 ` HOYOUNG SEO
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=sashiko-outbox-179808@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=hy50.seo@samsung.com \
--cc=linux-scsi@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.