Skip to content

gpio: fix SRCU bugs

Bartosz Golaszewski linux-gpio lkml oe-lkp 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 12 repliesIn review
  2. v13 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- 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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4gpio: take the SRCU read lock in gpiod_hog()drivers/gpio/gpiolib.c+7 -40 replies
2/4gpio: cdev: use correct pointer accessors with SRCUdrivers/gpio/gpiolib-cdev.c+12 -133 replies
3/4gpio: use srcu_dereference() with SRCU-protected pointersdrivers/gpio/gpiolib-sysfs.c drivers/gpio/gpiolib.c drivers/gpio/gpiolib.h+13 -110 replies
4/4gpio: don't let lockdep complain about inherently dangerous RCU usagedrivers/gpio/gpiolib.c+3 -20 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchLinus WalleijPaul E. McKenney
SeriesA-b
1/4R-b
2/4R-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] gpio: fix SRCU bugs

From: Bartosz Golaszewski <[email protected]>

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(-)
Signature · 1 line
2.40.1