From: Jonathan Cameron <jic23@kernel.org>
To: Olivier MOYSAN <olivier.moysan@foss.st.com>
Cc: Fabrice Gasnier <fabrice.gasnier@foss.st.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <alexandre.torgue@foss.st.com>,
<linux-iio@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>
Subject: Re: [PATCH] iio: adc: stm32: fix a leak by resetting pcsel before disabling vdda
Date: Sun, 24 Oct 2021 17:07:49 +0100 [thread overview]
Message-ID: <20211024170749.44c0d81f@jic23-huawei> (raw)
In-Reply-To: <77f3593a-0e94-f5ab-f102-86ba8d0f1a3b@foss.st.com>
On Fri, 22 Oct 2021 14:38:52 +0200
Olivier MOYSAN <olivier.moysan@foss.st.com> wrote:
I'll probably reword the description here as 'leak' tends to mean memory
leak rather than current.
> Hi Fabrice,
>
> On 10/22/21 2:19 PM, Fabrice Gasnier wrote:
> > Some I/Os are connected to ADC input channels, when the corresponding bit
> > in PCSEL register are set on STM32H7 and STM32MP15. This is done in the
> > prepare routine of stm32-adc driver.
> > There are constraints here, as PCSEL shouldn't be set when VDDA supply
> > is disabled. Enabling/disabling of VDDA supply in done via stm32-adc-core
> > runtime PM routines (before/after ADC is enabled/disabled).
> >
> > Currently, PCSEL remains set when disabling ADC. Later on, PM runtime
> > can disable the VDDA supply. This creates some conditions on I/Os that
> > can start to leak current.
> > So PCSEL needs to be cleared when disabling the ADC.
> >
> > Fixes: 95e339b6e85d ("iio: adc: stm32: add support for STM32H7")
> >
No line break here as Fixes forms part of the tag block.
> > Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Given timing wrt to being too near merge window, I'll let this it on
list a while longer as it'll be post rc1 material now anyway.
I can fix the above whilst applying if nothing else comes up.
Jonathan
> > ---
> > drivers/iio/adc/stm32-adc.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
> > index 5088de8..e3e7541 100644
> > --- a/drivers/iio/adc/stm32-adc.c
> > +++ b/drivers/iio/adc/stm32-adc.c
> > @@ -975,6 +975,7 @@ static void stm32h7_adc_unprepare(struct iio_dev *indio_dev)
> > {
> > struct stm32_adc *adc = iio_priv(indio_dev);
> >
> > + stm32_adc_writel(adc, STM32H7_ADC_PCSEL, 0);
> > stm32h7_adc_disable(indio_dev);
> > stm32h7_adc_enter_pwr_down(adc);
> > }
> >
>
> Reviewed-by: Olivier Moysan <olivier.moysan@foss.st.com>
>
> Thanks
> Olivier
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-10-24 16:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-22 12:19 [PATCH] iio: adc: stm32: fix a leak by resetting pcsel before disabling vdda Fabrice Gasnier
2021-10-22 12:38 ` Olivier MOYSAN
2021-10-24 16:07 ` Jonathan Cameron [this message]
2021-10-25 7:43 ` Fabrice Gasnier
2021-10-28 14:19 ` Jonathan Cameron
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=20211024170749.44c0d81f@jic23-huawei \
--to=jic23@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=fabrice.gasnier@foss.st.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=olivier.moysan@foss.st.com \
/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