From: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
To: Rob Herring <robh@kernel.org>,
Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
Bart Van Assche <bvanassche@acm.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Peter Wang <peter.wang@mediatek.com>,
Stanley Jhu <chu.stanley@gmail.com>,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Chaotian Jing <Chaotian.Jing@mediatek.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
kernel@collabora.com, linux-scsi@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
linux-phy@lists.infradead.org,
Conor Dooley <conor.dooley@microchip.com>
Subject: Re: [PATCH v9 03/23] dt-bindings: ufs: mediatek,ufs: Add mt8196 variant
Date: Mon, 20 Jul 2026 18:21:28 +0200 [thread overview]
Message-ID: <8b013876c591f80ec4af86d69bf2f38f9ac481ad.camel@collabora.com> (raw)
In-Reply-To: <CAL_Jsq+mF_Q7Ld8__ZTc5yDvWAT6uK5wxfBJM-YdFjOvdiDc-w@mail.gmail.com>
Hi Rob,
On Tue, 2026-03-10 at 13:10 -0500, Rob Herring wrote:
> On Fri, Mar 6, 2026 at 12:37 PM Nicolas Frattaroli
> <nicolas.frattaroli@collabora.com> wrote:
> >
> > On Friday, 6 March 2026 17:33:05 Central European Standard Time Rob
> > Herring wrote:
> > > On Fri, Mar 06, 2026 at 02:24:44PM +0100, Nicolas Frattaroli
> > > wrote:
> > > > The MediaTek MT8196 SoC's UFS controller uses three additional
> > > > clocks
> > > > compared to the MT8195, and a different set of supplies. It is
> > > > therefore
> > > > not compatible with the MT8195.
> > > >
> > > > While it does have a AVDD09_UFS_1 pin in addition to the
> > > > AVDD09_UFS pin,
> > > > it appears that these two pins are commoned together, as the
> > > > board
> > > > schematic I have access to uses the same supply for both, and
> > > > the
> > > > downstream driver does not distinguish between the two supplies
> > > > either.
> > > >
> > > > Add a compatible for it, and modify the binding
> > > > correspondingly.
> > > >
> > > > Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> > > > Acked-by: Vinod Koul <vkoul@kernel.org>
> > > > Acked-by: Conor Dooley <conor.dooley@microchip.com>
> > > > Reviewed-by: AngeloGioacchino Del Regno
> > > > <angelogioacchino.delregno@collabora.com>
> > > > Signed-off-by: Nicolas Frattaroli
> > > > <nicolas.frattaroli@collabora.com>
> > > > ---
> > > > .../devicetree/bindings/ufs/mediatek,ufs.yaml | 58
> > > > +++++++++++++++++++++-
> > > > 1 file changed, 57 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git
> > > > a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml
> > > > b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml
> > > > index e0aef3e5f56b..a82119ecbfe8 100644
> > > > --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml
> > > > +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml
> > > > @@ -16,10 +16,11 @@ properties:
> > > > - mediatek,mt8183-ufshci
> > > > - mediatek,mt8192-ufshci
> > > > - mediatek,mt8195-ufshci
> > > > + - mediatek,mt8196-ufshci
> > > >
> > > > clocks:
> > > > minItems: 1
> > > > - maxItems: 13
> > > > + maxItems: 16
> > > >
> > > > clock-names:
> > > > minItems: 1
> > > > @@ -37,6 +38,9 @@ properties:
> > > > - const: crypt_perf
> > > > - const: ufs_rx_symbol0
> > > > - const: ufs_rx_symbol1
> > > > + - const: ufs_sel
> > >
> > > "ufs" is redundant as all the clocks are for UFS. Same comment on
> > > prior
> > > patch.
> >
> > Is this naming a big enough concern to block this series with two
> > explicit acks on this patch that fixes a wholly broken and useless
> > binding?
>
> Shrug... Is changing it really that hard?
>
Since I'm currently working on rebasing this series and fixing its
remaining open issues (compilation, dt-bindings warnings,...) to send a
new revision, I've looked at the questions you raised.
First, renaming those clocks and all the other starting with "ufs_"
prefix (including the one that is simply named ufs) is indeed easy and
needs just a little rework.
Mostly, a driver patch, as it is currently explicitly using the name of
the 3 ufs_sel clocks and devicetree patches to adapt to this change.
The next series revision will include the devicetree patches for MT8195
SoC and the two boards that integrate this SoC and an UFS storage
(Genio 1200 EVK UFS and Radxa NIO-12L), to fix the warnings that the
dt-binding changes, done by patch 1 (additional clocks, freq-table-hz
deprecation, additional power supplies) in the v9 revision, generate.
> > > > + - const: ufs_sel_min_src
> > > > + - const: ufs_sel_max_src
> > >
> > > "src" sounds like a parent clock? If so, probably shouldn't be in
> > > the
> > > clocks list. 'assigned-clocks' is for dealing with parent clocks.
> > >
> >
> > I don't know what it is, and I have no way to consult any
> > documentation
> > that would tell me what it is. I am trying to put out this dumpster
> > fire
> > of a downstream turd that made its way into mainline as the review
> > process
> > has been completely subverted, and is only getting worse with each
> > passing
> > month that MediaTek is allowed to block this series from
> > progressing while
> > sneaking further changes through.
>
> It's good Mediatek is active, then they can tell us what the clocks
> are for. I would think the driver would give some clue.
>
Second, when searching in the driver code and the git history, it shows
that ufs_sel is indeed a parent clock.
The ufs_sel/ufs_sel_min_src/ufs_sel_max_src clock use in the driver
code was introduced by the commit b7dbc686f60b ("scsi: ufs: ufs-
mediatek: Support clk-scaling to optimize power consumption") to
implement a dynamic clock scaling feature.
ufs_sel is supposed to be the parent clock of the main clock ("ufs" in
dt-bindings) and both ufs_sel_min_src/ufs_sel_max_src the parent of
ufs_sel.
The code switches conditionally the ufs_sel parent to modify the ufs
clock rate (ufs_sel_max_src for maximum performance, ufs_sel_min_src
otherwise).
I've also looked at different downstream kernel trees, the assigned
clocks values for those 3 clocks in the ufshci node in devicetree are
consistent with the clock hierarchy in the MT8196 clock controllers
drivers.
This feature also seems to be linked to another one that added the
clock scaling for the FDE clock (ufs_aes in dt-bindings).
The commit that introduced it is 5e5976f5242d ("scsi: ufs: host:
mediatek: Support FDE (AES) clock scaling") and it also added the 3
undocumented clocks: ufs_fde, ufs_fde_min_src, ufs_fde_max_src.
It is similar to the previous described one.
The current driver code seems to require having the "ufs_fde" clock
(supposed to be the ufs_aes parent clock) in the devicetree, so that
the clock scaling feature for the "ufs_sel" clock is performed and I
did not find why.
So, with this current series dt-bindings patches, ufs clock scaling
feature seems not completely described yet.
There is also the crypto boost feature that make use of the
crypt_mux/crypt_lp/crypt_perf clocks in a similar way.
They were missing from dt-bindings, before this series patches made by
Nicolas to documented them. Angelo also sent a patch two years ago in
that regard ([1]) but did not get picked.
The feature has been introduced by commit 590b0d2372fe ("scsi: ufs-
mediatek: Support performance mode for inline encryption engine")
The crypt_mux clock is also supposed to be the ufs_aes parent clock and
its own parent is switched on need between crypt_lp (low power) and
crypt_perf (performance).
This feature is also depending two undocumented property:
- dvfsrc-vcore-supply: Angelo sent [2] to add it and this current
series forgot to add it too (to be done for v10 ?)
- mediatek,ufs-boost-crypt: vendor specific property to enable this
feature. Angelo sent [3] to remove its need but got reject back then
Note that crypto boost and FDE clock scaling features seem not to be
supposed to be enabled at the same time.
Again, this crypto boost feature seems not completely described yet.
Sorry for the wall of text but I felt it was better to add extra
details regarding all those features and how they relate to each other
to have a more complete answer regarding ufs_sel.
[1]
https://lore.kernel.org/linux-mediatek/20240612074309.50278-8-angelogioacchino.delregno@collabora.com/
[2]
https://lore.kernel.org/linux-mediatek/20240612074309.50278-9-angelogioacchino.delregno@collabora.com/
[3]
https://lore.kernel.org/linux-mediatek/20240612074309.50278-4-angelogioacchino.delregno@collabora.com/
> I don't see how accepting sub-par bindings or not fixes the issues
> here.
So, since all these features rely heavily on optional parent clocks,
that were not documented before being used in driver code, what should
be done to make progress and fix these dt-bindings?
What would you recommend to do in order to resolve those topics?
I'm open for ideas, please.
Best regards,
Louis-Alexis
>
> Rob
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2026-07-20 16:22 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 13:24 [PATCH v9 00/23] MediaTek UFS Cleanup and MT8196 Enablement Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 01/23] dt-bindings: phy: Add mediatek,mt8196-ufsphy variant Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 02/23] dt-bindings: ufs: mediatek,ufs: Complete the binding Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 03/23] dt-bindings: ufs: mediatek,ufs: Add mt8196 variant Nicolas Frattaroli
2026-03-06 16:33 ` Rob Herring
2026-03-06 18:37 ` Nicolas Frattaroli
2026-03-07 18:01 ` Martin K. Petersen
2026-03-09 10:04 ` Nicolas Frattaroli
2026-03-10 18:21 ` Rob Herring
2026-03-16 9:34 ` AngeloGioacchino Del Regno
2026-03-10 18:10 ` Rob Herring
2026-07-20 16:21 ` Louis-Alexis Eyraud [this message]
2026-03-06 13:24 ` [PATCH v9 04/23] scsi: ufs: mediatek: Move MTK_SIP_UFS_CONTROL to mtk_sip_svc.h Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 05/23] phy: mediatek: ufs: Add support for resets Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 06/23] scsi: ufs: mediatek: Rework resets Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 07/23] scsi: ufs: mediatek: Rework 0.9V regulator Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 08/23] scsi: ufs: mediatek: Rework init function Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 09/23] scsi: ufs: mediatek: Rework the crypt-boost stuff Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 10/23] scsi: ufs: mediatek: Handle misc host voltage regulators Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 11/23] scsi: ufs: mediatek: Remove undocumented downstream reset cruft Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 12/23] scsi: ufs: mediatek: Remove vendor kernel quirks cruft Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 13/23] scsi: ufs: mediatek: Use the common PHY framework Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 14/23] scsi: ufs: mediatek: Remove mediatek,ufs-broken-rtc property Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 15/23] scsi: ufs: mediatek: Rework _ufs_mtk_clk_scale error paths Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 16/23] scsi: ufs: mediatek: Clean up logging prints Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 17/23] scsi: ufs: mediatek: Rework ufs_mtk_wait_idle_state Nicolas Frattaroli
2026-03-06 13:24 ` [PATCH v9 18/23] scsi: ufs: mediatek: Don't acquire dvfsrc-vcore twice Nicolas Frattaroli
2026-03-06 13:25 ` [PATCH v9 19/23] scsi: ufs: mediatek: Rework hardware version reading Nicolas Frattaroli
2026-03-08 10:31 ` kernel test robot
2026-03-06 13:25 ` [PATCH v9 20/23] scsi: ufs: mediatek: Back up idle timer in per-instance struct Nicolas Frattaroli
2026-03-18 1:41 ` Chaotian Jing (井朝天)
2026-03-06 13:25 ` [PATCH v9 21/23] scsi: ufs: mediatek: Remove ret local from link_startup_notify Nicolas Frattaroli
2026-03-06 13:25 ` [PATCH v9 22/23] scsi: ufs: mediatek: Remove undocumented "clk-scale-up-vcore-min" Nicolas Frattaroli
2026-03-18 2:23 ` Chaotian Jing (井朝天)
2026-03-06 13:25 ` [PATCH v9 23/23] scsi: ufs: mediatek: Add MT8196 compatible, update copyright Nicolas Frattaroli
2026-03-18 3:15 ` Chaotian Jing (井朝天)
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=8b013876c591f80ec4af86d69bf2f38f9ac481ad.camel@collabora.com \
--to=louisalexis.eyraud@collabora.com \
--cc=Chaotian.Jing@mediatek.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=avri.altman@wdc.com \
--cc=broonie@kernel.org \
--cc=bvanassche@acm.org \
--cc=chu.stanley@gmail.com \
--cc=chunfeng.yun@mediatek.com \
--cc=conor+dt@kernel.org \
--cc=conor.dooley@microchip.com \
--cc=devicetree@vger.kernel.org \
--cc=kernel@collabora.com \
--cc=kishon@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=neil.armstrong@linaro.org \
--cc=nicolas.frattaroli@collabora.com \
--cc=p.zabel@pengutronix.de \
--cc=peter.wang@mediatek.com \
--cc=robh@kernel.org \
--cc=vkoul@kernel.org \
/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