mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Wang <peter.wang@mediatek.com>
To: Ilia Snezhkov <iasnezhkov@gmail.com>
Cc: <martin.petersen@oracle.com>,
	<James.Bottomley@HansenPartnership.com>, <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 2/3] scsi: ufs: mediatek: allow clock scaling when ufs_fde is absent
Date: Fri, 27 Nov 2026 14:44:59 +0800	[thread overview]
Message-ID: <484a58e10c4bc9cde24ef731a4bd3051b9decac6.camel@mediatek.com> (raw)
In-Reply-To: <179574184161.52486.4990124402659702610@gmail.com>

On Fri, 2026-11-27 at 09:10 +0800, Ilia Snezhkov wrote:
> Hi Peter,
> 
> No — this patch does not change whether UFSHCD_CAP_CLK_SCALING is
> enabled.
> 
> ufs_mtk_is_clk_scale_ready() only checks ufs_sel, ufs_sel_max_src,
> and
> ufs_sel_min_src, so on any platform (including MT6789) whose DT
> provides those three clocks, UFSHCD_CAP_CLK_SCALING is already
> enabled
> today and devfreq already runs. Platforms that omit
> ufs_sel_{min,max}_src
> still have UFSHCD_CAP_CLK_SCALING cleared as before.
> 
> What was broken without this patch is that when a DT provides ufs_sel
> and its min/max sources without ufs_fde, _ufs_mtk_clk_scale()
> returned
> early on `!fde_clki`, so ufs_sel never actually switched parents
> while
> ufshcd still treated the scaling transition as successful and updated
> clki->curr_freq.
> 
> With this change, MT6789's already-enabled clock scaling actually
> switches ufs_sel between 26 MHz (tck_26m_mx9) and 192 MHz
> (msdcpll_d2)
> as intended.
> 
> Best regards,
> Ilia

Hi Ilia,

Sorry, my question was not clear.
Because MediaTek sets the minimum gear to G4:
hba->clk_scaling.min_gear = UFS_HS_G4;
So if the host does not support UFS 4.0 or above, there 
should be no reason to enable clock scaling.
And MT6789 is UFSHCI 2.1, as I remember, so clock scaling
should be disabled and ufs_sel_max_src/ufs_sel_min_src 
should not be set. So I am curious why they have been set, 
and what behavior would clock scaling change in the power mode?

Thanks
Peter

  reply	other threads:[~2026-11-27  6:45 UTC|newest]

Thread overview: 11+ 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
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-27  1:10     ` Ilia Snezhkov
2026-11-27  6:44       ` Peter Wang [this message]
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
2026-11-27  1:14     ` Ilia Snezhkov
2026-11-27  7:11       ` 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=484a58e10c4bc9cde24ef731a4bd3051b9decac6.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 \
    /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

all inboxes | Powered by JetHome®