From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Cc: Rob Herring <robh+dt@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
Frank Rowand <frowand.list@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"moderated list:BROADCOM BCM2835 ARM ARCHITECTURE"
<linux-rpi-kernel@lists.infradead.org>,
Saravana Kannan <saravanak@google.com>,
devicetree@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] of/platform: Create device link between simple-mfd and its children
Date: Mon, 19 Oct 2020 08:52:08 +0200 [thread overview]
Message-ID: <20201019065208.x5k2zpuxjfhpmhdc@pengutronix.de> (raw)
In-Reply-To: <0f0b7021e85a832afd42c6f9016158d6d8b0b28b.camel@suse.de>
[-- Attachment #1: Type: text/plain, Size: 1964 bytes --]
On Fri, Oct 16, 2020 at 05:26:56PM +0200, Nicolas Saenz Julienne wrote:
> On Fri, 2020-10-16 at 09:38 -0500, Rob Herring wrote:
> > On Thu, Oct 15, 2020 at 6:43 AM Nicolas Saenz Julienne
> > <nsaenzjulienne@suse.de> wrote:
> > > 'simple-mfd' usage implies there might be some kind of resource sharing
> > > between the parent device and its children.
> >
> > It does? No! The reason behind simple-mfd was specifically because
> > there was no parent driver or dependency on the parent. No doubt
> > simple-mfd has been abused.
>
> Fair enough, so we're doing things wrong. Just for the record, I'm looking at
> RPi´s firmware interface:
>
> firmware: firmware {
> compatible = "raspberrypi,bcm2835-firmware", "simple-mfd";
> #address-cells = <1>;
> #size-cells = <1>;
> mboxes = <&mailbox>;
>
> firmware_clocks: clocks {
> compatible = "raspberrypi,firmware-clocks";
> #clock-cells = <1>;
> };
>
> reset: reset {
> compatible = "raspberrypi,firmware-reset";
> #reset-cells = <1>;
> };
> [...]
> };
>
> Note that "raspberrypi,bcm2835-firmware" has a driver, it's not just a
> placeholder. Consumer drivers get a handle to RPi's firmware interface through
> the supplier's API, rpi_firmware_get(). The handle to firmware becomes
> meaningless if it is unbinded, which I want to protect myself against.
>
> A simpler solution would be to manually create a device link between both
> devices ("raspberrypi,bcm2835-firmware" and "raspberrypi,firmware-clocks" for
> example) upon calling rpi_firmware_get(). But I wanted to try addressing the
> problem in a generic way first.
IMHO rpi_firmware_get() should get a reference on the firmware device
(and call try_module_get()) which prevents unbinding it.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-10-19 6:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-15 11:43 Nicolas Saenz Julienne
2020-10-15 16:52 ` Saravana Kannan
2020-10-16 15:39 ` Nicolas Saenz Julienne
2020-10-16 14:38 ` Rob Herring
2020-10-16 15:26 ` Nicolas Saenz Julienne
2020-10-19 6:52 ` Uwe Kleine-König [this message]
2020-10-21 11:35 ` Nicolas Saenz Julienne
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=20201019065208.x5k2zpuxjfhpmhdc@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=frowand.list@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=nsaenzjulienne@suse.de \
--cc=rafael.j.wysocki@intel.com \
--cc=robh+dt@kernel.org \
--cc=saravanak@google.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
all inboxes | Powered by JetHome®