mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] scsi: ufs: mediatek: pre-UniPro-1.8 adapt and clock scaling fixes
@ 2026-11-26  0:53 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
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ilia Snezhkov via B4 Relay @ 2026-11-26  0:53 UTC (permalink / raw)
  To: peter.wang, stanley.chu, martin.petersen, James.Bottomley
  Cc: matthias.bgg, angelogioacchino.delregno, louisalexis.eyraud,
	linux-scsi, linux-mediatek, linux-kernel

This series fixes three bugs in the MediaTek UFS host driver observed on
MT6789 (UFS 2.2, pre-UniPro-1.8, HS-G3 rate B, no ufs_fde clock):

1. Skip ufshcd_dme_configure_adapt() when host->hw_ver.major < 3 so
   pre-UniPro-1.8 hosts do not fail DME-SET on PA_TXHSADAPTTYPE (0x15d4)
   and discard negotiated power-mode parameters on every gear change.
2. Allow _ufs_mtk_clk_scale() to switch ufs_sel when the optional
   ufs_fde clock is absent, matching ufs_mtk_is_clk_scale_ready().
3. Round clki->max_freq and clki->min_freq with clk_round_rate() during
   ufs_mtk_init_clocks() (keeping clki->curr_freq synchronized and
   preserving min < max <= U32_MAX) so PLL-derived clocks whose rounded
   rate differs from the nominal DT frequency can scale back up in
   ufshcd_devfreq_target().

Found on hardware and drafted with an AI coding assistant.

Ilia Snezhkov (3):
  scsi: ufs: mediatek: skip PA_TXHSADAPTTYPE on pre-UniPro-1.8 hosts
  scsi: ufs: mediatek: allow clock scaling when ufs_fde is absent
  scsi: ufs: mediatek: round scalable clock bounds to clk_round_rate()

 drivers/ufs/host/ufs-mediatek.c | 58 +++++++++++++++++++++++++--------
 1 file changed, 45 insertions(+), 13 deletions(-)

-- 
2.54.0 (Apple Git-157)




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-26  0:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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: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

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®