From: Mario Limonciello <mario.limonciello@amd.com>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: Hardik Prakash <hardikprakash.official@gmail.com>,
Andy Shevchenko <andriy.shevchenko@intel.com>,
linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org,
wsa@kernel.org, basavaraj.natikar@amd.com,
linus.walleij@linaro.org
Subject: Re: [PATCH v5 0/1] i2c: designware: fix probe ordering for AMD GPIO on Lenovo Yoga 7 14AGP11
Date: Tue, 19 May 2026 09:48:14 -0500 [thread overview]
Message-ID: <498bad3f-6a0c-4da8-b645-1cc837ba1836@amd.com> (raw)
In-Reply-To: <CAMRc=McSLEF_nrkRdJJu9=Bc_KmPWYKDHd6tOD9tJqs0fksv0w@mail.gmail.com>
On 5/19/26 09:39, Bartosz Golaszewski wrote:
> On Tue, May 19, 2026 at 4:28 PM Mario Limonciello
> <mario.limonciello@amd.com> wrote:
>>
>>>
>>> gpiochip_add_data() at 0.285952 makes the GPIO chip visible to the
>>> system before amd_gpio_probe() has finished. AMDI0010:02 starts probing
>>> at 0.301454 while amd_gpio_probe() is still completing. This is why
>>> device_is_bound() works and initcall promotion does not -- it waits for
>>> probe completion, not just gpiochip registration.
>>
>> What is the boot time impact to adding device_is_bound() check?
>>
>> Bartosz, thoughts?
>>
>
> My thoughts are that ACPI could use some fw_devlink. :) It's not a new
> problem, we've fixed it for OF systems.
>
> Could we modify gpiolib-acpi.c to return -EPROBE_DEFER if the parent
> device of the GPIO chip is not bound yet instead? When resolving the
> reference to the remote GPIO controller we have an address of the
> struct acpi_device. I suppose there's a platform device that is its
> child and then the logical GPIO controller device, is that correct?
> Can we check if the platform device in question is bound at the
> subsystem level?
>
> Bart
I like this idea. I guess something like this:
diff --git a/drivers/gpio/gpiolib-acpi-core.c
b/drivers/gpio/gpiolib-acpi-core.c
index eb8a40cfb7a98..e3511398b1f84 100644
--- a/drivers/gpio/gpiolib-acpi-core.c
+++ b/drivers/gpio/gpiolib-acpi-core.c
@@ -142,6 +142,13 @@ static struct gpio_desc *acpi_get_gpiod(char *path,
unsigned int pin)
if (!gdev)
return ERR_PTR(-EPROBE_DEFER);
+ if (gdev->dev.parent) {
+ scoped_guard(device, gdev->dev.parent) {
+ if (!device_is_bound(gdev->dev.parent))
+ return ERR_PTR(-EPROBE_DEFER);
+ }
+ }
+
/*
* FIXME: keep track of the reference to the GPIO device somehow
* instead of putting it here.
next prev parent reply other threads:[~2026-05-19 14:48 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 12:28 [PATCH v5 0/1] i2c: designware: fix probe ordering for AMD GPIO on Lenovo Yoga 7 14AGP11 Hardik Prakash
2026-05-18 12:28 ` [PATCH v5 1/1] " Hardik Prakash
2026-05-18 12:47 ` [PATCH v5 0/1] " Mario Limonciello
2026-05-18 13:40 ` Hardik Prakash
2026-05-18 13:45 ` Mario Limonciello
2026-05-18 14:05 ` Bartosz Golaszewski
2026-05-18 14:08 ` Mario Limonciello
2026-05-18 14:10 ` Bartosz Golaszewski
2026-05-18 14:23 ` Hardik Prakash
2026-05-18 14:26 ` Bartosz Golaszewski
2026-05-18 14:27 ` Andy Shevchenko
2026-05-18 17:22 ` Hardik Prakash
2026-05-18 17:44 ` Mario Limonciello
2026-05-19 7:21 ` Hardik Prakash
2026-05-19 14:28 ` Mario Limonciello
2026-05-19 14:39 ` Bartosz Golaszewski
2026-05-19 14:48 ` Mario Limonciello [this message]
2026-05-19 19:07 ` Hardik Prakash
2026-05-19 19:49 ` Hardik Prakash
2026-05-19 20:53 ` Mario Limonciello
2026-05-20 5:02 ` Hardik Prakash
2026-05-23 7:51 ` Hardik Prakash
2026-05-23 12:43 ` Mario Limonciello
2026-05-18 14:08 ` Andy Shevchenko
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=498bad3f-6a0c-4da8-b645-1cc837ba1836@amd.com \
--to=mario.limonciello@amd.com \
--cc=andriy.shevchenko@intel.com \
--cc=basavaraj.natikar@amd.com \
--cc=brgl@kernel.org \
--cc=hardikprakash.official@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=wsa@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