From: Guenter Roeck <linux@roeck-us.net>
To: "Kallas, Pawel" <pawel.kallas@intel.com>
Cc: jdelvare@suse.com, corbet@lwn.net, linux-hwmon@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
iwona.winiarska@intel.com
Subject: Re: [PATCH 0/3] hwmon: (pmbus) add power from energy readings
Date: Wed, 6 Jul 2022 06:17:58 -0700 [thread overview]
Message-ID: <20220706131758.GA652205@roeck-us.net> (raw)
In-Reply-To: <20220706104024.3118590-1-pawel.kallas@intel.com>
On Wed, Jul 06, 2022 at 12:40:21PM +0200, Kallas, Pawel wrote:
> Add support for reading EIN or EOUT registers and expose power calculated
> from energy. This is more accurate than PIN and POUT power readings.
> Readings are exposed in new hwmon files power1_average and power2_average.
> Also add support for QUERY command that is needed to check availability
> of EIN and EOUT reads and its data format. Only direct data format is
> supported due to lack of test devices supporting other formats.
>
I don't think this is a good idea. EIN/EOUT report energy consumption,
not power. The "average" attributes as implemented don't really report
a reliable number since the averaging period is not defined. Also, kernel
drivers should not make up such numbers. I don't mind adding energy
attribute support, but that should be reported as what it is, energy.
What userspace does with it would then be a userspace concern; it can
calculate all kinds of averages from it as much as it wants.
Also, new attributes should not depend on query command support.
I don't mind adding support for that, but it would have to be independent
of energy attribute support.
Thanks,
Guenter
> Kallas, Pawel (3):
> hwmon: (pmbus) add support for QUERY command
> hwmon: (pmbus) refactor sensor initialization
> hwmon: (pmbus) add EIN and EOUT readings
>
> Documentation/hwmon/pmbus-core.rst | 7 +
> drivers/hwmon/pmbus/pmbus.c | 20 +++
> drivers/hwmon/pmbus/pmbus.h | 19 +++
> drivers/hwmon/pmbus/pmbus_core.c | 261 +++++++++++++++++++++++++++--
> 4 files changed, 291 insertions(+), 16 deletions(-)
>
>
> base-commit: 7c1de25c06f31b04744beae891baf147af9ba0cb
next prev parent reply other threads:[~2022-07-06 13:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 10:40 [PATCH 0/3] hwmon: (pmbus) add power from energy readings Kallas, Pawel
2022-07-06 10:40 ` [PATCH 1/3] hwmon: (pmbus) add support for QUERY command Kallas, Pawel
2022-07-06 10:40 ` [PATCH 2/3] hwmon: (pmbus) refactor sensor initialization Kallas, Pawel
2022-07-06 10:40 ` [PATCH 3/3] hwmon: (pmbus) add EIN and EOUT readings Kallas, Pawel
2022-07-06 13:17 ` Guenter Roeck [this message]
2022-07-07 14:01 ` [PATCH 0/3] hwmon: (pmbus) add power from energy readings Kallas, Pawel
2022-07-07 14:09 ` Guenter Roeck
2022-07-07 16:00 ` Kallas, Pawel
2022-07-14 13:38 ` Guenter Roeck
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=20220706131758.GA652205@roeck-us.net \
--to=linux@roeck-us.net \
--cc=corbet@lwn.net \
--cc=iwona.winiarska@intel.com \
--cc=jdelvare@suse.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pawel.kallas@intel.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;
as well as URLs for NNTP newsgroup(s).