[SRU][O/N/J][PATCH 0/3] Introduce configfs-based interface for gpio-aggregator (LP: #2103496)
Koichiro Den
koichiro.den at canonical.com
Fri Apr 11 07:26:21 UTC 2025
BugLink: https://bugs.launchpad.net/bugs/2103496
[ Impact ]
The existing 'new_device' interface for gpio-aggregator
(https://docs.kernel.org/admin-guide/gpio/gpio-aggregator.html) has several
limitations:
* No way to determine when GPIO aggregator creation is complete.
* No way to retrieve errors when creating a GPIO aggregator.
* No way to trace a GPIO line of an aggregator back to its corresponding
physical device.
* The 'new_device' echo does not indicate which virtual gpiochip<N> was
created.
* No way to assign names to GPIO lines exported through an aggregator.
While the GPIO aggregator concept is useful for resource isolation, these
limitations currently hinder its practical effectiveness. This patch series
addresses all those issues.
[ Fix ]
For Plucky, I cherry-picked the v6 patch series [1] to include it in the
Release before the main patch series reached linux-next. See the APPLIED
announcement [2]. As a result, the code differs slightly from the v7 patch
series [3], which later made it to linux-next and was used for backporting to
Oracular/Noble/Jammy as explained below. However, since there are no
substantial differences between v6 and v7, I do not intend to modify Plucky to
match v7.
For Plucky, (already) applied 12 patches in total:
* Applied [PATCH 1/3] to [PATCH 3/3] from [4], which had landed in linux-next.
* Applied [PATCH 2/9] to [PATCH 9/9] from [1], which had been under review.
* Added a "UBUNTU: [Config]" commit for the new config option CONFIG_DEV_SYNC_PROBE.
Note:
- [4] is a preparatory patch series for [1].
- [PATCH 1/9] from [1] was already picked and landed in mainline.
For Oracular, apply 13 patches in total:
* Cherry-pick 3 commits from mainline, as prerequisite for the main patch series:
eb5ab6ffb4ca ("gpio: introduce utilities for synchronous fake device creation")
22dec5aa596e ("gpio: aggregator: simplify aggr_parse() with scoped bitmap")
12f65d120350 ("gpio: aggregator: protect driver attr handlers against module unload")
* Cherry-pick 9 commits from linux-next:
7a56efeabffd ("gpio: aggregator: reorder functions to prepare for configfs introduction")
7616dd97ae22 ("gpio: aggregator: unify function naming")
88fe1d1a646b ("gpio: aggregator: add gpio_aggregator_{alloc,free}()")
86f162e73d2d ("gpio: aggregator: introduce basic configfs interface")
4ec2315d7fab ("gpio: aggregator: rename 'name' to 'key' in gpio_aggregator_parse()")
83c8e3df642f ("gpio: aggregator: expose aggregator created via legacy sysfs to configfs")
0269c768de1b ("gpio: aggregator: cancel deferred probe for devices created via configfs")
10f94d092bba ("Documentation: gpio: document configfs interface for gpio-aggregator")
6d7f0c1103ef ("selftests: gpio: add test cases for gpio-aggregator")
* Add a "UBUNTU: [Config]" commit for the new config option CONFIG_DEV_SYNC_PROBE.
For Noble, apply 14 patches in total:
* Cherry-pick 4 commits from mainline, as prerequisite for the main patch series:
eb5ab6ffb4ca ("gpio: introduce utilities for synchronous fake device creation")
d12a82848eac ("bitmap: Define a cleanup function for bitmaps")
22dec5aa596e ("gpio: aggregator: simplify aggr_parse() with scoped bitmap")
12f65d120350 ("gpio: aggregator: protect driver attr handlers against module unload")
* Cherry-pick 9 commits from linux-next:
7a56efeabffd ("gpio: aggregator: reorder functions to prepare for configfs introduction")
7616dd97ae22 ("gpio: aggregator: unify function naming")
88fe1d1a646b ("gpio: aggregator: add gpio_aggregator_{alloc,free}()")
86f162e73d2d ("gpio: aggregator: introduce basic configfs interface")
4ec2315d7fab ("gpio: aggregator: rename 'name' to 'key' in gpio_aggregator_parse()")
83c8e3df642f ("gpio: aggregator: expose aggregator created via legacy sysfs to configfs")
0269c768de1b ("gpio: aggregator: cancel deferred probe for devices created via configfs")
10f94d092bba ("Documentation: gpio: document configfs interface for gpio-aggregator")
6d7f0c1103ef ("selftests: gpio: add test cases for gpio-aggregator")
* Add a "UBUNTU: [Config]" commit for the new config option CONFIG_DEV_SYNC_PROBE.
For Jammy, apply 12 patches in total:
* Cherry-pick/Backport 3 commits from mainline, as prerequisite for the main patch series:
eb5ab6ffb4ca ("gpio: introduce utilities for synchronous fake device creation") [5]
95b39792c664 ("gpio: aggregator: Stop using ARCH_NR_GPIOS")
39ebbd52b73d ("gpio: aggregator: Add missing header(s)")
* Cherry-pick/Backport 8 commits from linux-next:
7a56efeabffd ("gpio: aggregator: reorder functions to prepare for configfs introduction") [5]
7616dd97ae22 ("gpio: aggregator: unify function naming")
88fe1d1a646b ("gpio: aggregator: add gpio_aggregator_{alloc,free}()") [5]
86f162e73d2d ("gpio: aggregator: introduce basic configfs interface") [5]
4ec2315d7fab ("gpio: aggregator: rename 'name' to 'key' in gpio_aggregator_parse()") [5]
83c8e3df642f ("gpio: aggregator: expose aggregator created via legacy sysfs to configfs") [5]
0269c768de1b ("gpio: aggregator: cancel deferred probe for devices created via configfs")
10f94d092bba ("Documentation: gpio: document configfs interface for gpio-aggregator")
* Add a "UBUNTU: [Config]" commit for the new config option CONFIG_DEV_SYNC_PROBE.
[1] https://lore.kernel.org/all/20250315164123.1855142-1-koichiro.den@canonical.com/
[2] https://lists.ubuntu.com/archives/kernel-team/2025-March/158315.html
[3] https://lore.kernel.org/all/20250407043019.4105613-1-koichiro.den@canonical.com/
[4] https://lore.kernel.org/all/20250221133501.2203897-1-koichiro.den@canonical.com/
[5] Some adjustments were needed (i.e. backporting). The details are explained
in the commit message trailers.
[ Test Plan ]
For Plucky/Oracular/Noble, run kselftest.
For Jammy, either test (play) on real hardware, or run kselftest from:
https://git.launchpad.net/~koichiroden/+git/jammy/log/?h=kselftest-for-gpio-aggr-configfs-backport-to-jammy
N.B. kselftest for gpio-aggregator is unavailable due to the missing gpio-sim
on Jammy, and this SRU patch submission does not backport it, as doing so would
be excessive.
[ Where problems could occur ]
Any regressions would only impact users who load and use the
gpio-aggregator module, potentially causing issues like memory leaks or
system crashes.
More information about the kernel-team
mailing list