diff options
author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2024-07-08 16:29:12 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2024-07-09 09:39:54 +0200 |
commit | 91581c4b3f29e2e22aeb1a62e842d529ca638b2d (patch) | |
tree | a68c8967902a73905f15bd0ad330c27540431f07 /drivers/gpio/Kconfig | |
parent | 8060be2489f9bfa0c603373fa71cc2f93e46e462 (diff) |
gpio: virtuser: new virtual testing driver for the GPIO API
The GPIO subsystem used to have a serious problem with undefined behavior
and use-after-free bugs on hot-unplug of GPIO chips. This can be
considered a corner-case by some as most GPIO controllers are enabled
early in the boot process and live until the system goes down but most
GPIO drivers do allow unbind over sysfs, many are loadable modules that
can be (force) unloaded and there are also GPIO devices that can be
dynamically detached, for instance CP2112 which is a USB GPIO expender.
Bugs can be triggered both from user-space as well as by in-kernel users.
We have the means of testing it from user-space via the character device
but the issues manifest themselves differently in the kernel.
This is a proposition of adding a new virtual driver - a configurable
GPIO consumer that can be configured over configfs (similarly to
gpio-sim) or described on the device-tree.
This driver is aimed as a helper in spotting any regressions in
hot-unplug handling in GPIOLIB.
Link: https://lore.kernel.org/r/20240708142912.120570-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'drivers/gpio/Kconfig')
-rw-r--r-- | drivers/gpio/Kconfig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 2b9bd1893863..ba93e640a8ab 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -1908,6 +1908,18 @@ config GPIO_SLOPPY_LOGIC_ANALYZER If this driver is built as a module it will be called 'gpio-sloppy-logic-analyzer'. +config GPIO_VIRTUSER + tristate "GPIO Virtual User Testing Module" + select DEBUG_FS + select CONFIGFS_FS + select IRQ_WORK + help + Say Y here to enable the configurable, configfs-based virtual GPIO + consumer testing driver. + + This driver is aimed as a helper in spotting any regressions in + hot-unplug handling in GPIOLIB. + endmenu endif |