From: "Nilawar, Badal" <badal.nilawar@intel.com>
To: "Gupta, Anshuman" <anshuman.gupta@intel.com>,
Andi Shyti <andi.shyti@kernel.org>,
"Jadav, Raag" <raag.jadav@intel.com>
Cc: "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 11:57:20 +0530 [thread overview]
Message-ID: <6683448a-aeb4-4ab1-9520-c83f70100583@intel.com> (raw)
In-Reply-To: <CY5PR11MB6211D25D522F6044554B84F7959A2@CY5PR11MB6211.namprd11.prod.outlook.com>
On 10-09-2024 10:07, Gupta, Anshuman wrote:
>
>
>> -----Original Message-----
>> From: Andi Shyti <andi.shyti@kernel.org>
>> Sent: Tuesday, September 10, 2024 3:54 AM
>> To: Jadav, Raag <raag.jadav@intel.com>
>> Cc: jani.nikula@linux.intel.com; joonas.lahtinen@linux.intel.com; Vivi,
>> Rodrigo <rodrigo.vivi@intel.com>; tursulin@ursulin.net; linux@roeck-us.net;
>> andi.shyti@linux.intel.com; andriy.shevchenko@linux.intel.com; intel-
>> gfx@lists.freedesktop.org; linux-hwmon@vger.kernel.org; Gupta, Anshuman
>> <anshuman.gupta@intel.com>; Nilawar, Badal <badal.nilawar@intel.com>;
>> 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
>>
>> Hi Raag,
>>
>> ...
>>
>>> +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.
Regards,
Badal
> Thanks,
> Anshuman.
>>
>> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
>>
>> Thanks,
>> Andi
next prev parent reply other threads:[~2024-09-10 6:27 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 [this message]
2024-09-10 9:10 ` Andi Shyti
2024-09-10 10:58 ` Raag Jadav
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=6683448a-aeb4-4ab1-9520-c83f70100583@intel.com \
--to=badal.nilawar@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=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=raag.jadav@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox