linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] gpiolib: use a read-write semaphore to protect the GPIO device list
@ 2023-12-21 18:43 Bartosz Golaszewski
  2023-12-21 18:43 ` [PATCH 1/2] gpiolib: replace the GPIO device mutex with a read-write semaphore Bartosz Golaszewski
  2023-12-21 18:43 ` [PATCH 2/2] gpiolib: pin GPIO devices in place during descriptor lookup Bartosz Golaszewski
  0 siblings, 2 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2023-12-21 18:43 UTC (permalink / raw)
  To: Linus Walleij, Andy Shevchenko, Kent Gibson
  Cc: linux-gpio, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

I'm still figuring out how to keep GPIO descriptors coherent while
(mostly) lockless. In the meantime, I found a potential race-condition
during GPIO descriptor lookup and also figured that the correct way to
protect the GPIO device list is actually a read-write semaphore as we're
not modifying the list very often and readers should be able to iterate
over it concurrently.

Bartosz Golaszewski (2):
  gpiolib: replace the GPIO device mutex with a read-write semaphore
  gpiolib: pin GPIO devices in place during descriptor lookup

 drivers/gpio/gpiolib-sysfs.c |  2 +-
 drivers/gpio/gpiolib.c       | 58 ++++++++++++++++++++----------------
 drivers/gpio/gpiolib.h       |  2 +-
 3 files changed, 34 insertions(+), 28 deletions(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-21 19:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-21 18:43 [PATCH 0/2] gpiolib: use a read-write semaphore to protect the GPIO device list Bartosz Golaszewski
2023-12-21 18:43 ` [PATCH 1/2] gpiolib: replace the GPIO device mutex with a read-write semaphore Bartosz Golaszewski
2023-12-21 18:43 ` [PATCH 2/2] gpiolib: pin GPIO devices in place during descriptor lookup Bartosz Golaszewski
2023-12-21 19:03   ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).