From: sashiko-bot@kernel.org
To: "Ilia Snezhkov" <iasnezhkov@gmail.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/3] scsi: ufs: mediatek: skip PA_TXHSADAPTTYPE on pre-UniPro-1.8 hosts
Date: Thu, 26 Nov 2026 00:59:55 +0000 [thread overview]
Message-ID: <sashiko-outbox-234511@kernel.org> (raw)
In-Reply-To: <20261126005329.72010-2-iasnezhkov@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] scsi: ufs: mediatek: inaccurate Fixes tag for
ufs_mtk_pre_pwr_change()
--
commit 7768df4fa0e6861ba7a4e62b4a777b086e4e8d42
Author: Ilia Snezhkov <iasnezhkov@gmail.com>
> scsi: ufs: mediatek: skip PA_TXHSADAPTTYPE on pre-UniPro-1.8 hosts
>
> ufs_mtk_pre_pwr_change() calls ufshcd_dme_configure_adapt() on every
> power mode change, which writes PA_TXHSADAPTTYPE (0x15d4) even when
> passing PA_NO_ADAPT. PA_TXHSADAPTTYPE was introduced in UniPro 1.8, and
> ufs_mtk_get_controller_version() sets host->hw_ver.major = 3 only when
> PA_LOCALVERINFO >= UFS_UNIPRO_VER_1_8 (leaving older hosts at major = 2).
>
> On pre-UniPro-1.8 MediaTek hosts such as MT6789 (UFS 2.2, HS-G3 rate B),
> the DME write fails on every gear change with
> "dme-set: attr-id 0x15d4 val 0x3 failed 0 retries". Because the failing
> status is returned from PRE_CHANGE, ufshcd_config_pwr_mode() discards
> the negotiated parameters and applies the caller's desired parameters
> instead.
>
> Return early from ufs_mtk_pre_pwr_change() when host->hw_ver.major < 3
> so pre-UniPro-1.8 hosts do not write PA_TXHSADAPTTYPE, and simplify the
> remaining major >= 3 branch.
>
> Found on hardware and drafted with an AI coding assistant.
>
> Fixes: e1e25d1b8996 ("scsi: ufs: ufs-mediatek: Use common ADAPT configuration function")
> Signed-off-by: Ilia Snezhkov <iasnezhkov@gmail.com>
[Severity: Low]
Should the Fixes tag reference 7212d624f863 ("scsi: ufs: host: mediatek:
Fix PWM mode switch issue") instead?
In e1e25d1b8996 ("scsi: ufs: ufs-mediatek: Use common ADAPT configuration
function"), the call to ufshcd_dme_configure_adapt() was still guarded by
if (host->hw_ver.major >= 3). The else branch calling
ufshcd_dme_configure_adapt(..., PA_NO_ADAPT) when host->hw_ver.major < 3
was added by 7212d624f863 ("scsi: ufs: host: mediatek: Fix PWM mode switch
issue").
Also, the description of ufshcd_config_pwr_mode() discarding negotiated
parameters on PRE_CHANGE failure no longer matches the current tree, as
d3eba21c7170 ("scsi: ufs: core: Introduce a new ufshcd vops
negotiate_pwr_mode()") moved negotiation to
ufshcd_vops_negotiate_pwr_mode() and ufshcd_change_power_mode() ignores
the return value of PRE_CHANGE.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261126005329.72010-1-iasnezhkov@gmail.com?part=1
next prev parent reply other threads:[~2026-11-26 0:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 0:53 [PATCH 0/3] scsi: ufs: mediatek: pre-UniPro-1.8 adapt and clock scaling fixes Ilia Snezhkov via B4 Relay
2026-11-26 0:53 ` [PATCH 1/3] scsi: ufs: mediatek: skip PA_TXHSADAPTTYPE on pre-UniPro-1.8 hosts Ilia Snezhkov via B4 Relay
2026-11-26 0:59 ` sashiko-bot [this message]
2026-11-26 0:53 ` [PATCH 2/3] scsi: ufs: mediatek: allow clock scaling when ufs_fde is absent Ilia Snezhkov via B4 Relay
2026-11-26 0:53 ` [PATCH 3/3] scsi: ufs: mediatek: round scalable clock bounds to clk_round_rate() Ilia Snezhkov via B4 Relay
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-234511@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=iasnezhkov@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox