** Description changed: [ 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 ] - Apply 12 patches in total: + 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. - * Apply [PATCH 1/3] to [PATCH 3/3] from [1], which have landed in linux-next. - * Add a "UBUNTU: [Config]" commit for the new config option CONFIG_DEV_SYNC_PROBE. - * Apply [PATCH 2/9] to [PATCH 9/9] from [2], which are under review. + For Plucky, (already) applied 12 patches in total: - [1] https://lore.kernel.org/all/20250221133501.2203897-1-koichiro....@canonical.com/ - [2] https://lore.kernel.org/all/20250315164123.1855142-1-koichiro....@canonical.com/ + * 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: - - [1] is a preparatory patch series for [2]. - - [PATCH 1/9] from [2] was already picked and landed in mainline. + 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....@canonical.com/ + [2] https://lists.ubuntu.com/archives/kernel-team/2025-March/158315.html + [3] https://lore.kernel.org/all/20250407043019.4105613-1-koichiro....@canonical.com/ + [4] https://lore.kernel.org/all/20250221133501.2203897-1-koichiro....@canonical.com/ + [5] Some adjustments were needed (i.e. backporting). The details are explained + in the commit message trailers. [ Test Plan ] - Run kselftest. + 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 (branch: + 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.
** Also affects: linux (Ubuntu Jammy) Importance: Undecided Status: New ** Changed in: linux (Ubuntu Jammy) Assignee: (unassigned) => Koichiro Den (koichiroden) ** Changed in: linux (Ubuntu Jammy) Status: New => In Progress -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux in Ubuntu. https://bugs.launchpad.net/bugs/2103496 Title: Introduce configfs-based interface for gpio-aggregator Status in linux package in Ubuntu: Fix Released Status in linux source package in Jammy: In Progress Status in linux source package in Noble: In Progress Status in linux source package in Oracular: In Progress Status in linux source package in Plucky: Fix Released Bug description: [ 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....@canonical.com/ [2] https://lists.ubuntu.com/archives/kernel-team/2025-March/158315.html [3] https://lore.kernel.org/all/20250407043019.4105613-1-koichiro....@canonical.com/ [4] https://lore.kernel.org/all/20250221133501.2203897-1-koichiro....@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 (branch: 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. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2103496/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp