From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Ulf Hansson <ulf.hansson@oss.qualcomm.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Pavel Machek <pavel@kernel.org>, Len Brown <lenb@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Danilo Krummrich <dakr@kernel.org>, Ulf Hansson <ulfh@kernel.org>,
Devarsh Thakkar <devarsht@ti.com>,
linux-pm@vger.kernel.org, driver-core@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pmdomain: core: Add genpd_dev_pm_attach_by_node()
Date: Fri, 27 Nov 2026 11:06:53 +0200 [thread overview]
Message-ID: <4fbeef8c-1dc8-4cac-a4af-835037c3dc4b@ideasonboard.com> (raw)
In-Reply-To: <CAPx+jO_FC1t_UaDfQDPOCy+V-Zdc1b5h5krrppGvYiW-LsD3LQ@mail.gmail.com>
Hi,
On 25/11/2026 14:50, Ulf Hansson wrote:
> On Fri, Oct 23, 2026 at 8:17 PM Tomi Valkeinen
> <tomi.valkeinen@ideasonboard.com> wrote:
>>
>> genpd_dev_pm_attach_by_id() and genpd_dev_pm_attach_by_name() attach a
>> virtual device to a PM domain listed in the OF node of the passed
>> device.
>>
>> Some hardware blocks are described in a child node of a main device.
>> They have no device of their own, but they do have a PM domain of their
>> own. Neither function can attach that domain, as both parse only the OF
>> node of the device.
>>
>> An example case is TI's display subsystem and its OLDI (LVDS)
>> transmitters:
>>
>> dss@30200000 {
>> power-domains = <...>;
>>
>> oldi-transmitters {
>> oldi@0 {
>> power-domains = <...>;
>> };
>>
>> oldi@1 {
>> power-domains = <...>;
>> };
>> };
>> };
>>
>> The OLDI TX blocks are not part of the DSS IP, but they are not quite
>> real devices either as they don't have registers of their own, and are
>> instead controlled via DSS registers.
>>
>> Add genpd_dev_pm_attach_by_node(), which is similar to
>> genpd_dev_pm_attach_by_id() but instead of looking for the power-domains
>> from the passed device's DT node, the DT node is passed explicitly. Also
>> add a matching wrapper function dev_pm_domain_attach_by_node().
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>> ---
>> This is a new try for managing the OLDI power domains. Previously I
>> tried using auxiliary device/driver for OLDIs, and handling the PDs the
>> normal way:
>>
>> https://lore.kernel.org/all/20260529-beagley-ai-display-v3-12-7fefdc5d1adf%40ideasonboard.com/
>>
>> Then I realized an issue, mentioned in
>> Documentation/driver-api/driver-model/driver.rst: "-EPROBE_DEFER must
>> not be returned if probe() has already created child devices".
>
> I don't follow. How is this a problem? Why not create the child
> devices at a later point?
The problem the above text refers to is (as far as I understand):
The main driver probes, and creates a child device, which probes
successfully. That causes the flag for "run deferred probes again" to be
set. The main driver then continues its probe, but, for some reason,
must return -EPROBE_DEFER. But as the above-mentioned flag is set, so
probes are ran again, resulting in the same sequence, again and again.
Creating the child device later is difficult. We have display pipelines
which contain multiple independent devices. All those devices must have
probed and their bridges/panels registered to the DRM framework so that
the main DRM driver can finish its probe. If parts of the pipeline are
missing, we return -EPROBE_DEFER and wait for the missing parts to appear.
And the OLDIs here are not really independent devices. They don't have
register space, and OLDI configuration is done via DSS registers. Yet
they don't fit very well inside the DSS either, as they are clearly an
outside IP, an external encoder. So the aim has been to represent them
as separates child DT nodes, which allows setting OLDI properties and
the media graph, but there's no compatible string and it's the tidss
driver that fully manages the creation/cleanup.
Here a simple pipeline could be:
DSS -> OLDI -> panel
If the panel hasn't been registered, tidss will defer. But tidss needs
OLDI to be there too, when it binds the display pipeline, otherwise it
could never finish.
It is possible to create the DRM bridge entity for the OLDI without any
OLDI device/driver, which allows creating the display pipeline. But the
OLDI bridge code has to be able to enable the OLDI power domain, and I
think the only way to use PDs currently is via devices.
So if we created the OLDI DRM bridge as mentioned above, then later in
tidss probe we could create a device for OLDI, which probes and binds.
That can then be used to control the PD, but there would be no other use
for it. And the sequence feels like doing it backwards.
>> The PD virtual devices used in this patch's approach do not hit the
>> issue as they don't get a driver, so they are not probed. The tidss
>> driver's OLDI part can then use normal pm_runtime_get/put functions to
>> manage the OLDI PDs.
>
> Sorry, but this makes no sense to me. Considering the above statement
> about -EPROBE_DEFER and child devices, it sounds like we need to
> manage some kind of cleanup in both solutions, right?
Yes, but with PD virtual devices there's no probe, so they don't cause
the "do deferred probes again" flag to be set. It's not the cleanup as
such that causes the problem.
In some ways this does feel a bit like a work-around to the framework
limitation. Representing OLDI with the aux-bus feels quite correct, I
think. But then, all that plumbing just to enable/disable the PD...
So, what I'm basically trying to do in this patch is to provide an API
that allows enabling/disabling a PD that's not in a DT node managed by a
Linux device.
> Perhaps if you provide a user of dev_pm_domain_attach_by_node() this
> becomes more clear.
I have pushed my branch to korg:
https://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git/log/?h=b4/beagley-ai-display
The commit that uses this patch is:
"drm/tidss: oldi: Add power domain support"
And the dts file that has the OLDI nodes is:
"arm64: dts: ti: k3-am62p-j722s-common-main: Add support for DSS"
Tomi
prev parent reply other threads:[~2026-11-27 9:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 18:16 Tomi Valkeinen
2026-11-10 13:58 ` Tomi Valkeinen
2026-11-16 17:08 ` Tomi Valkeinen
2026-11-25 12:50 ` Ulf Hansson
2026-11-27 9:06 ` Tomi Valkeinen [this message]
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=4fbeef8c-1dc8-4cac-a4af-835037c3dc4b@ideasonboard.com \
--to=tomi.valkeinen@ideasonboard.com \
--cc=dakr@kernel.org \
--cc=devarsht@ti.com \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
--cc=ulf.hansson@oss.qualcomm.com \
--cc=ulfh@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
all inboxes | Powered by JetHome®