[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdR9HtWbSif+j8QHX5zG9xPF1GzUFY2s-0OjD3RAWD9-Q@mail.gmail.com>
Date: Wed, 24 Apr 2024 18:20:41 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Ondřej Jirman <megi@....cz>,
Andy Shevchenko <andy.shevchenko@...il.com>, Aren Moynihan <aren@...cevolution.org>,
Jonathan Cameron <jic23@...nel.org>, Lars-Peter Clausen <lars@...afoo.de>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>, Conor Dooley <conor+dt@...nel.org>,
Chen-Yu Tsai <wens@...e.org>, Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>, Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
linux-iio@...r.kernel.org, phone-devel@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
Willow Barraco <contact@...lowbarraco.fr>
Subject: Re: [PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and
power it off during suspend
On Wed, Apr 24, 2024 at 3:59 PM Ondřej Jirman <megi@....cz> wrote:
> On Wed, Apr 24, 2024 at 02:16:06AM GMT, Andy Shevchenko wrote:
> > On Wed, Apr 24, 2024 at 1:41 AM Aren Moynihan <aren@...cevolution.org> wrote:
..
> > > ret = stk3310_init(indio_dev);
> > > if (ret < 0)
> > > - return ret;
> > > + goto err_vdd_disable;
> >
> > This is wrong. You will have the regulator being disabled _before_
> > IRQ. Note, that the original code likely has a bug which sets states
> > before disabling IRQ and removing a handler.
>
> How so? stk3310_init is called before enabling the interrupt.
Exactly, IRQ is registered with devm and hence the error path and
remove stages will got it in a wrong order.
> Original code has a bug that IRQ is enabled before registering the
> IIO device,
Indeed, but this is another bug.
> so if IRQ is triggered before registration, iio_push_event
> from IRQ handler may be called on a not yet registered IIO device.
>
> Never saw it happen, though. :)
Because nobody cares enough to enable DEBUG_SHIRQ.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists