From: Greg KH <gregkh@linuxfoundation.org>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: Maxime Ripard <mripard@kernel.org>,
rafael@kernel.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, linux-next@vger.kernel.org,
sfr@canb.auug.org.au, andrzej.hajda@intel.com,
neil.armstrong@linaro.org, rfoss@kernel.org,
Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se,
jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com,
tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch,
angelogioacchino.delregno@collabora.com, ulf.hansson@linaro.org,
linus.walleij@linaro.org, Liu Ying <victor.liu@nxp.com>
Subject: Re: [PATCH v2 1/2] driver core: Export device_is_dependent() to modules
Date: Thu, 27 Nov 2025 09:29:03 +0100 [thread overview]
Message-ID: <2025112705-registrar-drivable-2341@gregkh> (raw)
In-Reply-To: <CAMRc=Mc3T1u1sa0P+78dfhtoyBPc+9zsJ5sGP=ZLR+S=h16vZg@mail.gmail.com>
On Wed, Nov 26, 2025 at 02:13:03PM +0100, Bartosz Golaszewski wrote:
> On Mon, Nov 27, 2023 at 7:21 PM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Mon, Nov 27, 2023 at 05:38:13PM +0100, Maxime Ripard wrote:
> > > Greg, Rafael,
> > >
> > > On Mon, Nov 27, 2023 at 01:14:13PM +0800, Liu Ying wrote:
> > > > Export device_is_dependent() since the drm_kms_helper module is starting
> > > > to use it.
> > > >
> > > > Signed-off-by: Liu Ying <victor.liu@nxp.com>
> > > > ---
> > > > v2:
> > > > * Newly introduced as needed by patch 2.
> > > >
> > > > drivers/base/core.c | 1 +
> > > > 1 file changed, 1 insertion(+)
> > > >
> > > > diff --git a/drivers/base/core.c b/drivers/base/core.c
> > > > index 67ba592afc77..bfd2bf0364b7 100644
> > > > --- a/drivers/base/core.c
> > > > +++ b/drivers/base/core.c
> > > > @@ -328,6 +328,7 @@ int device_is_dependent(struct device *dev, void *target)
> > > > }
> > > > return ret;
> > > > }
> > > > +EXPORT_SYMBOL_GPL(device_is_dependent);
> > >
> > > So, a committer just applied this to drm-misc-fixes without your
> > > approval. Could you ack it? If you don't want to, we'll fix it.
> >
> > Wait, why exactly is this needed? Nothing outside of the driver core
> > should be needing this function, it shouldn't be public at all (I missed
> > that before.)
> >
>
> Hi Greg!
>
> Sorry for reviving this old thread but I stumbled upon it when looking
> for information on whether anyone ever tried to export
> device_is_dependent() before.
>
> I have a use-case where I think I need to check if two devices are
> linked with a device link. I assume you'll prove me wrong. :)
>
> The reset-gpio driver is a reset control driver that mediates sharing
> a reset GPIO (defined as a standardized reference fwnode property
> "reset-gpios") among multiple users. reset-gpio auxiliary devices are
> instantiated from reset core when it detects a consumer trying to get
> a reset-control handle but there's no "resets" reference on the
> consumer's fwnode, only "reset-gpios".
>
> It makes sense for reset core to create a device link between the
> auxiliary reset-gpio device (the supplier) and the reset consumer
> because this link is not described in firmware - only the link between
> the consumer AND the GPIO controller.
>
> Now in order to make gpiolib-shared.c code (generic support for shared
> GPIOs) happy, I need to handle the side effects of interacting with
> reset-gpio which does a similar thing. To that end, I need to know if
> given GPIO controller is a supplier of the consumer described in
> firmware OR the auxiliary reset device which is only described with
> software nodes.
>
> The logical thing to do would be to use "device_is_dependent()" but
> this thread makes me think that won't fly.
>
> What should I do? What's the "correct" way of checking if two devices
> are linked? I assume that fiddling with the supplier/consumer lists in
> struct device is not it.
fiddling with those lists is what device_is_dependent() does, but no,
you really don't want to be doing that either manually or by calling
this function.
Who is creating this "link"? Can't that caller tell the gpio core this
relationship at the same time as you are wanting to keep track of it
too?
thanks,
greg k-h
next prev parent reply other threads:[~2025-11-27 8:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-27 5:14 [PATCH v2 0/2] drm/bridge: panel: Check device dependency before managing device link Liu Ying
2023-11-27 5:14 ` [PATCH v2 1/2] driver core: Export device_is_dependent() to modules Liu Ying
2023-11-27 16:38 ` Maxime Ripard
2023-11-27 18:20 ` Greg KH
2023-11-27 22:34 ` Linus Walleij
2025-11-26 13:13 ` Bartosz Golaszewski
2025-11-27 8:29 ` Greg KH [this message]
2025-11-27 13:19 ` Bartosz Golaszewski
2025-12-03 15:47 ` Greg KH
2025-12-04 10:14 ` Bartosz Golaszewski
2023-11-27 5:14 ` [PATCH v2 2/2] drm/bridge: panel: Check device dependency before managing device link Liu Ying
2023-11-27 16:03 ` [PATCH v2 0/2] " Linus Walleij
2023-11-27 16:29 ` Maxime Ripard
2023-11-27 22:13 ` Linus Walleij
2023-11-29 12:32 ` Maxime Ripard
2023-11-29 14:38 ` Linus Walleij
2023-11-30 10:05 ` Maxime Ripard
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=2025112705-registrar-drivable-2341@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=brgl@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rafael@kernel.org \
--cc=rfoss@kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=tzimmermann@suse.de \
--cc=ulf.hansson@linaro.org \
--cc=victor.liu@nxp.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