From: "Peter Wang (王信友)" <peter.wang@mediatek.com>
To: "sashiko-reviews@lists.linux.dev" <sashiko-reviews@lists.linux.dev>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH v1] ufs: core: serialize AHIT register access between sysfs and host driver
Date: Mon, 14 Sep 2026 08:33:05 +0000 [thread overview]
Message-ID: <8d2623b0cf6ce87e84c8171811f7fc8fff9ab90c.camel@mediatek.com> (raw)
In-Reply-To: <20260909092309.AE9861F0156E@smtp.kernel.org>
On Wed, 2026-09-09 at 09:23 +0000, sashiko-bot@kernel.org wrote:
> [Severity: High]
> Does this code leak the ahit_disable_depth counter if a power mode
> change
> fails?
>
> If ufshcd_dme_change_power_mode() fails after
> ufshcd_vops_pwr_change_notify()
> has run for PRE_CHANGE, the POST_CHANGE notification is skipped:
>
> drivers/ufs/core/ufshcd.c:ufshcd_change_power_mode() {
> ...
> ufshcd_vops_pwr_change_notify(hba, PRE_CHANGE, pwr_mode);
>
> ret = ufshcd_dme_change_power_mode(hba, pwr_mode,
> pmc_policy);
>
> if (!ret)
> ufshcd_vops_pwr_change_notify(hba, POST_CHANGE,
> pwr_mode);
> ...
> }
>
> Because POST_CHANGE is never called on failure, the
> ahit_disable_depth
> counter is never decremented. This permanently blocks sysfs AHIT
> updates in
> ufshcd_auto_hibern8_update() until the device is reset or the system
> is
> rebooted.
This is indeed an issue, I will fix it in the next version.
Thanks
Peter
prev parent reply other threads:[~2026-09-14 8:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 9:10 [PATCH v1] ufs: core: serialize AHIT register access between sysfs and host driver peter.wang
2026-09-09 9:23 ` sashiko-bot
2026-09-14 8:33 ` Peter Wang (王信友) [this message]
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=8d2623b0cf6ce87e84c8171811f7fc8fff9ab90c.camel@mediatek.com \
--to=peter.wang@mediatek.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.