Skip to content

gpio: fix an incorrect lockdep warning

Bartosz Golaszewski linux-gpio linux-i2c lkml 2 versions Applied

Status from this message: Applied to for-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 27 repliesApplied
  2. v11 patch 3 repliesSuperseded

Changes in v2 from the cover letter

- added patches 1/4, 2/4 & 3/4
- used i2c_adapter_depth() in patch 4/4 in order to detect multiple adapter nesting

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4i2c: export i2c_adapter_depth()drivers/i2c/i2c-core.c include/linux/i2c.h+3 -70 replies
2/4lockdep: make MAX_LOCKDEP_SUBCLASSES unconditionally visibleinclude/linux/lockdep.h+2 -20 replies
3/4i2c: add a warning to i2c_adapter_depth()drivers/i2c/i2c-core.c+3 -00 replies
4/4gpio: pca953x: fix an incorrect lockdep warningdrivers/gpio/gpio-pca953x.c+2 -05 replies

Reviews trailers per patch

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

PatchPeter Zijlstra (Intel)Linus Walleij
SeriesA-b
1/4
2/4
3/4
4/4A-b

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 an incorrect lockdep warning

If an I2C GPIO multiplexer is driven by a GPIO provided by an expander when there's a second expander using the same device driver on one of the I2C bus segments, lockdep prints a deadlock warning when trying to set the direction or the value of the GPIOs provided by the second expander.

This series exports an already existing function from i2c-core as public API and reuses it in pca953x to pass a correct lock subclass to lockdep.

Note: if this series gets merged, I'll prepare follow-up patches for other expanders for which a similar problem could potentially occur.

Tested with the following setup:

------- --------- Bus segment 1 | |

|       |           |         |---------------  Devices
|       | SCL/SDA   |         |               |         |
| Linux |-----------| I2C MUX |                - - - - -
|       |    |      |         | Bus segment 2
|       |    |      |         |-------------------
 -------     |       ---------                    |
             |           |                    - - - - -
        ------------     | MUX GPIO          |         |
       |            |    |                     Devices
       |    GPIO    |    |                   |         |
       | Expander 1 |----                     - - - - -
       |            |                             |
        ------------                              | SCL/SDA
                                                  |

------------
| |
| GPIO |
| Expander 2 |
| |
------------

where expander 1 is a pca9534 and expander 2 is a pca9535.

v1 -> v2:
- added patches 1/4, 2/4 & 3/4
- used i2c_adapter_depth() in patch 4/4 in order to detect multiple adapter nesting

Bartosz Golaszewski (4):
i2c: export i2c_adapter_depth()
lockdep: make MAX_LOCKDEP_SUBCLASSES unconditionally visible
i2c: add a warning to i2c_adapter_depth()
gpio: pca953x: fix an incorrect lockdep warning

 drivers/gpio/gpio-pca953x.c |  2 ++
 drivers/i2c/i2c-core.c      | 12 +++++-------
 include/linux/i2c.h         |  1 +
 include/linux/lockdep.h     |  4 ++--
 4 files changed, 10 insertions(+), 9 deletions(-)
Signature · 1 line
2.7.4