[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250514160841.GA2427890-robh@kernel.org>
Date: Wed, 14 May 2025 11:08:41 -0500
From: Rob Herring <robh@...nel.org>
To: Stephan Gerhold <stephan.gerhold@...aro.org>
Cc: Bjorn Andersson <andersson@...nel.org>,
Jassi Brar <jassisinghbrar@...il.com>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-clk@...r.kernel.org, Georgi Djakov <djakov@...nel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Subject: Re: [PATCH 1/4] dt-bindings: mailbox: qcom,apcs: Add separate node
for clock-controller
On Tue, May 13, 2025 at 02:16:59PM +0100, Stephan Gerhold wrote:
> On Sun, May 11, 2025 at 05:48:11PM -0500, Bjorn Andersson wrote:
> > On Tue, May 06, 2025 at 03:10:08PM +0200, Stephan Gerhold wrote:
> > > APCS "global" is sort of a "miscellaneous" hardware block that combines
> > > multiple registers inside the application processor subsystem. Two distinct
> > > use cases are currently stuffed together in a single device tree node:
> > >
> > > - Mailbox: to communicate with other remoteprocs in the system.
> > > - Clock: for controlling the CPU frequency.
> > >
> > > These two use cases have unavoidable circular dependencies: the mailbox is
> > > needed as early as possible during boot to start controlling shared
> > > resources like clocks and power domains, while the clock controller needs
> > > one of these shared clocks as its parent. Currently, there is no way to
> > > distinguish these two use cases for generic mechanisms like fw_devlink.
> > >
> > > This is currently blocking conversion of the deprecated custom "qcom,ipc"
> > > properties to the standard "mboxes", see e.g. commit d92e9ea2f0f9
> > > ("arm64: dts: qcom: msm8939: revert use of APCS mbox for RPM"):
> > > 1. remoteproc &rpm needs mboxes = <&apcs1_mbox 8>;
> > > 2. The clock controller inside &apcs1_mbox needs
> > > clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>.
> > > 3. &rpmcc is a child of remoteproc &rpm
> > >
> > > The mailbox itself does not need any clocks and should probe early to
> > > unblock the rest of the boot process. The "clocks" are only needed for the
> > > separate clock controller. In Linux, these are already two separate drivers
> > > that can probe independently.
> > >
> >
> > Why does this circular dependency need to be broken in the DeviceTree
> > representation?
> >
> > As you describe, the mailbox probes and register the mailbox controller
> > and it registers the clock controller. The mailbox device isn't affected
> > by the clock controller failing to find rpmcc...
> >
>
> That's right, but the problem is that the probe() function of the
> mailbox driver won't be called at all. The device tree *looks* like the
> mailbox depends on the clock, so fw_devlink tries to defer probing until
> the clock is probed (which won't ever happen, because the mailbox is
> needed to make the clock available).
>
> I'm not sure why fw_devlink doesn't detect this cycle and tries to probe
> them anyway, but fact is that we need to split this up in order to avoid
> warnings and have the supplies/consumers set up properly. Those device
> links are created based on the device tree and not the drivers.
Does "post-init-providers" providers solve your problem?
Rob
Powered by blists - more mailing lists