All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] gpio: fix an incorrect lockdep warning
@ 2016-09-16 16:02 Bartosz Golaszewski
  2016-09-16 16:02 ` [PATCH v2 1/4] i2c: export i2c_adapter_depth() Bartosz Golaszewski
                   ` (6 more replies)
  0 siblings, 7 replies; 32+ messages in thread
From: Bartosz Golaszewski @ 2016-09-16 16:02 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot, Andy Shevchenko, Vignesh R,
	Yong Li, Geert Uytterhoeven, Peter Zijlstra, Ingo Molnar,
	Wolfram Sang, Peter Rosin
  Cc: linux-i2c, linux-gpio, LKML, Bartosz Golaszewski

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(-)

-- 
2.7.4

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

end of thread, other threads:[~2016-09-24 14:26 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-16 16:02 [PATCH v2 0/4] gpio: fix an incorrect lockdep warning Bartosz Golaszewski
2016-09-16 16:02 ` [PATCH v2 1/4] i2c: export i2c_adapter_depth() Bartosz Golaszewski
2016-09-16 16:02 ` [PATCH v2 2/4] lockdep: make MAX_LOCKDEP_SUBCLASSES unconditionally visible Bartosz Golaszewski
2016-09-16 16:02 ` [PATCH v2 3/4] i2c: add a warning to i2c_adapter_depth() Bartosz Golaszewski
2016-09-16 16:02 ` [PATCH v2 4/4] gpio: pca953x: fix an incorrect lockdep warning Bartosz Golaszewski
2016-09-21  5:45   ` Wolfram Sang
2016-09-23  8:10     ` Linus Walleij
2016-09-24  8:55       ` Wolfram Sang
2016-09-24  9:15   ` Wolfram Sang
2016-09-24 14:26     ` Geert Uytterhoeven
2016-09-16 17:26 ` [PATCH v2 0/4] gpio: " Wolfram Sang
2016-09-16 17:45   ` Peter Rosin
2016-09-16 17:58     ` Wolfram Sang
2016-09-18  8:52       ` Peter Rosin
2016-09-18 19:43         ` Bartosz Golaszewski
2016-09-18 19:45           ` Bartosz Golaszewski
2016-09-19  8:01             ` Peter Rosin
2016-09-19  8:14               ` Peter Zijlstra
2016-09-19  8:48                 ` Peter Rosin
2016-09-19  9:03                   ` Peter Zijlstra
2016-09-20  8:48                     ` Peter Rosin
2016-09-20 10:07                       ` Bartosz Golaszewski
2016-09-20 10:28                         ` Peter Zijlstra
2016-09-20 10:48                         ` Peter Rosin
2016-09-20 11:30                           ` Geert Uytterhoeven
2016-09-20 12:32                             ` Bartosz Golaszewski
2016-09-20 15:33                       ` Thomas Gleixner
2016-09-21  9:47                         ` Peter Rosin
2016-09-17  1:19 ` Peter Zijlstra
2016-09-17 10:18   ` Wolfram Sang
2016-09-17 18:59     ` Bartosz Golaszewski
2016-09-24  8:56 ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.