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: <20250421132914.7a456dac@jic23-huawei>
Date: Mon, 21 Apr 2025 13:29:14 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Gabriel Shahrouzi <gshahrouzi@...il.com>
Cc: gregkh@...uxfoundation.org, lars@...afoo.de, linux-iio@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-staging@...ts.linux.dev,
 Michael.Hennerich@...log.com, sonic.zhang@...log.com, vapier@...too.org,
 skhan@...uxfoundation.org, linux-kernel-mentees@...ts.linux.dev,
 stable@...r.kernel.org
Subject: Re: [PATCH v5 1/5] staging: iio: adc: ad7816: Allow channel 7 for
 all devices

On Sat, 19 Apr 2025 21:49:06 -0400
Gabriel Shahrouzi <gshahrouzi@...il.com> wrote:

> According to the datasheet on page 9 under the channel selection table,
> all devices (AD7816/7/8) are able to use the channel marked as 7. This
> channel is used for diagnostic purposes by routing the internal 1.23V
> bandgap source through the MUX to the input of the ADC.
> 
> Modify the channel validation logic to permit channel 7 for all
> supported device types.
> 
> Fixes: 7924425db04a ("staging: iio: adc: new driver for AD7816 devices")

Adding a missing channel is not a fix.  It is a feature enhancement.
Not appropriate for backporting in general (though obviously someone wanting
to use it might do so).

> Cc: stable@...r.kernel.org
> Signed-off-by: Gabriel Shahrouzi <gshahrouzi@...il.com>
> ---
>  drivers/staging/iio/adc/ad7816.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
> index 6c14d7bcdd675..a44b0c8c82b12 100644
> --- a/drivers/staging/iio/adc/ad7816.c
> +++ b/drivers/staging/iio/adc/ad7816.c
> @@ -190,11 +190,11 @@ static ssize_t ad7816_store_channel(struct device *dev,
>  		dev_err(&chip->spi_dev->dev, "Invalid channel id %lu for %s.\n",
>  			data, indio_dev->name);
>  		return -EINVAL;
> -	} else if (strcmp(indio_dev->name, "ad7818") == 0 && data > 1) {
> +	} else if (strcmp(indio_dev->name, "ad7818") == 0 && data > 1 && data != AD7816_CS_MASK) {

Why use the mask?  I think this is something entirely unrelated that just happens to have
the value 7.

>  		dev_err(&chip->spi_dev->dev,
>  			"Invalid channel id %lu for ad7818.\n", data);
>  		return -EINVAL;
> -	} else if (strcmp(indio_dev->name, "ad7816") == 0 && data > 0) {
> +	} else if (strcmp(indio_dev->name, "ad7816") == 0 && data > 0 && data != AD7816_CS_MASK) {
>  		dev_err(&chip->spi_dev->dev,
>  			"Invalid channel id %lu for ad7816.\n", data);
>  		return -EINVAL;


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ