linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandru Ardelean <aardelean@deviqon.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-iio <linux-iio@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Denis CIOCCA <denis.ciocca@st.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Lee Jones <lee.jones@linaro.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH v2 1/5] iio: st_sensors: disable regulators after device unregistration
Date: Tue, 17 Aug 2021 09:18:10 +0300	[thread overview]
Message-ID: <CAASAkoYDyiY5HuWVfiCLfjtNVKWDbcCVoCfc=udSat1ngtcfVw@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdaYLd=R9SjqLF=j94fjbG-urHW6C6rXJ3oGnJM9W78P4g@mail.gmail.com>

On Tue, 17 Aug 2021 at 01:50, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Mon, Aug 16, 2021 at 10:30 AM Alexandru Ardelean
> <aardelean@deviqon.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@linaro.org>
> > Cc: Denis CIOCCA <denis.ciocca@st.com>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
>
> That's a valid concern I suppose:
> Reviewed-by: Linus Walleij <linus.walleij@linaro.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

  reply	other threads:[~2021-08-17  6:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16  8:28 [PATCH v2 0/5] iio: st_sensors: convert probe functions to full devm Alexandru Ardelean
2021-08-16  8:28 ` [PATCH v2 1/5] iio: st_sensors: disable regulators after device unregistration Alexandru Ardelean
2021-08-16 22:50   ` Linus Walleij
2021-08-17  6:18     ` Alexandru Ardelean [this message]
2021-08-16  8:28 ` [PATCH v2 2/5] iio: st_sensors: remove st_sensors_deallocate_trigger() function Alexandru Ardelean
2021-08-16  8:28 ` [PATCH v2 3/5] iio: st_sensors: remove st_sensors_power_disable() function Alexandru Ardelean
2021-08-16  8:28 ` [PATCH v2 4/5] iio: st_sensors: remove all driver remove functions Alexandru Ardelean
2021-08-16  8:28 ` [PATCH v2 5/5] iio: st_sensors: remove reference to parent device object on st_sensor_data Alexandru Ardelean
2021-08-17 23:29   ` kernel test robot
2021-08-16  9:09 ` [PATCH v2 0/5] iio: st_sensors: convert probe functions to full devm Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAASAkoYDyiY5HuWVfiCLfjtNVKWDbcCVoCfc=udSat1ngtcfVw@mail.gmail.com' \
    --to=aardelean@deviqon.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=denis.ciocca@st.com \
    --cc=jic23@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).