[PATCH v3 0/3] gpio: add kunit tests for GPIO core

Bartosz Golaszewski posted 3 patches 3 weeks, 6 days ago
drivers/gpio/Kconfig            |   8 +
drivers/gpio/Makefile           |   1 +
drivers/gpio/gpiolib-kunit.c    | 358 ++++++++++++++++++++++++++++++++++++++++
include/kunit/platform_device.h |   6 +
lib/kunit/platform.c            |  64 +++++++
5 files changed, 437 insertions(+)
[PATCH v3 0/3] gpio: add kunit tests for GPIO core
Posted by Bartosz Golaszewski 3 weeks, 6 days ago
This series adds a first batch of kunit tests for GPIO core. I intend to
gradually add more coverage for functionalities that can't really be
tested from user-space with the existing kernel selftests or libgpiod
tests.

Merging strategy: with an Ack from kunit maintainers, this can go
through the GPIO tree for v7.2.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Changes in v3:
- Make kunit_platform_device_unregister() handle both cases of platform
  devices created with kunit_platform_device_alloc() +
  kunit_platform_device_add() and kunit_platform_device_register_full()
  (sashiko)
- Link to v2: https://patch.msgid.link/20260520-gpiolib-kunit-v2-0-cc9db39881da@oss.qualcomm.com

Changes in v2:
- Remove cases of kunit killing a thread on test failure with device lock
  taken
- Fix a platform device leak on test failure
- New patch: provide kunit_platform_device_unregister()
- Link to v1: https://patch.msgid.link/20260518-gpiolib-kunit-v1-0-131ec646c4df@oss.qualcomm.com

---
Bartosz Golaszewski (3):
      kunit: provide kunit_platform_device_register_full()
      kunit: provide kunit_platform_device_unregister()
      gpio: add kunit test cases for the GPIO subsystem

 drivers/gpio/Kconfig            |   8 +
 drivers/gpio/Makefile           |   1 +
 drivers/gpio/gpiolib-kunit.c    | 358 ++++++++++++++++++++++++++++++++++++++++
 include/kunit/platform_device.h |   6 +
 lib/kunit/platform.c            |  64 +++++++
 5 files changed, 437 insertions(+)
---
base-commit: 80dd246accce631c328ea43294e53b2b2dd2aa32
change-id: 20260326-gpiolib-kunit-d7f1b5541ffa

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Re: [PATCH v3 0/3] gpio: add kunit tests for GPIO core
Posted by Bartosz Golaszewski 3 weeks, 2 days ago
On Fri, 22 May 2026 15:42:15 +0200, Bartosz Golaszewski wrote:
> This series adds a first batch of kunit tests for GPIO core. I intend to
> gradually add more coverage for functionalities that can't really be
> tested from user-space with the existing kernel selftests or libgpiod
> tests.
> 
> Merging strategy: with an Ack from kunit maintainers, this can go
> through the GPIO tree for v7.2.
> 
> [...]

Applied, thanks!

[1/3] kunit: provide kunit_platform_device_register_full()
      https://git.kernel.org/brgl/c/4c237ab773c93959aa2a7750f9dba772b5f1baee
[2/3] kunit: provide kunit_platform_device_unregister()
      https://git.kernel.org/brgl/c/136569e6bc7b2d62e6777ef47caf0a417d70bf4a
[3/3] gpio: add kunit test cases for the GPIO subsystem
      https://git.kernel.org/brgl/c/a6d2a3b403cbcbcdb3ffdb63e52ac090c1003d05

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Re: [PATCH v3 0/3] gpio: add kunit tests for GPIO core
Posted by Linus Walleij 3 weeks, 3 days ago
On Fri, May 22, 2026 at 3:42 PM Bartosz Golaszewski
<bartosz.golaszewski@oss.qualcomm.com> wrote:

> This series adds a first batch of kunit tests for GPIO core. I intend to
> gradually add more coverage for functionalities that can't really be
> tested from user-space with the existing kernel selftests or libgpiod
> tests.
>
> Merging strategy: with an Ack from kunit maintainers, this can go
> through the GPIO tree for v7.2.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

The series:
Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij