diff mbox series

[v1,4/4] gpio: pca953x: disable regmap locking for automatic address incrementing

Message ID 20200605134036.9013-4-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/4] gpio: pca953x: Synchronize interrupt handler properly | expand

Commit Message

Andy Shevchenko June 5, 2020, 1:40 p.m. UTC
It's a repetition of the commit aa58a21ae378
  ("gpio: pca953x: disable regmap locking")
which states the following:

  This driver uses its own locking but regmap silently uses
  a mutex for all operations too. Add the option to disable
  locking to the regmap config struct.

Fixes: bcf41dc480b1 ("gpio: pca953x: fix handling of automatic address incrementing")
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-pca953x.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Uwe Kleine-König June 15, 2020, 12:20 p.m. UTC | #1
On Fri, Jun 05, 2020 at 04:40:36PM +0300, Andy Shevchenko wrote:
> It's a repetition of the commit aa58a21ae378
>   ("gpio: pca953x: disable regmap locking")
> which states the following:
> 
>   This driver uses its own locking but regmap silently uses
>   a mutex for all operations too. Add the option to disable
>   locking to the regmap config struct.
> 
> Fixes: bcf41dc480b1 ("gpio: pca953x: fix handling of automatic address incrementing")
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Ah, good catch. I assume that I didn't have aa58a21ae378 in my tree when
I created the patch that then became bcf41dc480b1.

Looks right

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks
Uwe
Andy Shevchenko June 15, 2020, 12:53 p.m. UTC | #2
On Mon, Jun 15, 2020 at 02:20:44PM +0200, Uwe Kleine-König wrote:
> On Fri, Jun 05, 2020 at 04:40:36PM +0300, Andy Shevchenko wrote:
> > It's a repetition of the commit aa58a21ae378
> >   ("gpio: pca953x: disable regmap locking")
> > which states the following:
> > 
> >   This driver uses its own locking but regmap silently uses
> >   a mutex for all operations too. Add the option to disable
> >   locking to the regmap config struct.
> > 
> > Fixes: bcf41dc480b1 ("gpio: pca953x: fix handling of automatic address incrementing")
> > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Ah, good catch. I assume that I didn't have aa58a21ae378 in my tree when
> I created the patch that then became bcf41dc480b1.
> 
> Looks right
> 
> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks!

Linus, Bart, just to clarify that this is material for one of the next v5.8-rcX
(this cycle!).
Uwe Kleine-König June 15, 2020, 1:20 p.m. UTC | #3
Hello,

[adding Geert to Cc as he was involved with
aa58a21ae37894d456a2f91a37e9fd71ad4aa27e]

On Mon, Jun 15, 2020 at 03:53:49PM +0300, Andy Shevchenko wrote:
> On Mon, Jun 15, 2020 at 02:20:44PM +0200, Uwe Kleine-König wrote:
> > On Fri, Jun 05, 2020 at 04:40:36PM +0300, Andy Shevchenko wrote:
> > > It's a repetition of the commit aa58a21ae378
> > >   ("gpio: pca953x: disable regmap locking")
> > > which states the following:
> > > 
> > >   This driver uses its own locking but regmap silently uses
> > >   a mutex for all operations too. Add the option to disable
> > >   locking to the regmap config struct.
> > > 
> > > Fixes: bcf41dc480b1 ("gpio: pca953x: fix handling of automatic address incrementing")
> > > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > 
> > Ah, good catch. I assume that I didn't have aa58a21ae378 in my tree when
> > I created the patch that then became bcf41dc480b1.
> > 
> > Looks right
> > 
> > Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Thanks!
> 
> Linus, Bart, just to clarify that this is material for one of the next v5.8-rcX
> (this cycle!).

I didn't test but I wonder if this patch is really urgent. Just from
looking I'd say two locks are not nice but also don't hurt much. If it
is more urgent the commit log should maybe mention how the driver is
broken without this change? (Also applies to
aa58a21ae37894d456a2f91a37e9fd71ad4aa27e of course (but too late).)

Best regards
Uwe
Andy Shevchenko June 15, 2020, 1:38 p.m. UTC | #4
On Mon, Jun 15, 2020 at 4:23 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> Hello,
>
> [adding Geert to Cc as he was involved with
> aa58a21ae37894d456a2f91a37e9fd71ad4aa27e]
>
> On Mon, Jun 15, 2020 at 03:53:49PM +0300, Andy Shevchenko wrote:
> > On Mon, Jun 15, 2020 at 02:20:44PM +0200, Uwe Kleine-König wrote:
> > > On Fri, Jun 05, 2020 at 04:40:36PM +0300, Andy Shevchenko wrote:
> > > > It's a repetition of the commit aa58a21ae378
> > > >   ("gpio: pca953x: disable regmap locking")
> > > > which states the following:
> > > >
> > > >   This driver uses its own locking but regmap silently uses
> > > >   a mutex for all operations too. Add the option to disable
> > > >   locking to the regmap config struct.
> > > >
> > > > Fixes: bcf41dc480b1 ("gpio: pca953x: fix handling of automatic address incrementing")
> > > > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > >
> > > Ah, good catch. I assume that I didn't have aa58a21ae378 in my tree when
> > > I created the patch that then became bcf41dc480b1.
> > >
> > > Looks right
> > >
> > > Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >
> > Thanks!
> >
> > Linus, Bart, just to clarify that this is material for one of the next v5.8-rcX
> > (this cycle!).
>
> I didn't test but I wonder if this patch is really urgent.

I'm talking about this entire fix-series.

> Just from
> looking I'd say two locks are not nice but also don't hurt much. If it
> is more urgent the commit log should maybe mention how the driver is
> broken without this change? (Also applies to
> aa58a21ae37894d456a2f91a37e9fd71ad4aa27e of course (but too late).)
Uwe Kleine-König June 15, 2020, 2:18 p.m. UTC | #5
On Mon, Jun 15, 2020 at 04:38:23PM +0300, Andy Shevchenko wrote:
> On Mon, Jun 15, 2020 at 4:23 PM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> >
> > Hello,
> >
> > [adding Geert to Cc as he was involved with
> > aa58a21ae37894d456a2f91a37e9fd71ad4aa27e]
> >
> > On Mon, Jun 15, 2020 at 03:53:49PM +0300, Andy Shevchenko wrote:
> > > On Mon, Jun 15, 2020 at 02:20:44PM +0200, Uwe Kleine-König wrote:
> > > > On Fri, Jun 05, 2020 at 04:40:36PM +0300, Andy Shevchenko wrote:
> > > > > It's a repetition of the commit aa58a21ae378
> > > > >   ("gpio: pca953x: disable regmap locking")
> > > > > which states the following:
> > > > >
> > > > >   This driver uses its own locking but regmap silently uses
> > > > >   a mutex for all operations too. Add the option to disable
> > > > >   locking to the regmap config struct.
> > > > >
> > > > > Fixes: bcf41dc480b1 ("gpio: pca953x: fix handling of automatic address incrementing")
> > > > > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > >
> > > > Ah, good catch. I assume that I didn't have aa58a21ae378 in my tree when
> > > > I created the patch that then became bcf41dc480b1.
> > > >
> > > > Looks right
> > > >
> > > > Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > >
> > > Thanks!
> > >
> > > Linus, Bart, just to clarify that this is material for one of the next v5.8-rcX
> > > (this cycle!).
> >
> > I didn't test but I wonder if this patch is really urgent.
> 
> I'm talking about this entire fix-series.

Ah, I didn't notice this is a series as I only got patch 4.

Best regards
Uwe
Andy Shevchenko June 15, 2020, 3:12 p.m. UTC | #6
On Mon, Jun 15, 2020 at 04:18:04PM +0200, Uwe Kleine-König wrote:
> On Mon, Jun 15, 2020 at 04:38:23PM +0300, Andy Shevchenko wrote:
> > On Mon, Jun 15, 2020 at 4:23 PM Uwe Kleine-König
> > <u.kleine-koenig@pengutronix.de> wrote:
> > > On Mon, Jun 15, 2020 at 03:53:49PM +0300, Andy Shevchenko wrote:
> > > > On Mon, Jun 15, 2020 at 02:20:44PM +0200, Uwe Kleine-König wrote:
> > > > > On Fri, Jun 05, 2020 at 04:40:36PM +0300, Andy Shevchenko wrote:
> > > > > > It's a repetition of the commit aa58a21ae378
> > > > > >   ("gpio: pca953x: disable regmap locking")
> > > > > > which states the following:
> > > > > >
> > > > > >   This driver uses its own locking but regmap silently uses
> > > > > >   a mutex for all operations too. Add the option to disable
> > > > > >   locking to the regmap config struct.
> > > > > >
> > > > > > Fixes: bcf41dc480b1 ("gpio: pca953x: fix handling of automatic address incrementing")
> > > > > > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > >
> > > > > Ah, good catch. I assume that I didn't have aa58a21ae378 in my tree when
> > > > > I created the patch that then became bcf41dc480b1.
> > > > >
> > > > > Looks right
> > > > >
> > > > > Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > >
> > > > Thanks!
> > > >
> > > > Linus, Bart, just to clarify that this is material for one of the next v5.8-rcX
> > > > (this cycle!).
> > >
> > > I didn't test but I wonder if this patch is really urgent.
> > 
> > I'm talking about this entire fix-series.
> 
> Ah, I didn't notice this is a series as I only got patch 4.

In case you are curious / want to try:
https://lore.kernel.org/linux-gpio/20200605134036.9013-1-andriy.shevchenko@linux.intel.com/T/#m5e01e6462f2f72fbc4bdd3f71c330b7a2f75d5ba
Bartosz Golaszewski June 16, 2020, 9:24 a.m. UTC | #7
pon., 15 cze 2020 o 14:53 Andy Shevchenko
<andriy.shevchenko@linux.intel.com> napisał(a):
>
> On Mon, Jun 15, 2020 at 02:20:44PM +0200, Uwe Kleine-König wrote:
> > On Fri, Jun 05, 2020 at 04:40:36PM +0300, Andy Shevchenko wrote:
> > > It's a repetition of the commit aa58a21ae378
> > >   ("gpio: pca953x: disable regmap locking")
> > > which states the following:
> > >
> > >   This driver uses its own locking but regmap silently uses
> > >   a mutex for all operations too. Add the option to disable
> > >   locking to the regmap config struct.
> > >
> > > Fixes: bcf41dc480b1 ("gpio: pca953x: fix handling of automatic address incrementing")
> > > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >
> > Ah, good catch. I assume that I didn't have aa58a21ae378 in my tree when
> > I created the patch that then became bcf41dc480b1.
> >
> > Looks right
> >
> > Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> Thanks!
>
> Linus, Bart, just to clarify that this is material for one of the next v5.8-rcX
> (this cycle!).
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

I applied the whole series for fixes. Thanks!

Bartosz
Andy Shevchenko June 16, 2020, 12:53 p.m. UTC | #8
On Tue, Jun 16, 2020 at 12:25 PM Bartosz Golaszewski
<bgolaszewski@baylibre.com> wrote:
> pon., 15 cze 2020 o 14:53 Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> napisał(a):
> > On Mon, Jun 15, 2020 at 02:20:44PM +0200, Uwe Kleine-König wrote:
> > > On Fri, Jun 05, 2020 at 04:40:36PM +0300, Andy Shevchenko wrote:

...

> > > Looks right
> > >
> > > Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >
> > Thanks!
> >
> > Linus, Bart, just to clarify that this is material for one of the next v5.8-rcX
> > (this cycle!).

> I applied the whole series for fixes. Thanks!

Thank you!
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 97c9ac31ecb5..6f409ee0b033 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -395,6 +395,7 @@  static const struct regmap_config pca953x_ai_i2c_regmap = {
 	.writeable_reg = pca953x_writeable_register,
 	.volatile_reg = pca953x_volatile_register,
 
+	.disable_locking = true,
 	.cache_type = REGCACHE_RBTREE,
 	.max_register = 0x7f,
 };