linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] gpio: fix SRCU bugs
@ 2024-02-14  8:44 Bartosz Golaszewski
  2024-02-14  8:44 ` [PATCH v2 1/4] gpio: take the SRCU read lock in gpiod_hog() Bartosz Golaszewski
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Bartosz Golaszewski @ 2024-02-14  8:44 UTC (permalink / raw)
  To: Linus Walleij, Kent Gibson, Alex Elder, Geert Uytterhoeven,
	Paul E . McKenney, Andy Shevchenko, Wolfram Sang, Mark Brown,
	Dan Carpenter
  Cc: linux-gpio, linux-kernel, Bartosz Golaszewski

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

Here are four fixes to some bugs in recent SRCU changes. The first one fixes
an actual race condition. The other three just make lockdep happy.

v1 -> v2:
- use srcu_dereference() instead of rcu_dereference_protected() as
  advised by Paul
- add a patch using rcu_dereference_check(..., 1) in deprecated
  interfaces that return the address of the RCU-protected chip structure
  to external users (who shouldn't use it anyway but well...)
- pick up review tags for patches 1/4 and 2/4

Bartosz Golaszewski (4):
  gpio: take the SRCU read lock in gpiod_hog()
  gpio: cdev: use correct pointer accessors with SRCU
  gpio: use srcu_dereference() with SRCU-protected pointers
  gpio: don't let lockdep complain about inherently dangerous RCU usage

 drivers/gpio/gpiolib-cdev.c  | 25 ++++++++++++-------------
 drivers/gpio/gpiolib-sysfs.c |  5 +++--
 drivers/gpio/gpiolib.c       | 32 ++++++++++++++++++--------------
 drivers/gpio/gpiolib.h       |  3 ++-
 4 files changed, 35 insertions(+), 30 deletions(-)

-- 
2.40.1


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

end of thread, other threads:[~2024-02-27 16:44 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-14  8:44 [PATCH v2 0/4] gpio: fix SRCU bugs Bartosz Golaszewski
2024-02-14  8:44 ` [PATCH v2 1/4] gpio: take the SRCU read lock in gpiod_hog() Bartosz Golaszewski
2024-02-14  8:44 ` [PATCH v2 2/4] gpio: cdev: use correct pointer accessors with SRCU Bartosz Golaszewski
     [not found]   ` <CGME20240216103104eucas1p1fac9b939d4af1648d222963fbef59645@eucas1p1.samsung.com>
2024-02-16 10:31     ` Marek Szyprowski
2024-02-16 10:50       ` Bartosz Golaszewski
2024-02-26 14:27   ` kernel test robot
2024-02-27 16:44     ` Bartosz Golaszewski
2024-02-14  8:44 ` [PATCH v2 3/4] gpio: use srcu_dereference() with SRCU-protected pointers Bartosz Golaszewski
2024-02-14  8:44 ` [PATCH v2 4/4] gpio: don't let lockdep complain about inherently dangerous RCU usage Bartosz Golaszewski
2024-02-14 12:53 ` [PATCH v2 0/4] gpio: fix SRCU bugs Andy Shevchenko
2024-02-14 13:02   ` Bartosz Golaszewski
2024-02-14 13:17 ` Mark Brown
2024-02-14 13:22   ` Bartosz Golaszewski
2024-02-14 18:44 ` Paul E. McKenney
2024-02-14 19:08   ` Bartosz Golaszewski
2024-02-14 20:44     ` Paul E. McKenney
2024-02-21 21:45     ` Linus Walleij
2024-02-15  7:43 ` 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).