From: "lihuisong (C)" <lihuisong@huawei.com>
To: Guenter Roeck <linux@roeck-us.net>, Armin Wolf <W_Armin@gmx.de>,
<linux-hwmon@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-media@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<arm-scmi@vger.kernel.org>, <netdev@vger.kernel.org>,
<linux-rtc@vger.kernel.org>, <oss-drivers@corigine.com>,
<linux-rdma@vger.kernel.org>,
<platform-driver-x86@vger.kernel.org>, <linuxarm@huawei.com>,
<jdelvare@suse.com>, <kernel@maidavale.org>,
<pauk.denis@gmail.com>, <james@equiv.tech>,
<sudeep.holla@arm.com>, <cristian.marussi@arm.com>,
<matt@ranostay.sg>, <mchehab@kernel.org>, <irusskikh@marvell.com>,
<andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<saeedm@nvidia.com>, <leon@kernel.org>, <tariqt@nvidia.com>,
<louis.peens@corigine.com>, <hkallweit1@gmail.com>,
<linux@armlinux.org.uk>, <kabel@kernel.org>,
<hdegoede@redhat.com>, <ilpo.jarvinen@linux.intel.com>,
<alexandre.belloni@bootlin.com>, <krzk@kernel.org>,
<jonathan.cameron@huawei.com>, <zhanjie9@hisilicon.com>,
<zhenglifeng1@huawei.com>, <liuyonglong@huawei.com>
Subject: Re: [PATCH v1 00/21] hwmon: Fix the type of 'config' in struct hwmon_channel_info to u64
Date: Wed, 22 Jan 2025 10:52:58 +0800 [thread overview]
Message-ID: <fd412ce2-ec40-fe73-6b1b-284a99a39f12@huawei.com> (raw)
In-Reply-To: <9add68ac-7d10-4011-9da8-1f2de077d3e9@roeck-us.net>
Hi Guenter,
在 2025/1/21 22:50, Guenter Roeck 写道:
> On 1/21/25 06:12, Armin Wolf wrote:
>> Am 21.01.25 um 07:44 schrieb Huisong Li:
>>
>>> The hwmon_device_register() is deprecated. When I try to repace it with
>>> hwmon_device_register_with_info() for acpi_power_meter driver, I
>>> found that
>>> the power channel attribute in linux/hwmon.h have to extend and is more
>>> than 32 after this replacement.
>>>
>>> However, the maximum number of hwmon channel attributes is 32 which is
>>> limited by current hwmon codes. This is not good to add new channel
>>> attribute for some hwmon sensor type and support more channel
>>> attribute.
>>>
>>> This series are aimed to do this. And also make sure that
>>> acpi_power_meter
>>> driver can successfully replace the deprecated hwmon_device_register()
>>> later.
>>
>
> This explanation completely misses the point. The series tries to make
> space
> for additional "standard" attributes. Such a change should be independent
> of a driver conversion and be discussed on its own, not in the context
> of a new driver or a driver conversion.
Making space for new attributes later.
After all hwmon core have ability to do that.
>
>> Hi,
>>
>> what kind of new power attributes do you want to add to the hwmon API?
>>
>> AFAIK the acpi-power-meter driver supports the following attributes:
>>
>> power1_accuracy -> HWMON_P_ACCURACY
>> power1_cap_min -> HWMON_P_CAP_MIN
>> power1_cap_max -> HWMON_P_CAP_MAX
>> power1_cap_hyst -> HWMON_P_CAP_HYST
>> power1_cap -> HWMON_P_CAP
>> power1_average -> HWMON_P_AVERAGE
>> power1_average_min -> HWMON_P_AVERAGE_MIN
>> power1_average_max -> HWMON_P_AVERAGE_MAX
>> power1_average_interval -> HWMON_P_AVERAGE_INTERVAL
>> power1_average_interval_min -> HWMON_P_AVERAGE_INTERVAL_MIN
>> power1_average_interval_max -> HWMON_P_AVERAGE_INTERVAL_MAX
>> power1_alarm -> HWMON_P_ALARM
>> power1_model_number
>> power1_oem_info
>> power1_serial_number
>> power1_is_battery
>> name -> handled by hwmon core
>>
>> The remaining attributes are in my opinion not generic enough to add
>> them to the generic
>> hwmon power attributes. I think you should implement them as a
>> attribute_group which can
>> be passed to hwmon_device_register_with_info() using the
>> "extra_groups" parameter.
>>
>
> I absolutely agree. More specifically, it looks like this is about the
> following
> attributes.
>
> > power1_model_number
> > power1_oem_info
> > power1_serial_number
> > power1_is_battery
>
> Those are not hwmon attributes and should not be (or have been) exposed
> as sysfs attributes in the first place, but (if really wanted/needed)
> through debugfs files. Even _if_ exposed as sysfs attributes they should
> not have the power1_ prefix (except maybe for the last one).
I plan to accept the suggestion Armin proposed that acpi_power_meter can
use the "extra_groups" parameter for these "not generic hwmon power
attributes".
Should we drop the power1_ prefix? But this will lead to the change of
these attributes.
Do you mean 'power1_is_battery' can be added to hwmon power attributes
in hwmon.h?
>
> On top of that, doubling the size of configuration bits for everything
> because one sensor type needs more than 32 bits seems excessive.
> If we ever get to that point I think I'd rather introduce a second
> sensor type for power sensor attributes.
>
The bigest obstacle is that drivers which not use HWMON_CHANNEL_INFO
hwmon provided need to be modifyed.🙁
>
> .
next prev parent reply other threads:[~2025-01-22 2:53 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-21 6:44 [PATCH v1 00/21] hwmon: Fix the type of 'config' in struct hwmon_channel_info to u64 Huisong Li
2025-01-21 6:44 ` [PATCH v1 01/21] " Huisong Li
2025-01-21 17:05 ` Russell King (Oracle)
2025-01-21 17:32 ` Guenter Roeck
2025-01-22 3:34 ` lihuisong (C)
2025-01-21 6:45 ` [PATCH v1 02/21] media: video-i2c: Use HWMON_CHANNEL_INFO macro to simplify code Huisong Li
2025-01-21 6:45 ` [PATCH v1 03/21] net: aquantia: " Huisong Li
2025-01-21 6:45 ` [PATCH v1 04/21] net: nfp: " Huisong Li
2025-01-21 6:45 ` [PATCH v1 05/21] net: phy: marvell: " Huisong Li
2025-01-21 6:45 ` [PATCH v1 06/21] net: phy: marvell10g: " Huisong Li
2025-01-21 6:45 ` [PATCH v1 07/21] rtc: ab-eoz9: " Huisong Li
2025-01-21 6:45 ` [PATCH v1 08/21] rtc: ds3232: " Huisong Li
2025-01-21 6:45 ` [PATCH v1 09/21] w1: w1_therm: w1: " Huisong Li
2025-01-21 6:45 ` [PATCH v1 10/21] net: phy: aquantia: " Huisong Li
2025-01-21 6:45 ` [PATCH v1 11/21] hwmon: (asus_wmi_sensors) Fix type of 'config' in struct hwmon_channel_info to u64 Huisong Li
2025-01-21 6:45 ` [PATCH v1 12/21] hwmon: (hp-wmi-sensors) " Huisong Li
2025-01-21 6:45 ` [PATCH v1 13/21] hwmon: (mr75203) Fix the " Huisong Li
2025-01-21 6:45 ` [PATCH v1 14/21] hwmon: (pwm-fan) " Huisong Li
2025-01-21 6:45 ` [PATCH v1 15/21] hwmon: (scmi-hwmon) " Huisong Li
2025-01-21 6:45 ` [PATCH v1 16/21] hwmon: (tmp401) " Huisong Li
2025-01-21 6:45 ` [PATCH v1 17/21] hwmon: (tmp421) " Huisong Li
2025-01-21 6:45 ` [PATCH v1 18/21] net/mlx5: " Huisong Li
2025-01-21 6:45 ` [PATCH v1 19/21] platform/x86: dell-ddv: " Huisong Li
2025-01-21 12:18 ` Ilpo Järvinen
2025-01-22 5:57 ` lihuisong (C)
2025-01-21 6:45 ` [PATCH v1 20/21] hwmon: (asus-ec-sensors) " Huisong Li
2025-01-21 6:45 ` [PATCH v1 21/21] hwmon: (lm90) " Huisong Li
2025-01-21 7:47 ` [PATCH v1 00/21] hwmon: " Krzysztof Kozlowski
2025-01-21 8:14 ` lihuisong (C)
2025-01-22 7:51 ` Krzysztof Kozlowski
2025-01-22 14:36 ` Guenter Roeck
2025-01-21 14:12 ` Armin Wolf
2025-01-21 14:50 ` Guenter Roeck
2025-01-21 17:20 ` Russell King (Oracle)
2025-01-21 17:37 ` Guenter Roeck
2025-01-22 4:06 ` lihuisong (C)
2025-01-22 2:52 ` lihuisong (C) [this message]
2025-01-22 3:19 ` Guenter Roeck
2025-01-22 3:36 ` lihuisong (C)
2025-01-22 2:34 ` lihuisong (C)
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=fd412ce2-ec40-fe73-6b1b-284a99a39f12@huawei.com \
--to=lihuisong@huawei.com \
--cc=W_Armin@gmx.de \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=arm-scmi@vger.kernel.org \
--cc=cristian.marussi@arm.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hdegoede@redhat.com \
--cc=hkallweit1@gmail.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=irusskikh@marvell.com \
--cc=james@equiv.tech \
--cc=jdelvare@suse.com \
--cc=jonathan.cameron@huawei.com \
--cc=kabel@kernel.org \
--cc=kernel@maidavale.org \
--cc=krzk@kernel.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linux@roeck-us.net \
--cc=linuxarm@huawei.com \
--cc=liuyonglong@huawei.com \
--cc=louis.peens@corigine.com \
--cc=matt@ranostay.sg \
--cc=mchehab@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@corigine.com \
--cc=pabeni@redhat.com \
--cc=pauk.denis@gmail.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=sudeep.holla@arm.com \
--cc=tariqt@nvidia.com \
--cc=zhanjie9@hisilicon.com \
--cc=zhenglifeng1@huawei.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