Skip to content
Commit efb8235b authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

gpiolib: revert the attempt to protect the GPIO device list with an rwsem



This reverts commits 1979a280 ("gpiolib: replace the GPIO device
mutex with a read-write semaphore") and 65a828ba ("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: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-wireless/f7b5ff1e-8f34-4d98-a7be-b826cb897dc8@moroto.mountain/


Fixes: 1979a280 ("gpiolib: replace the GPIO device mutex with a read-write semaphore")
Fixes: 65a828ba ("gpiolib: use a mutex to protect the list of GPIO devices")
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 62b38f30
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment