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: <20221009134252.2b636e0a@jic23-huawei>
Date:   Sun, 9 Oct 2022 13:42:52 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     Olivier Moysan <olivier.moysan@...s.st.com>
Cc:     Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Fabrice Gasnier <fabrice.gasnier@...s.st.com>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        <nuno.sa@...log.com>, Paul Cercueil <paul@...pouillou.net>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Wan Jiabing <wanjiabing@...o.com>,
        Yannick Brosseau <yannick.brosseau@...il.com>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-stm32@...md-mailman.stormreply.com>
Subject: Re: [PATCH v3 1/8] iio: adc: stm32-adc: fix channel sampling time
 init

On Wed, 5 Oct 2022 18:14:17 +0200
Olivier Moysan <olivier.moysan@...s.st.com> wrote:

> Fix channel init for ADC generic channel bindings.
> In generic channel initialization, stm32_adc_smpr_init() is called
> to initialize channel sampling time. The "st,min-sample-time-ns"
> property is an optional property. If it is not defined,
> stm32_adc_smpr_init() is currently skipped.
> However stm32_adc_smpr_init() must always be called,
> to force a minimum sampling time for the internal channels,
> as the minimum sampling time is known.
> Make stm32_adc_smpr_init() call unconditional.

Hi Olivier.  Andy commented on this in v2... 

Line lengths in patch description are rather random and no where near the typical
72-75 chars.  Should look more like:

Fix channel init for ADC generic channel bindings. In generic channel
initialization, stm32_adc_smpr_init() is called > to initialize channel
sampling time. The "st,min-sample-time-ns" property is an optional
property. If it is not defined, stm32_adc_smpr_init() is currently
skipped. However stm32_adc_smpr_init() must always be called, to force a
minimum sampling time for the internal channels, as the minimum sampling
time is known. Make stm32_adc_smpr_init() call unconditional.

Fine to have multiple paragraphs, but within each one, don't wrap too early.

> 
> Fixes: 796e5d0b1e9b ("iio: adc: stm32-adc: use generic binding for sample-time")
> Signed-off-by: Olivier Moysan <olivier.moysan@...s.st.com>
> ---
>  drivers/iio/adc/stm32-adc.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
> index 6256977eb7f7..3cda529f081d 100644
> --- a/drivers/iio/adc/stm32-adc.c
> +++ b/drivers/iio/adc/stm32-adc.c
> @@ -2086,18 +2086,19 @@ static int stm32_adc_generic_chan_init(struct iio_dev *indio_dev,
>  		stm32_adc_chan_init_one(indio_dev, &channels[scan_index], val,
>  					vin[1], scan_index, differential);
>  
> +		val = 0;
>  		ret = fwnode_property_read_u32(child, "st,min-sample-time-ns", &val);
>  		/* st,min-sample-time-ns is optional */
> -		if (!ret) {
> -			stm32_adc_smpr_init(adc, channels[scan_index].channel, val);
> -			if (differential)
> -				stm32_adc_smpr_init(adc, vin[1], val);
> -		} else if (ret != -EINVAL) {
> +		if (ret && ret != -EINVAL) {
>  			dev_err(&indio_dev->dev, "Invalid st,min-sample-time-ns property %d\n",
>  				ret);
>  			goto err;
>  		}
>  
> +		stm32_adc_smpr_init(adc, channels[scan_index].channel, val);
> +		if (differential)
> +			stm32_adc_smpr_init(adc, vin[1], val);
> +
>  		scan_index++;
>  	}
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ