lkml.org 
[lkml]   [2020]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] gpiolib: don't call sleeping functions with a spinlock taken
wt., 28 kwi 2020 o 17:53 Andy Shevchenko <andy.shevchenko@gmail.com> napisał(a):
>
> On Tue, Apr 14, 2020 at 6:35 PM Bartosz Golaszewski
> <bgolaszewski@baylibre.com> wrote:
> >
> > wt., 14 kwi 2020 o 14:00 Linus Walleij <linus.walleij@linaro.org> napisał(a):
> > >
> > > On Fri, Mar 20, 2020 at 10:31 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > >
> > > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > >
> > > > We must not call pinctrl_gpio_can_use_line() with the gpio_lock taken
> > > > as it takes a mutex internally. Let's move the call before taking the
> > > > spinlock and store the return value.
> > > >
> > > > This isn't perfect - there's a moment between calling
> > > > pinctrl_gpio_can_use_line() and taking the spinlock where the situation
> > > > can change but it isn't a regression either: previously this part wasn't
> > > > protected at all and it only affects the information user-space is
> > > > seeing.
>
> It seems I have no original at hand, so, commenting here.
>
> It looks like we need a mutex less function which can be used here and
> in the call you are considering racy.

The thing is this mutex is in pinctrl - we'd need to export it too so
that gpio can use it.

Bart

\
 
 \ /
  Last update: 2020-04-29 08:41    [W:0.100 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site