From: "Stefan Dösinger" <stefandoesinger@gmail.com>
To: Ulf Hansson <ulfh@kernel.org>, Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Troy Mitchell <troy.mitchell@linux.spacemit.com>,
spacemit@lists.linux.dev
Cc: Icenowy Zheng <uwu@icenowy.me>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
Yixun Lan <dlan@kernel.org>
Subject: Re: [PATCH] pmdomain: core: connect consumer with supplier via device link
Date: Tue, 01 Dec 2026 22:33:15 +0300 [thread overview]
Message-ID: <GeX11p9TRk6WFUNHgqnoWg@gmail.com> (raw)
In-Reply-To: <20261112-01-pm-device-link-v1-1-8932e0862378@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2036 bytes --]
Hi,
Am Donnerstag, 12. November 2026, 10:45:43 Ostafrikanische Zeit schrieb Yixun
Lan:
> Connect downstream Power Domain consumer with the supplier through
> the device link API, So when the pmdomain driver is unloaded or unbinded,
> the consumer can be automatically notified and purged gracefully.
I ran into the same issue with the zx297520v3 pmdomain driver I submitted [0].
The issue happens when the pm domain device is an MFD child registered with
mfd_add_devices() and the #power-domain-cells rolled into the MFD parent's DTS
node. In this case from the DTS's point of view the provider is the MFD
parent, whereas the runtime provider is the MFD child.
Linking the consumer to the MFD child that actually provides the pmdomain
makes sure that the consumer gets unbound when the MFD child gets unbound.
Why not make the pmdomain child a DTS node? writing-bindings.rst explicitly
discourages it:
> - DON'T create nodes just for the sake of instantiating drivers. Multi-
> function devices only need child nodes when the child nodes have their own
> DT resources. A single node can be multiple providers (e.g. clocks and
> resets).
In my case Krzysztof Kozlowski reiterated that in [1].
The clk subsystem takes extra care to handle provider registration from a MFD
child - see dev_or_parent_of_node().
I don't deeply care about being able to unbind my pmdomain driver and/or build
it as module and unload it. I implemented it because Brian Masney asked me to
build the clk drivers this way[2]. On my hardware the pmdomain is easy to shut
down without crashing/powering off the board, so I might as well. And to me
being able to unwind a device registration is a good check that the device
registration itself is built the right way.
Cheers,
Stefan
0: https://lore.kernel.org/linux-arm-kernel/20261120-zx29usb-v1-3-b0433258e51b@gmail.com/
1: https://lore.kernel.org/linux-arm-kernel/20260717-uncovered-feathered-groundhog-eab16e@quoll/
2: https://lore.kernel.org/linux-arm-kernel/anPD-I9GDyOZSDO7@redhat.com/
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 870 bytes --]
prev parent reply other threads:[~2026-12-02 8:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 7:45 [PATCH] pmdomain: core: connect consumer with supplier via device link Yixun Lan
2026-11-14 11:33 ` Ulf Hansson
2026-11-16 7:24 ` Yixun Lan
2026-11-16 7:46 ` Icenowy Zheng
2026-11-25 10:34 ` Ulf Hansson
2026-12-01 19:33 ` Stefan Dösinger [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=GeX11p9TRk6WFUNHgqnoWg@gmail.com \
--to=stefandoesinger@gmail.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=dlan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=spacemit@lists.linux.dev \
--cc=troy.mitchell@linux.spacemit.com \
--cc=ulfh@kernel.org \
--cc=uwu@icenowy.me \
/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