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: <20251027144327.09f59982@jic23-huawei>
Date: Mon, 27 Oct 2025 14:43:27 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Chen-Yu Tsai <wens@...nel.org>
Cc: David Lechner <dlechner@...libre.com>, Nuno Sá
 <nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>,
 linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: core: Use datasheet name as fallback for label

On Mon, 27 Oct 2025 20:42:09 +0800
Chen-Yu Tsai <wens@...nel.org> wrote:

> Some IIO drivers do not provide labels or extended names for their
> channels. However they may provide datasheet names. axp20x-adc is
> one such example.
> 
> Use the datasheet name as a fallback for the channel label. This mainly
> benefits iio-hwmon by letting the produced hwmon sensors have more
> meaningful names rather than in_voltageX.

I definitely don't want to have different behaviour for in kernel requests
and for people reading the _label attributes.  
https://elixir.bootlin.com/linux/v6.18-rc2/source/drivers/iio/industrialio-core.c#L1232
would need modifying to allow for the sysfs attributes to be created.

In general I'm not sure I want to do this.  Datasheet names can be exceptionally
obscure which is why we've kept them hidden from userspace.  At least dts writers
tend to have those names on their circuit diagrams and tend to have datasheet access.

Let's see if anyone else has feedback on this suggestion over next week or so.

Thanks,

Jonathan

> 
> Signed-off-by: Chen-Yu Tsai <wens@...nel.org>
> ---
>  drivers/iio/industrialio-core.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 88c3d585a1bd..d410ea2e7963 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -749,6 +749,9 @@ ssize_t do_iio_read_channel_label(struct iio_dev *indio_dev,
>  	if (c->extend_name)
>  		return sysfs_emit(buf, "%s\n", c->extend_name);
>  
> +	if (c->datasheet_name)
> +		return sysfs_emit(buf, "%s\n", c->datasheet_name);
> +
>  	return -EINVAL;
>  }
>  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ