From: Peter Wang <peter.wang@mediatek.com>
To: <iasnezhkov@gmail.com>, <stanley.chu@mediatek.com>,
<martin.petersen@oracle.com>,
<James.Bottomley@HansenPartnership.com>
Cc: <matthias.bgg@gmail.com>,
<angelogioacchino.delregno@collabora.com>,
<louisalexis.eyraud@collabora.com>, <linux-scsi@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] scsi: ufs: mediatek: skip PA_TXHSADAPTTYPE on pre-UniPro-1.8 hosts
Date: Thu, 26 Nov 2026 21:01:30 +0800 [thread overview]
Message-ID: <4cd159bd4204d92dc0d9a79e6f7aa53c1fa9f2de.camel@mediatek.com> (raw)
In-Reply-To: <20261126031008.27506-2-iasnezhkov@gmail.com>
On Thu, 2026-11-26 at 03:10 +0000, Ilia Snezhkov via B4 Relay wrote:
> From: Ilia Snezhkov <iasnezhkov@gmail.com>
>
> 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". While mainline
> ufshcd_change_power_mode() ignores the PRE_CHANGE return value after
> commit d3eba21c7170 ("scsi: ufs: core: Introduce a new ufshcd vops
> negotiate_pwr_mode()"), older stable kernels still discard the
> negotiated parameters on PRE_CHANGE failure, and mainline still emits
> spurious DME-SET errors on every power-mode transition.
>
> 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.
>
> Fixes: 7212d624f863 ("scsi: ufs: host: mediatek: Fix PWM mode switch
> issue")
> Signed-off-by: Ilia Snezhkov <iasnezhkov@gmail.com>
> ---
Hi Ilia,
Thank you for fixing this bug.
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
next prev parent reply other threads:[~2026-11-26 13:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 3:10 [PATCH v2 0/3] scsi: ufs: mediatek: pre-UniPro-1.8 adapt and clock scaling fixes Ilia Snezhkov via B4 Relay
2026-11-26 3:10 ` [PATCH v2 1/3] scsi: ufs: mediatek: skip PA_TXHSADAPTTYPE on pre-UniPro-1.8 hosts Ilia Snezhkov via B4 Relay
2026-11-26 13:01 ` Peter Wang [this message]
2026-11-26 3:10 ` [PATCH v2 2/3] scsi: ufs: mediatek: allow clock scaling when ufs_fde is absent Ilia Snezhkov via B4 Relay
2026-11-26 13:03 ` Peter Wang
2026-11-26 3:10 ` [PATCH v2 3/3] scsi: ufs: mediatek: round scalable clock bounds to clk_round_rate() Ilia Snezhkov via B4 Relay
2026-11-26 13:04 ` Peter Wang
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=4cd159bd4204d92dc0d9a79e6f7aa53c1fa9f2de.camel@mediatek.com \
--to=peter.wang@mediatek.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=iasnezhkov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=louisalexis.eyraud@collabora.com \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=stanley.chu@mediatek.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