lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=McLt23osfxcNA4-3eqVY_O-PD_BQzwWSthELGxd+=jVmw@mail.gmail.com>
Date:   Wed, 2 Aug 2023 08:47:09 +0200
From:   Bartosz Golaszewski <brgl@...ev.pl>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Kent Gibson <warthog618@...il.com>, linux-gpio@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH] gpio: sim: mark the GPIO chip as a one that can sleep

On Tue, Aug 1, 2023 at 9:11 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Tue, Aug 01, 2023 at 09:09:51PM +0200, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> >
> > Simulated chips use a mutex for synchronization in driver callbacks so
> > they must not be called from interrupt context. Set the can_sleep field
> > of the GPIO chip to true to force users to only use threaded irqs.
>
> Ah, good catch! Doesn't it deserve a Fixes tag?

I will add it when applying.

Bart

>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
>
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> > ---
> >  drivers/gpio/gpio-sim.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
> > index cfbdade841e8..5f8723ad0048 100644
> > --- a/drivers/gpio/gpio-sim.c
> > +++ b/drivers/gpio/gpio-sim.c
> > @@ -429,6 +429,7 @@ static int gpio_sim_add_bank(struct fwnode_handle *swnode, struct device *dev)
> >       gc->set_config = gpio_sim_set_config;
> >       gc->to_irq = gpio_sim_to_irq;
> >       gc->free = gpio_sim_free;
> > +     gc->can_sleep = true;
> >
> >       ret = devm_gpiochip_add_data(dev, gc, chip);
> >       if (ret)
> > --
> > 2.39.2
> >
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ