[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMpxmJWh+cyTBE_ABujUuu_Q1dkmbzsON1Z2xNYrhbbxxQeSMg@mail.gmail.com>
Date: Sat, 17 Sep 2016 20:59:54 +0200
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
To: Wolfram Sang <wsa@...-dreams.de>
Cc: Peter Zijlstra <peterz@...radead.org>,
Linus Walleij <linus.walleij@...aro.org>,
Alexandre Courbot <gnurou@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Vignesh R <vigneshr@...com>, Yong Li <yong.b.li@...el.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Ingo Molnar <mingo@...hat.com>, Peter Rosin <peda@...ntia.se>,
linux-i2c <linux-i2c@...r.kernel.org>,
linux-gpio <linux-gpio@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 0/4] gpio: fix an incorrect lockdep warning
2016-09-17 12:18 GMT+02:00 Wolfram Sang <wsa@...-dreams.de>:
> On Sat, Sep 17, 2016 at 03:19:52AM +0200, Peter Zijlstra wrote:
>> On Fri, Sep 16, 2016 at 06:02:41PM +0200, Bartosz Golaszewski wrote:
>> > 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.
>>
>> Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
>
> Oops, I overlooked that I need your ack as well :) Thanks!
>
>> > Note: if this series gets merged, I'll prepare follow-up patches for
>> > other expanders for which a similar problem could potentially occur.
>>
>> We can't push this annotation into the i2c core, can we? Since the mutex
>> is in driver specific code, not more generic...
>
> Afraid so.
>
Most i2c controlled GPIO expanders could potentially be converted to
using the regmap framework which unfortunately suffers from the same
locking issue in its current form.
I'm already working on adding adapter depth dependent subclasses for
i2c regmaps - maybe I'll be able to submit it for 4.9 next week.
Using regmap would allow us to drop the separate mutexes in each gpio
driver and instead use the regmap-internal locking.
Best regards,
Bartosz Golaszewski
Powered by blists - more mailing lists