From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: Stephan Gerhold <stephan.gerhold@linaro.org>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-mtd@lists.infradead.org, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/4] mtd: rawnand: qcom: Add MDM9607
Date: Mon, 06 Jul 2026 16:42:21 +0200 [thread overview]
Message-ID: <87y0foji2a.fsf@bootlin.com> (raw)
In-Reply-To: <v4wc36d5slcbq6vsubrpzdoz6x7iq2t2xxlg7onak7fq3bcpjz@kxoqbvi734pp> (Manivannan Sadhasivam's message of "Mon, 6 Jul 2026 16:19:04 +0200")
On 06/07/2026 at 16:19:04 +02, Manivannan Sadhasivam <mani@kernel.org> wrote:
> On Mon, Jul 06, 2026 at 03:26:18PM +0200, Stephan Gerhold wrote:
>> On Mon, Jul 06, 2026 at 03:18:18PM +0200, Miquel Raynal wrote:
>> > On 06/07/2026 at 14:55:26 +02, Stephan Gerhold <stephan.gerhold@linaro.org> wrote:
>> > > On Mon, Jun 29, 2026 at 05:46:57PM +0200, Manivannan Sadhasivam wrote:
>> > >> On Mon, Jun 08, 2026 at 03:20:21PM +0200, Stephan Gerhold wrote:
>> > >> > MDM9607 has QPIC v1.5 that supports the OP_PAGE_READ_ONFI_READ command, but
>> > >> > is missing the rest of the hardware changes in QPIC v2. There is also only
>> > >> > a single clock that can be controlled using the RPM firmware. Document and
>> > >> > add the new qcom,mdm9607-nand compatible for this setup.
>> > >> >
>> > >> > Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
>> > >>
>> > >> You could ammend patch 1's commit message with the information I shared in the
>> > >> reply. But nevertheless:
>> > >>
>> > >> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
>> > >>
>> > >
>> > > Do you want me to resend the series with patch 1 commit message
>> > > adjusted? There were no other changes requested as far as I can tell.
>> >
>> > I was mostly waiting for answers on my questions from the DT binding
>> > maintainers, but I understand they must be too loaded at the moment.
>> >
>> > > I think the current commit message there is fine, especially if you add
>> > > the Link: tag during applying. The extra context will be there.
>> > >
>> > > If you want me to resend, I would just replace the second paragraph in
>> > > patch 1 with the following:
>> > >
>> > > ---
>> > > On MDM9607 and other recent SoCs, the QPIC hardware requires 3 clocks
>> > > (ahb, core, aon). However, the access to these clocks is restricted to
>> > > the RPM firmware that controls the shared power resources for the whole
>> > > SoC. The clocks cannot be controlled separately, there is only a single
>> > > RPM_SMD_QPIC_CLK clock that implicitly enables all of the 3 clocks.
>> > > The only exception to this are some IPQ* SoC that are not using RPM,
>> > > there the clocks are directly controlled by the kernel via the clock
>> > > controller (GCC). Require only one clock in the dt-bindings for MDM9607
>> > > to avoid having to define dummy clock entries.
>> >
>> > I am sorry but this is still incorrect. You don't have to define 2 dummy
>> > clocks. You would have to define 3 times the same clock (and that's not
>> > a problem). I have been working on the concept of clock nexus which
>> > may solve this kind of issue in a rather elegant way but that's not
>> > ready yet.
>> >
>> > In my opinion the binding that you want to push (a single clock) is
>> > wrong, but since I've been explaining this for several weeks already,
>> > please at least fix the commit message and I will take it as you want.
>> >
>>
>> Thanks for your feedback!
>>
>> Either way works for me personally, but now we have a conflict between
>> your requested changes and the feedback from Mani, who maintains this
>> driver. :-)
>>
>> @Mani: Would you also be fine with defining all 3 clocks in the DT
>> ("ahb", "core", "aon") and then assigning the RPM_SMD_QPIC_CLK to all of
>> them?
>>
>
> AFAIU, devicetree binding should describe the "OS view of the
> hardware", not the
Like Geert pointed out in the below thread, I am equally surprised by
this shift but I guess SoC complexity requires adaptations.
> hardware itself. We have many predecents to this rule. One of them is the SCMI
> based resource control in Qcom Automotive SoCs, where clocks/regulators to
> individual IPs are controlled by the SCMI server and OS just sees a single SCMI
> power-domain for the IP. So we only describe the SCMI power-domain in the
> binding and not the physical clocks/regulators received by the IP in hardware.
>
> We had a recent discussion around the same topic and you can see the reply from
> Krzk here: https://lore.kernel.org/all/c83ca485-1e2e-46ba-bd15-1168aa8955d3@kernel.org
>
> So here also, the hardware receives 3 clocks physically, but OS cannot control
> all 3 of them, but just a single clock from RPMh which controls the 3 real
> clocks. Moreover, assigning the same clock to 3 different clock sources doesn't
> accurately describe the hardware either, because those 3 clocks operate on
> different frequencies
Ah, this is a point that was missing to my understanding. You actually
have three *different* clocks, and you control all of them through some
kind of firmware proxy called RPMh with a single handle. So basically
the kernel just enables one clock and the firmware enables/configures
two other clocks differently automatically. Is that it? Feels like you
almost need a power domain here.
> and if the driver queries the frequency of
> RPM_SMD_QPIC_CLK, it would just return the same frequency. This is where the
> dummy clock comes handy as it atleast provides a valid clock frequency to the
> driver. But I'm not advocating for its usage here anymore.
>
> Hence IMO, assigning the same RPM_SMD_QPIC_CLK to all 3 clocks is not the right
> approach and we should be assigning a single RPM_SMD_QPIC_CLK to
> 'core' clk.
You said using three times the same clock would be wrong because we
would get three times the same rate whereas in practice it's wrong. This
means the OS has access to these clocks somehow, so if we need to
describe what the OS sees of the hardware, as you say, defining a single
clock is incomplete.
Again, I am not totally opposed to the single clock idea if you all feel
like this is the way forward. Yet, it sounds a bit hackish.
> @krzk: Can you share your opinion?
Thanks,
Miquèl
next prev parent reply other threads:[~2026-07-06 14:42 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 13:20 [PATCH 0/4] mtd: rawnand: qcom: Add MDM9607 Stephan Gerhold
2026-06-08 13:20 ` [PATCH 1/4] dt-bindings: mtd: qcom,nandc: Add MDM9607 QPIC NAND controller Stephan Gerhold
2026-06-09 7:19 ` Krzysztof Kozlowski
2026-06-09 7:52 ` Miquel Raynal
2026-06-09 8:10 ` Stephan Gerhold
2026-06-09 8:55 ` Konrad Dybcio
2026-06-09 9:01 ` Konrad Dybcio
2026-06-09 9:08 ` Stephan Gerhold
2026-06-09 9:30 ` Miquel Raynal
2026-06-09 10:02 ` Stephan Gerhold
2026-06-17 11:42 ` Konrad Dybcio
2026-06-29 15:06 ` Miquel Raynal
2026-06-29 15:45 ` Manivannan Sadhasivam
2026-06-08 13:20 ` [PATCH 2/4] mtd: rawnand: qcom: Make "aon" clock optional Stephan Gerhold
2026-06-09 7:24 ` Krzysztof Kozlowski
2026-06-08 13:20 ` [PATCH 3/4] mtd: rawnand: qcom: Make has_onfi_read_op separate from qpic_version2 Stephan Gerhold
2026-06-08 13:20 ` [PATCH 4/4] mtd: rawnand: qcom: Add MDM9607 compatible Stephan Gerhold
2026-06-29 15:46 ` [PATCH 0/4] mtd: rawnand: qcom: Add MDM9607 Manivannan Sadhasivam
2026-07-06 12:55 ` Stephan Gerhold
2026-07-06 13:18 ` Miquel Raynal
2026-07-06 13:26 ` Stephan Gerhold
2026-07-06 14:19 ` Manivannan Sadhasivam
2026-07-06 14:42 ` Miquel Raynal [this message]
2026-07-06 16:00 ` Manivannan Sadhasivam
2026-07-06 16:13 ` Miquel Raynal
2026-07-06 16:18 ` Krzysztof Kozlowski
2026-07-07 6:31 ` Miquel Raynal
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=87y0foji2a.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mani@kernel.org \
--cc=richard@nod.at \
--cc=robh@kernel.org \
--cc=stephan.gerhold@linaro.org \
--cc=vigneshr@ti.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