All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@linux.intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: linux-hwmon@vger.kernel.org, Jani Nikula <jani.nikula@intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	Badal Nilawar <badal.nilawar@intel.com>
Subject: Re: [Intel-gfx] [PATCH 4/7] drm/i915/hwmon: Show device level energy usage
Date: Mon, 3 Oct 2022 23:13:10 +0200	[thread overview]
Message-ID: <YztQZoHViyw2Cqch@ashyti-mobl2.lan> (raw)
In-Reply-To: <YzcezNGdRJnyXS3N@intel.com>

Hi Badal,

[...]

> > diff --git a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon
> > index 16e697b1db3d..7525db243d74 100644
> > --- a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon
> > +++ b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon
> > @@ -25,3 +25,11 @@ Contact:	dri-devel@lists.freedesktop.org
> >  Description:	RO. Card default power limit (default TDP setting).
> >  
> >  		Only supported for particular Intel i915 graphics platforms.
> > +
> > +What:		/sys/devices/.../hwmon/hwmon<i>/energy1_input
> > +Date:		February 2023
> > +KernelVersion:	6.2
> > +Contact:	dri-devel@lists.freedesktop.org
> 
> I'm sorry for being late on the review here, and I know that others
> already looked at the date and other details here in this doc.
> So I'm curious why we have decided for the dri-devel mailing list
> and not for the intel-gfx since intel-gfx is the only one we have
> listed for i915 dir in the MAINTAINERS file:
> L:      intel-gfx@lists.freedesktop.org

same question here.

> > +Description:	RO. Energy input of device in microjoules.
> > +
> > +		Only supported for particular Intel i915 graphics platforms.

[...]

> > +/*
> > + * hwm_energy - Obtain energy value
> > + *
> > + * The underlying energy hardware register is 32-bits and is subject to
> > + * overflow. How long before overflow? For example, with an example
> > + * scaling bit shift of 14 bits (see register *PACKAGE_POWER_SKU_UNIT) and
> > + * a power draw of 1000 watts, the 32-bit counter will overflow in
> > + * approximately 4.36 minutes.
> > + *
> > + * Examples:
> > + *    1 watt:  (2^32 >> 14) /    1 W / (60 * 60 * 24) secs/day -> 3 days
> > + * 1000 watts: (2^32 >> 14) / 1000 W / 60             secs/min -> 4.36 minutes
> > + *
> > + * The function significantly increases overflow duration (from 4.36
> > + * minutes) by accumulating the energy register into a 'long' as allowed by
> > + * the hwmon API. Using x86_64 128 bit arithmetic (see mul_u64_u32_shr()),
> > + * a 'long' of 63 bits, SF_ENERGY of 1e6 (~20 bits) and
> > + * hwmon->scl_shift_energy of 14 bits we have 57 (63 - 20 + 14) bits before
> > + * energy1_input overflows. This at 1000 W is an overflow duration of 278 years.
> > + */
> > +static int
> > +hwm_energy(struct hwm_drvdata *ddat, long *energy)

This function can just be void.

Andi

> > +{

[...]

WARNING: multiple messages have this Message-ID (diff)
From: Andi Shyti <andi.shyti@linux.intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: linux-hwmon@vger.kernel.org, Jani Nikula <jani.nikula@intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 4/7] drm/i915/hwmon: Show device level energy usage
Date: Mon, 3 Oct 2022 23:13:10 +0200	[thread overview]
Message-ID: <YztQZoHViyw2Cqch@ashyti-mobl2.lan> (raw)
In-Reply-To: <YzcezNGdRJnyXS3N@intel.com>

Hi Badal,

[...]

> > diff --git a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon
> > index 16e697b1db3d..7525db243d74 100644
> > --- a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon
> > +++ b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon
> > @@ -25,3 +25,11 @@ Contact:	dri-devel@lists.freedesktop.org
> >  Description:	RO. Card default power limit (default TDP setting).
> >  
> >  		Only supported for particular Intel i915 graphics platforms.
> > +
> > +What:		/sys/devices/.../hwmon/hwmon<i>/energy1_input
> > +Date:		February 2023
> > +KernelVersion:	6.2
> > +Contact:	dri-devel@lists.freedesktop.org
> 
> I'm sorry for being late on the review here, and I know that others
> already looked at the date and other details here in this doc.
> So I'm curious why we have decided for the dri-devel mailing list
> and not for the intel-gfx since intel-gfx is the only one we have
> listed for i915 dir in the MAINTAINERS file:
> L:      intel-gfx@lists.freedesktop.org

same question here.

> > +Description:	RO. Energy input of device in microjoules.
> > +
> > +		Only supported for particular Intel i915 graphics platforms.

[...]

> > +/*
> > + * hwm_energy - Obtain energy value
> > + *
> > + * The underlying energy hardware register is 32-bits and is subject to
> > + * overflow. How long before overflow? For example, with an example
> > + * scaling bit shift of 14 bits (see register *PACKAGE_POWER_SKU_UNIT) and
> > + * a power draw of 1000 watts, the 32-bit counter will overflow in
> > + * approximately 4.36 minutes.
> > + *
> > + * Examples:
> > + *    1 watt:  (2^32 >> 14) /    1 W / (60 * 60 * 24) secs/day -> 3 days
> > + * 1000 watts: (2^32 >> 14) / 1000 W / 60             secs/min -> 4.36 minutes
> > + *
> > + * The function significantly increases overflow duration (from 4.36
> > + * minutes) by accumulating the energy register into a 'long' as allowed by
> > + * the hwmon API. Using x86_64 128 bit arithmetic (see mul_u64_u32_shr()),
> > + * a 'long' of 63 bits, SF_ENERGY of 1e6 (~20 bits) and
> > + * hwmon->scl_shift_energy of 14 bits we have 57 (63 - 20 + 14) bits before
> > + * energy1_input overflows. This at 1000 W is an overflow duration of 278 years.
> > + */
> > +static int
> > +hwm_energy(struct hwm_drvdata *ddat, long *energy)

This function can just be void.

Andi

> > +{

[...]

WARNING: multiple messages have this Message-ID (diff)
From: Andi Shyti <andi.shyti@linux.intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Badal Nilawar <badal.nilawar@intel.com>,
	linux-hwmon@vger.kernel.org, Jani Nikula <jani.nikula@intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 4/7] drm/i915/hwmon: Show device level energy usage
Date: Mon, 3 Oct 2022 23:13:10 +0200	[thread overview]
Message-ID: <YztQZoHViyw2Cqch@ashyti-mobl2.lan> (raw)
In-Reply-To: <YzcezNGdRJnyXS3N@intel.com>

Hi Badal,

[...]

> > diff --git a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon
> > index 16e697b1db3d..7525db243d74 100644
> > --- a/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon
> > +++ b/Documentation/ABI/testing/sysfs-driver-intel-i915-hwmon
> > @@ -25,3 +25,11 @@ Contact:	dri-devel@lists.freedesktop.org
> >  Description:	RO. Card default power limit (default TDP setting).
> >  
> >  		Only supported for particular Intel i915 graphics platforms.
> > +
> > +What:		/sys/devices/.../hwmon/hwmon<i>/energy1_input
> > +Date:		February 2023
> > +KernelVersion:	6.2
> > +Contact:	dri-devel@lists.freedesktop.org
> 
> I'm sorry for being late on the review here, and I know that others
> already looked at the date and other details here in this doc.
> So I'm curious why we have decided for the dri-devel mailing list
> and not for the intel-gfx since intel-gfx is the only one we have
> listed for i915 dir in the MAINTAINERS file:
> L:      intel-gfx@lists.freedesktop.org

same question here.

> > +Description:	RO. Energy input of device in microjoules.
> > +
> > +		Only supported for particular Intel i915 graphics platforms.

[...]

> > +/*
> > + * hwm_energy - Obtain energy value
> > + *
> > + * The underlying energy hardware register is 32-bits and is subject to
> > + * overflow. How long before overflow? For example, with an example
> > + * scaling bit shift of 14 bits (see register *PACKAGE_POWER_SKU_UNIT) and
> > + * a power draw of 1000 watts, the 32-bit counter will overflow in
> > + * approximately 4.36 minutes.
> > + *
> > + * Examples:
> > + *    1 watt:  (2^32 >> 14) /    1 W / (60 * 60 * 24) secs/day -> 3 days
> > + * 1000 watts: (2^32 >> 14) / 1000 W / 60             secs/min -> 4.36 minutes
> > + *
> > + * The function significantly increases overflow duration (from 4.36
> > + * minutes) by accumulating the energy register into a 'long' as allowed by
> > + * the hwmon API. Using x86_64 128 bit arithmetic (see mul_u64_u32_shr()),
> > + * a 'long' of 63 bits, SF_ENERGY of 1e6 (~20 bits) and
> > + * hwmon->scl_shift_energy of 14 bits we have 57 (63 - 20 + 14) bits before
> > + * energy1_input overflows. This at 1000 W is an overflow duration of 278 years.
> > + */
> > +static int
> > +hwm_energy(struct hwm_drvdata *ddat, long *energy)

This function can just be void.

Andi

> > +{

[...]

  reply	other threads:[~2022-10-03 21:13 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27  5:50 [PATCH 0/7] drm/i915: Add HWMON support Badal Nilawar
2022-09-27  5:50 ` [Intel-gfx] " Badal Nilawar
2022-09-27  5:50 ` Badal Nilawar
2022-09-27  5:50 ` [PATCH 1/7] drm/i915/hwmon: Add HWMON infrastructure Badal Nilawar
2022-09-27  5:50   ` [Intel-gfx] " Badal Nilawar
2022-09-27  5:50   ` Badal Nilawar
2022-10-03 20:50   ` [Intel-gfx] " Andi Shyti
2022-10-03 20:50     ` Andi Shyti
2022-09-27  5:50 ` [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage support Badal Nilawar
2022-09-27  5:50   ` [Intel-gfx] " Badal Nilawar
2022-09-27  5:50   ` Badal Nilawar
2022-10-03 20:56   ` [Intel-gfx] " Andi Shyti
2022-10-03 20:56     ` Andi Shyti
2022-10-13 15:52     ` Dixit, Ashutosh
2022-10-13 15:52       ` Dixit, Ashutosh
2022-10-13 15:52       ` Dixit, Ashutosh
2022-09-27  5:50 ` [PATCH 3/7] drm/i915/hwmon: Power PL1 limit and TDP setting Badal Nilawar
2022-09-27  5:50   ` [Intel-gfx] " Badal Nilawar
2022-09-27  5:50   ` Badal Nilawar
2022-09-28  7:08   ` Gupta, Anshuman
2022-09-28  7:08     ` Gupta, Anshuman
2022-09-28  7:08     ` [Intel-gfx] " Gupta, Anshuman
2022-10-03 21:05   ` Andi Shyti
2022-10-03 21:05     ` Andi Shyti
2022-10-13 15:54     ` Dixit, Ashutosh
2022-10-13 15:54       ` Dixit, Ashutosh
2022-10-13 15:54       ` Dixit, Ashutosh
2022-09-27  5:50 ` [PATCH 4/7] drm/i915/hwmon: Show device level energy usage Badal Nilawar
2022-09-27  5:50   ` [Intel-gfx] " Badal Nilawar
2022-09-27  5:50   ` Badal Nilawar
2022-09-30 16:52   ` Rodrigo Vivi
2022-09-30 16:52     ` [Intel-gfx] " Rodrigo Vivi
2022-09-30 16:52     ` Rodrigo Vivi
2022-10-03 21:13     ` Andi Shyti [this message]
2022-10-03 21:13       ` [Intel-gfx] " Andi Shyti
2022-10-03 21:13       ` Andi Shyti
2022-10-13 15:54       ` Dixit, Ashutosh
2022-10-13 15:54         ` Dixit, Ashutosh
2022-10-13 15:54     ` Dixit, Ashutosh
2022-10-13 15:54       ` [Intel-gfx] " Dixit, Ashutosh
2022-10-13 15:54       ` Dixit, Ashutosh
2022-09-27  5:50 ` [PATCH 5/7] drm/i915/hwmon: Expose card reactive critical power Badal Nilawar
2022-09-27  5:50   ` [Intel-gfx] " Badal Nilawar
2022-09-27  5:50   ` Badal Nilawar
2022-10-03 21:18   ` [Intel-gfx] " Andi Shyti
2022-10-03 21:18     ` Andi Shyti
2022-09-27  5:50 ` [PATCH 6/7] drm/i915/hwmon: Expose power1_max_interval Badal Nilawar
2022-09-27  5:50   ` [Intel-gfx] " Badal Nilawar
2022-09-27  5:50   ` Badal Nilawar
2022-09-28  7:09   ` Gupta, Anshuman
2022-09-28  7:09     ` Gupta, Anshuman
2022-09-28  7:09     ` [Intel-gfx] " Gupta, Anshuman
2022-10-03 21:32   ` Andi Shyti
2022-10-03 21:32     ` Andi Shyti
2022-10-13 15:55     ` Dixit, Ashutosh
2022-10-13 15:55       ` Dixit, Ashutosh
2022-10-13 15:55       ` Dixit, Ashutosh
2022-09-27  5:50 ` [PATCH 7/7] drm/i915/hwmon: Extend power/energy for XEHPSDV Badal Nilawar
2022-09-27  5:50   ` [Intel-gfx] " Badal Nilawar
2022-09-27  5:50   ` Badal Nilawar
2022-10-03 21:40   ` [Intel-gfx] " Andi Shyti
2022-10-03 21:40     ` Andi Shyti
2022-09-27  7:13 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add HWMON support (rev8) Patchwork
2022-09-27  7:13 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-09-27  7:36 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-09-29  6:51 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-09-30  4:19 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2022-10-20  1:25 [Intel-gfx] [PATCH 4/7] drm/i915/hwmon: Show device level energy usage kernel test robot
2022-10-13 15:45 [PATCH 0/7] drm/i915: Add HWMON support Ashutosh Dixit
2022-10-13 15:45 ` [Intel-gfx] [PATCH 4/7] drm/i915/hwmon: Show device level energy usage Ashutosh Dixit
2022-09-26 17:52 [PATCH 0/7] Add HWMON support Badal Nilawar
2022-09-26 17:52 ` [Intel-gfx] [PATCH 4/7] drm/i915/hwmon: Show device level energy usage Badal Nilawar
2022-09-23 19:56 [PATCH 0/7] drm/i915: Add HWMON support Badal Nilawar
2022-09-23 19:56 ` [Intel-gfx] [PATCH 4/7] drm/i915/hwmon: Show device level energy usage Badal Nilawar
2022-09-24  3:55   ` Dixit, Ashutosh
2022-09-16 15:00 [PATCH 0/7] drm/i915: Add HWMON support Badal Nilawar
2022-09-16 15:00 ` [Intel-gfx] [PATCH 4/7] drm/i915/hwmon: Show device level energy usage Badal Nilawar
2022-09-21 12:02   ` Gupta, Anshuman
2022-10-13 15:53     ` Dixit, Ashutosh
2022-08-25 13:21 [PATCH 0/7] drm/i915: Add HWMON support Badal Nilawar
2022-08-25 13:21 ` [Intel-gfx] [PATCH 4/7] drm/i915/hwmon: Show device level energy usage Badal Nilawar
2022-08-30  3:14   ` Dixit, Ashutosh
2022-09-13  8:50   ` Tvrtko Ursulin
2022-09-21  0:24     ` Dixit, Ashutosh
2022-09-21  0:24       ` Dixit, Ashutosh
2022-09-21  7:43       ` Tvrtko Ursulin
2022-09-21  7:43         ` Tvrtko Ursulin
2022-08-18 19:38 [PATCH 0/7] drm/i915: Add HWMON support Badal Nilawar
2022-08-18 19:38 ` [Intel-gfx] [PATCH 4/7] drm/i915/hwmon: Show device level energy usage Badal Nilawar
2022-08-12 17:37 [PATCH 0/7] drm/i915: Add HWMON support Badal Nilawar
2022-08-12 17:37 ` [Intel-gfx] [PATCH 4/7] drm/i915/hwmon: Show device level energy usage Badal Nilawar
2022-08-12 18:08   ` 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=YztQZoHViyw2Cqch@ashyti-mobl2.lan \
    --to=andi.shyti@linux.intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=rodrigo.vivi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.