summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib-sysfs.h
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2024-01-15 12:17:43 +0100
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2024-01-17 09:52:37 +0100
commitefb8235bfdbe661c460f803150b50840a73b5f03 (patch)
tree193794eb3b6ba42ba5cd7de6ba6d2ce14a9c0e04 /drivers/gpio/gpiolib-sysfs.h
parent62b38f30a00ff47142e58d0a6d60dd296e0e8108 (diff)
gpiolib: revert the attempt to protect the GPIO device list with an rwsem
This reverts commits 1979a2807547 ("gpiolib: replace the GPIO device mutex with a read-write semaphore") and 65a828bab158 ("gpiolib: use a mutex to protect the list of GPIO devices"). Unfortunately the legacy GPIO API that's still used in older code has to translate numbers from the global GPIO numberspace to descriptors. This results in a GPIO device lookup in every call to legacy functions. Some of those functions - like gpio_set/get_value() - can be called from atomic context so taking a sleeping lock that is an RW semaphore results in an error. We'll probably have to protect this list with SRCU. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/linux-wireless/f7b5ff1e-8f34-4d98-a7be-b826cb897dc8@moroto.mountain/ Fixes: 1979a2807547 ("gpiolib: replace the GPIO device mutex with a read-write semaphore") Fixes: 65a828bab158 ("gpiolib: use a mutex to protect the list of GPIO devices") Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib-sysfs.h')
-rw-r--r--drivers/gpio/gpiolib-sysfs.h6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.h b/drivers/gpio/gpiolib-sysfs.h
index ab157cec0b4b..b794b396d6a5 100644
--- a/drivers/gpio/gpiolib-sysfs.h
+++ b/drivers/gpio/gpiolib-sysfs.h
@@ -8,7 +8,6 @@ struct gpio_device;
#ifdef CONFIG_GPIO_SYSFS
int gpiochip_sysfs_register(struct gpio_device *gdev);
-int gpiochip_sysfs_register_all(void);
void gpiochip_sysfs_unregister(struct gpio_device *gdev);
#else
@@ -18,11 +17,6 @@ static inline int gpiochip_sysfs_register(struct gpio_device *gdev)
return 0;
}
-static inline int gpiochip_sysfs_register_all(void)
-{
- return 0;
-}
-
static inline void gpiochip_sysfs_unregister(struct gpio_device *gdev)
{
}