Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [PATCH v2 4/4] gpio: kunit: add a test case for platform lookup tables
Date: Mon, 12 Oct 2026 14:48:15 +0000	[thread overview]
Message-ID: <sashiko-outbox-168284@kernel.org> (raw)
In-Reply-To: <20261012-gpio-kunit-plat-lookup-v2-4-553b0d6446b9@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] gpio: kunit: test failure due to missing wait_for_device_probe()
--

commit 743d1cf187f180e4ac825a86d7858ccb06076671
Author: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

gpio: kunit: add a test case for platform lookup tables

Add a kunit test-case for retrieving GPIOs using platform lookup tables.

> diff --git a/drivers/gpio/gpiolib-kunit.c b/drivers/gpio/gpiolib-kunit.c
> index b662be88a0871..5d04b134d5774 100644
> --- a/drivers/gpio/gpiolib-kunit.c
> +++ b/drivers/gpio/gpiolib-kunit.c
[ ... ]
> @@ -828,11 +829,110 @@ static struct kunit_suite gpio_swnode_hog_test_suite = {
[ ... ]
> +static void gpio_lookup_table_global(struct kunit *test)
> +{
> +	struct platform_device_info pdevinfo;
> +	struct platform_device *pdev;
> +	struct gpio_desc *desc;
> +	int ret;
> +
> +	ret = kunit_gpiod_add_lookup_table(test, &gpio_test_lookup_table_global);
> +	KUNIT_ASSERT_EQ(test, ret, 0);
> +
> +	pdevinfo = (struct platform_device_info){
> +		.name = GPIO_TEST_PROVIDER,
> +		.id = PLATFORM_DEVID_NONE,
> +	};
> +
> +	pdev = kunit_platform_device_register_full(test, &pdevinfo);
> +	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, pdev);
> +
> +	desc = gpiod_get_index(NULL, "foo", 0, GPIOD_OUT_HIGH);
> +	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, desc);

[Severity: Medium]
Will this test sporadically fail if the kernel is booted with system-wide
asynchronous probing enabled (e.g., driver_async_probe=*)?

The test queries the GPIO immediately after registering the provider device.
If the provider's probe function runs concurrently, gpiod_get_index() could
execute before the GPIO chip is registered and return -EPROBE_DEFER, failing
the assertion.

Is a call to wait_for_device_probe() or gpio_test_device_check_bound() needed
here before calling gpiod_get_index() to ensure the probe completes?

> +
> +	gpiod_put(desc);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261012-gpio-kunit-plat-lookup-v2-0-553b0d6446b9@oss.qualcomm.com?part=4

  reply	other threads:[~2026-10-12 14:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12 14:38 [PATCH v2 0/4] gpio: kunit: add test cases for platform lookup tables Bartosz Golaszewski
2026-10-12 14:38 ` [PATCH v2 1/4] gpio: kunit: fix the label of the dummy GPIO chip Bartosz Golaszewski
2026-10-12 14:38 ` [PATCH v2 2/4] gpio: kunit: factor out common code for waiting for device probe Bartosz Golaszewski
2026-10-12 14:38 ` [PATCH v2 3/4] gpio: kunit: rename the swnode consumer to a more generic test consumer Bartosz Golaszewski
2026-10-12 14:39 ` [PATCH v2 4/4] gpio: kunit: add a test case for platform lookup tables Bartosz Golaszewski
2026-10-12 14:48   ` sashiko-bot [this message]
2026-10-12 16:23     ` Bartosz Golaszewski

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=sashiko-outbox-168284@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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