All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gupta, Anshuman" <anshuman.gupta@intel.com>
To: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
Cc: "Nilawar, Badal" <badal.nilawar@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Tauro, Riana" <riana.tauro@intel.com>,
	"Ewins, Jon" <jon.ewins@intel.com>,
	"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>
Subject: RE: [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage support
Date: Tue, 13 Sep 2022 08:11:57 +0000	[thread overview]
Message-ID: <CY5PR11MB62114DF624728E35804635D495479@CY5PR11MB6211.namprd11.prod.outlook.com> (raw)
In-Reply-To: <87edwg5z1b.wl-ashutosh.dixit@intel.com>



> -----Original Message-----
> From: Dixit, Ashutosh <ashutosh.dixit@intel.com>
> Sent: Monday, September 12, 2022 10:08 PM
> To: Gupta, Anshuman <anshuman.gupta@intel.com>
> Cc: Nilawar, Badal <badal.nilawar@intel.com>; intel-gfx@lists.freedesktop.org;
> Tauro, Riana <riana.tauro@intel.com>; Ewins, Jon <jon.ewins@intel.com>;
> linux-hwmon@vger.kernel.org
> Subject: Re: [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage
> support
> 
> On Mon, 12 Sep 2022 07:09:28 -0700, Gupta, Anshuman wrote:
> >
> > > +static int
> > > +hwm_in_read(struct hwm_drvdata *ddat, u32 attr, long *val) {
> > > +	struct i915_hwmon *hwmon = ddat->hwmon;
> > > +	intel_wakeref_t wakeref;
> > > +	u32 reg_value;
> > > +
> > > +	switch (attr) {
> > > +	case hwmon_in_input:
> >
> > Other attributes in this series take hwmon->lock before accessing i915
> > registers , So do we need lock here as well ?
> 
> The lock is being taken only for RMW and for making sure energy counter
> updates happen atomically. We are not taking the lock for just reads so IMO no
> lock is needed here.
If that is the case, then why it needs to grab a lock for rmw on different
Register ? Like in patch  3 of this series grabs hwmon->howmon_lock for rmw  on 
two different register pkg_power_sku_unit and pkg_rapl_limit. One register rmw 
should be independent of other register here ?
Thanks,
Anshuman Gupta

> 
> > > +		with_intel_runtime_pm(ddat->uncore->rpm, wakeref)
> > > +			reg_value = intel_uncore_read(ddat->uncore, hwmon-
> > > >rg.gt_perf_status);
> > > +		/* In units of 2.5 millivolt */
> > > +		*val =
> > > DIV_ROUND_CLOSEST(REG_FIELD_GET(GEN12_VOLTAGE_MASK, reg_value)
> * 25,
> > > 10);
> > > +		return 0;
> > > +	default:
> > > +		return -EOPNOTSUPP;
> > > +	}
> > > +}
> 
> Thanks.
> --
> Ashutosh

WARNING: multiple messages have this Message-ID (diff)
From: "Gupta, Anshuman" <anshuman.gupta@intel.com>
To: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
Cc: "linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage support
Date: Tue, 13 Sep 2022 08:11:57 +0000	[thread overview]
Message-ID: <CY5PR11MB62114DF624728E35804635D495479@CY5PR11MB6211.namprd11.prod.outlook.com> (raw)
In-Reply-To: <87edwg5z1b.wl-ashutosh.dixit@intel.com>



> -----Original Message-----
> From: Dixit, Ashutosh <ashutosh.dixit@intel.com>
> Sent: Monday, September 12, 2022 10:08 PM
> To: Gupta, Anshuman <anshuman.gupta@intel.com>
> Cc: Nilawar, Badal <badal.nilawar@intel.com>; intel-gfx@lists.freedesktop.org;
> Tauro, Riana <riana.tauro@intel.com>; Ewins, Jon <jon.ewins@intel.com>;
> linux-hwmon@vger.kernel.org
> Subject: Re: [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage
> support
> 
> On Mon, 12 Sep 2022 07:09:28 -0700, Gupta, Anshuman wrote:
> >
> > > +static int
> > > +hwm_in_read(struct hwm_drvdata *ddat, u32 attr, long *val) {
> > > +	struct i915_hwmon *hwmon = ddat->hwmon;
> > > +	intel_wakeref_t wakeref;
> > > +	u32 reg_value;
> > > +
> > > +	switch (attr) {
> > > +	case hwmon_in_input:
> >
> > Other attributes in this series take hwmon->lock before accessing i915
> > registers , So do we need lock here as well ?
> 
> The lock is being taken only for RMW and for making sure energy counter
> updates happen atomically. We are not taking the lock for just reads so IMO no
> lock is needed here.
If that is the case, then why it needs to grab a lock for rmw on different
Register ? Like in patch  3 of this series grabs hwmon->howmon_lock for rmw  on 
two different register pkg_power_sku_unit and pkg_rapl_limit. One register rmw 
should be independent of other register here ?
Thanks,
Anshuman Gupta

> 
> > > +		with_intel_runtime_pm(ddat->uncore->rpm, wakeref)
> > > +			reg_value = intel_uncore_read(ddat->uncore, hwmon-
> > > >rg.gt_perf_status);
> > > +		/* In units of 2.5 millivolt */
> > > +		*val =
> > > DIV_ROUND_CLOSEST(REG_FIELD_GET(GEN12_VOLTAGE_MASK, reg_value)
> * 25,
> > > 10);
> > > +		return 0;
> > > +	default:
> > > +		return -EOPNOTSUPP;
> > > +	}
> > > +}
> 
> Thanks.
> --
> Ashutosh

  reply	other threads:[~2022-09-13  8:12 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25 13:21 [PATCH 0/7] drm/i915: Add HWMON support Badal Nilawar
2022-08-25 13:21 ` [Intel-gfx] " Badal Nilawar
2022-08-25 13:21 ` [PATCH 1/7] drm/i915/hwmon: Add HWMON infrastructure Badal Nilawar
2022-08-25 13:21   ` [Intel-gfx] " Badal Nilawar
2022-08-26 13:30   ` Guenter Roeck
2022-08-26 13:30     ` [Intel-gfx] " Guenter Roeck
2022-08-29 17:26   ` Dixit, Ashutosh
2022-08-29 17:26     ` [Intel-gfx] " Dixit, Ashutosh
2022-08-25 13:21 ` [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage support Badal Nilawar
2022-08-25 13:21   ` [Intel-gfx] " Badal Nilawar
2022-08-29 17:30   ` Dixit, Ashutosh
2022-08-29 17:30     ` [Intel-gfx] " Dixit, Ashutosh
2022-09-15 14:40     ` Nilawar, Badal
2022-09-15 14:40       ` Nilawar, Badal
2022-09-21  0:02       ` Dixit, Ashutosh
2022-09-21  0:02         ` [Intel-gfx] " Dixit, Ashutosh
2022-09-12 14:09   ` Gupta, Anshuman
2022-09-12 14:09     ` [Intel-gfx] " Gupta, Anshuman
2022-09-12 16:37     ` Dixit, Ashutosh
2022-09-12 16:37       ` [Intel-gfx] " Dixit, Ashutosh
2022-09-13  8:11       ` Gupta, Anshuman [this message]
2022-09-13  8:11         ` Gupta, Anshuman
2022-09-13 15:19         ` Dixit, Ashutosh
2022-09-15  6:29           ` Gupta, Anshuman
2022-09-15  6:29             ` Gupta, Anshuman
2022-08-25 13:21 ` [PATCH 3/7] drm/i915/hwmon: Power PL1 limit and TDP setting Badal Nilawar
2022-08-25 13:21   ` [Intel-gfx] " Badal Nilawar
2022-08-30  2:33   ` Dixit, Ashutosh
2022-08-30  2:33     ` [Intel-gfx] " Dixit, Ashutosh
2022-08-25 13:21 ` [PATCH 4/7] drm/i915/hwmon: Show device level energy usage Badal Nilawar
2022-08-25 13:21   ` [Intel-gfx] " Badal Nilawar
2022-08-30  3:14   ` Dixit, Ashutosh
2022-08-30  3:14     ` [Intel-gfx] " 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-25 13:21 ` [PATCH 5/7] drm/i915/hwmon: Expose card reactive critical power Badal Nilawar
2022-08-25 13:21   ` [Intel-gfx] " Badal Nilawar
2022-08-25 13:21 ` [PATCH 6/7] drm/i915/hwmon: Expose power1_max_interval Badal Nilawar
2022-08-25 13:21   ` [Intel-gfx] " Badal Nilawar
2022-08-25 13:21 ` [PATCH 7/7] drm/i915/hwmon: Extend power/energy for XEHPSDV Badal Nilawar
2022-08-25 13:21   ` [Intel-gfx] " Badal Nilawar
2022-08-30  5:34   ` Dixit, Ashutosh
2022-08-30  5:34     ` [Intel-gfx] " Dixit, Ashutosh
2022-08-25 14:01 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add HWMON support (rev5) Patchwork
2022-08-25 14:01 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-08-25 14:21 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-08-29 20:08 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2022-10-20  1:14 [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage support kernel test robot
2022-10-13 15:45 [PATCH 0/7] drm/i915: Add HWMON support Ashutosh Dixit
2022-10-13 15:45 ` [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage support Ashutosh Dixit
2022-10-13 15:45   ` Ashutosh Dixit
2022-09-27  5:50 [PATCH 0/7] drm/i915: Add HWMON support Badal Nilawar
2022-09-27  5:50 ` [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage support Badal Nilawar
2022-09-27  5:50   ` Badal Nilawar
2022-09-26 17:52 [PATCH 0/7] Add HWMON support Badal Nilawar
2022-09-26 17:52 ` [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage support Badal Nilawar
2022-09-26 17:52   ` Badal Nilawar
2022-09-23 19:56 [PATCH 0/7] drm/i915: Add HWMON support Badal Nilawar
2022-09-23 19:56 ` [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage support Badal Nilawar
2022-09-23 19:56   ` Badal Nilawar
2022-09-16 15:00 [PATCH 0/7] drm/i915: Add HWMON support Badal Nilawar
2022-09-16 15:00 ` [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage support Badal Nilawar
2022-09-16 15:00   ` Badal Nilawar
2022-09-21 11:08   ` Gupta, Anshuman
2022-09-21 11:08     ` Gupta, Anshuman
2022-08-18 19:38 [PATCH 0/7] drm/i915: Add HWMON support Badal Nilawar
2022-08-18 19:38 ` [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage support Badal Nilawar
2022-08-12 17:37 [PATCH 0/7] drm/i915: Add HWMON support Badal Nilawar
2022-08-12 17:37 ` [PATCH 2/7] drm/i915/hwmon: Add HWMON current voltage support Badal Nilawar
2022-08-12 18:05   ` 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=CY5PR11MB62114DF624728E35804635D495479@CY5PR11MB6211.namprd11.prod.outlook.com \
    --to=anshuman.gupta@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jon.ewins@intel.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=riana.tauro@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.