[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAASAkoYDyiY5HuWVfiCLfjtNVKWDbcCVoCfc=udSat1ngtcfVw@mail.gmail.com>
Date: Tue, 17 Aug 2021 09:18:10 +0300
From: Alexandru Ardelean <aardelean@...iqon.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: linux-iio <linux-iio@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Denis CIOCCA <denis.ciocca@...com>,
Jonathan Cameron <jic23@...nel.org>,
Lee Jones <lee.jones@...aro.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH v2 1/5] iio: st_sensors: disable regulators after device unregistration
On Tue, 17 Aug 2021 at 01:50, Linus Walleij <linus.walleij@...aro.org> wrote:
>
> On Mon, Aug 16, 2021 at 10:30 AM Alexandru Ardelean
> <aardelean@...iqon.com> wrote:
>
> > Up until commit ea7e586bdd331 ("iio: st_sensors: move regulator retrieveal
> > to core") only the ST pressure driver seems to have had any regulator
> > disable. After that commit, the regulator handling was moved into the
> > common st_sensors logic.
> >
> > In all instances of this regulator handling, the regulators were disabled
> > before unregistering the IIO device.
> > This can cause issues where the device would be powered down and still be
> > available to userspace, allowing it to send invalid/garbage data.
> >
> > This change moves the st_sensors_power_disable() after the common probe
> > functions. These common probe functions also handle unregistering the IIO
> > device.
> >
> > Fixes: 774487611c949 ("iio: pressure-core: st: Provide support for the Vdd power supply")
> > Fixes: ea7e586bdd331 ("iio: st_sensors: move regulator retrieveal to core")
> > Cc: Lee Jones <lee.jones@...aro.org>
> > Cc: Denis CIOCCA <denis.ciocca@...com>
> > Cc: Linus Walleij <linus.walleij@...aro.org>
> > Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> > Signed-off-by: Alexandru Ardelean <aardelean@...iqon.com>
>
> That's a valid concern I suppose:
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
>
> But as it now occurs last before return 0, can't we just solve
> this with a
> devm_add_action_or_reset(dev, st_sensors_power_off_action, *);
> of some kind and let devres handle it?
i think this is my fault for not CC-ing the entire series to you:
https://patchwork.kernel.org/project/linux-iio/list/?series=531879
this is part of a larger conversion to devm_ for ST sensors;
i was hoping that if i CC you on one patch, then git send-email would
CC you on the entire set;
doesn't seem to be the case;
i'll try to remember that on the next sets;
[but maybe having this written here, will help me remember]
>
> c.f
> drivers/input/touchscreen/cy8ctma140.c
>
> Yours,
> Linus Walleij
Powered by blists - more mailing lists