From: Herve Codina <herve.codina@bootlin.com>
To: Saravana Kannan <saravanak@google.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
Linus Walleij <linus.walleij@linaro.org>,
Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Android Kernel Team <kernel-team@android.com>
Subject: Re: [PATCH RESEND 0/2] leds: gpio: Add devlink between the leds-gpio device and the gpio used.
Date: Mon, 8 Apr 2024 15:44:07 +0200 [thread overview]
Message-ID: <20240408154407.3a90a518@bootlin.com> (raw)
In-Reply-To: <CAGETcx_=g1dCH=YMUkc7VquUmLs=bNZMspUxH+V49uhcV0Bx2w@mail.gmail.com>
Hi Saravana,
On Tue, 20 Feb 2024 19:28:17 -0800
Saravana Kannan <saravanak@google.com> wrote:
...
> > >
> > > Do I understand correctly that the devlink is created between "led-5"
> > > and "tca6424_dock_2" but actually should also be created between
> > > "leds-dock" and "tca6424_dock_2"?
> > >
> >
> > Yes, that's my understanding too.
>
> I'm replying here instead of the RESEND because here's where the
> context and example are provided.
>
> I quickly poked into the gpio-leds driver. Please correct me if I'm
> misunderstanding anything.
>
> It looks like led-5 will be added as a class device. But the
> dev->fwnode is not set before it's added because it uses
> device_create_with_groups(). So, fw_devlink doesn't create a link
> between led-5 and tca6424_dock_2 unless tca6424_dock_2 is added after
> led-5. Which coincidentally seems to be the case here. Might want to
> explicitly create the device in gpio-leds driver.
>
> The issue you are trying to fix is a generic issue that I'd like to
> fix in a generic fashion. It's one of my TODOs which I've mentioned
> before in conferences/emails to LKML: device links framework has a
> bunch of gaps when it comes to class devices. I've been thinking about
> it for a while, but it needs a lot more work and testing. I'll roll in
> this case when I deal with it in a generic fashion. But here's the
> general idea of things that need to be addressed:
>
> 1. "Managed" device links allow having a class device as a supplier,
> but that'll mean the consumer will never probe.
> 2. What if a class device is a consumer and the supplier isn't ready.
> What does it mean for the class device to be added? Is it available
> for use? Probably not. Can we do something here that'll be useful for
> the class implementation?
> 3. What if the supplier and consumer are class devices, when does the
> consumer class device become "available" (do we check the suppliers of
> the supplier?)?
> 4. What happens if the supplier of a class device gets removed? Do we
> notify the class so it can do the right thing? Do we force unbind the
> first ancestor that's on a bus? (your case).
> 5. What if a supplier class device is removed, should we unbind the
> consumer (if it's a bus device)?
>
> I'm currently working on a patch to break dependency cycles. Once
> that's in, the next TODO item I work on is going to be this or clock
> framework sync_state() support.
>
> So, I'd recommend waiting this out if it's not urgent.
>
> Heh, here's my commit on my local repo from a year ago when I touched
> on this and realised the scope of the work.
>
> commit 7dcaad52e569209104408f3e472fde4ef8cd5585 (class-devlinks-v1)
> Author: Saravana Kannan <saravanak@google.com>
> Date: Mon Feb 13 13:40:43 2023 -0800
>
> add class support to device links
>
>
> Thanks,
> Saravana
Did you move forward on this topic ?
Best regards,
Hervé
prev parent reply other threads:[~2024-04-08 13:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 13:39 [PATCH RESEND 0/2] leds: gpio: Add devlink between the leds-gpio device and the gpio used Herve Codina
2024-02-20 13:39 ` [PATCH RESEND 1/2] gpiolib: Introduce gpiod_device_add_link() Herve Codina
2024-02-20 13:39 ` [PATCH RESEND 2/2] leds: gpio: Add devlinks between the gpio consumed and the gpio leds device Herve Codina
2024-02-20 14:19 ` [PATCH RESEND 0/2] leds: gpio: Add devlink between the leds-gpio device and the gpio used Bartosz Golaszewski
2024-02-20 14:53 ` Herve Codina
2024-02-20 15:30 ` Bartosz Golaszewski
2024-02-20 15:47 ` Herve Codina
2024-02-21 3:28 ` Saravana Kannan
2024-02-27 12:06 ` Herve Codina
2024-04-08 13:44 ` Herve Codina [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=20240408154407.3a90a518@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=brgl@bgdev.pl \
--cc=kernel-team@android.com \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=pavel@ucw.cz \
--cc=saravanak@google.com \
--cc=thomas.petazzoni@bootlin.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).