All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: "Nilawar, Badal" <badal.nilawar@intel.com>
Cc: "Gupta, Anshuman" <anshuman.gupta@intel.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	"jani.nikula@linux.intel.com" <jani.nikula@linux.intel.com>,
	"joonas.lahtinen@linux.intel.com"
	<joonas.lahtinen@linux.intel.com>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
	"tursulin@ursulin.net" <tursulin@ursulin.net>,
	"linux@roeck-us.net" <linux@roeck-us.net>,
	"andi.shyti@linux.intel.com" <andi.shyti@linux.intel.com>,
	"andriy.shevchenko@linux.intel.com"
	<andriy.shevchenko@linux.intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
	"Tauro, Riana" <riana.tauro@intel.com>,
	"Dixit, Ashutosh" <ashutosh.dixit@intel.com>,
	"Poosa, Karthik" <karthik.poosa@intel.com>
Subject: Re: [PATCH v2] drm/i915/hwmon: expose package temperature
Date: Tue, 10 Sep 2024 13:58:29 +0300	[thread overview]
Message-ID: <ZuAmVaPoDS4xH6Le@black.fi.intel.com> (raw)
In-Reply-To: <6683448a-aeb4-4ab1-9520-c83f70100583@intel.com>

On Tue, Sep 10, 2024 at 11:57:20AM +0530, Nilawar, Badal wrote:
> On 10-09-2024 10:07, Gupta, Anshuman wrote:
> > > 
> > > ...
> > > 
> > > > +static int
> > > > +hwm_temp_read(struct hwm_drvdata *ddat, u32 attr, long *val) {
> > > > +	struct i915_hwmon *hwmon = ddat->hwmon;
> > > > +	intel_wakeref_t wakeref;
> > > > +	u32 reg_val;
> > > > +
> > > > +	switch (attr) {
> > > > +	case hwmon_temp_input:
> > > > +		with_intel_runtime_pm(ddat->uncore->rpm, wakeref)
> > > > +			reg_val = intel_uncore_read(ddat->uncore, hwmon-
> > > > rg.pkg_temp);
> > > > +
> > > > +		/* HW register value is in degrees, convert to millidegrees. */
> > > > +		*val = REG_FIELD_GET(TEMP_MASK, reg_val) *
> > > MILLIDEGREE_PER_DEGREE;
> > > > +		return 0;
> > > > +	default:
> > > > +		return -EOPNOTSUPP;
> > > > +	}
> > > 
> > > I don't understand this love for single case switches.
> > IMHO this is kept to keep symmetry in this file to make it more readable.
> > Also it readable to return error using default case, which is followed in this entire file.
> I agree on this. Let’s stick to file-wide approach and ensure it is applied
> to the fan_input attribute as well.

Since fan patch is already on its way to drm-next, you can submit a fix if you wish.
Although I don't agree with it, I have no objections.

Raag

  parent reply	other threads:[~2024-09-10 10:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06  9:31 [PATCH v2] drm/i915/hwmon: expose package temperature Raag Jadav
2024-09-06  9:45 ` Riana Tauro
2024-09-07 11:25   ` Raag Jadav
2024-09-09 22:27     ` Andi Shyti
2024-09-10  4:50       ` Raag Jadav
2024-09-06 10:47 ` ✗ Fi.CI.BAT: failure for drm/i915/hwmon: expose package temperature (rev3) Patchwork
2024-09-09 22:23 ` [PATCH v2] drm/i915/hwmon: expose package temperature Andi Shyti
2024-09-10  4:37   ` Gupta, Anshuman
2024-09-10  6:27     ` Nilawar, Badal
2024-09-10  9:10       ` Andi Shyti
2024-09-10 10:58       ` Raag Jadav [this message]
2024-09-10 12:36         ` Andi Shyti

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=ZuAmVaPoDS4xH6Le@black.fi.intel.com \
    --to=raag.jadav@intel.com \
    --cc=andi.shyti@kernel.org \
    --cc=andi.shyti@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=karthik.poosa@intel.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=tursulin@ursulin.net \
    /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.