From: "Nilawar, Badal" <badal.nilawar@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>,
Karthik Poosa <karthik.poosa@intel.com>,
<intel-xe@lists.freedesktop.org>, <anshuman.gupta@intel.com>
Subject: Re: [PATCH v7 3/4] drm/xe/hwmon: Update xe_hwmon_process_reg
Date: Fri, 10 May 2024 11:44:58 +0530 [thread overview]
Message-ID: <2ffd302c-db00-4547-b272-4592ea2445b9@intel.com> (raw)
In-Reply-To: <ohb6qlpknazjbaqf25sevflq5gtuxge4m4jle54szsnucwq6rd@l5qrumod4a5t>
Hi Karthik,
On 24-04-2024 17:10, Lucas De Marchi wrote:
> On Wed, Apr 24, 2024 at 01:46:45PM GMT, Nilawar, Badal wrote:
>>> I's my personal feeling. I don't like the pattern xe_hwmon.c is using
>>> since it's very easy to introduce buggy code. If someone wants to give a
>>> r-b and merge this particular patch, fine. But I do think this pattern
>>> should be changed.
>> Idea of xe_hwmon_process_reg to abstract the register accesses. In
>> i915 we maintain register addresses inside the hwmon structure. During
>> reviews that idea was not much likeable. So we came up with
>> xe_hwmon_get_reg, xe_hwmon_process_reg.
>
> xe_hwmon_get_reg() is totally fine. It is xe_hwmon_process_reg() that
> abstracts what it shouldn't IMO. As shown in the snippet, the only thing
> it does is to make it easier to introduce hidden bugs.
To xe_hwmon_process_reg effectively we should validate all the regs
hwmon attribute is using. For power1_max attribute we should have
validate PACKAGE_POWER_SKU as well. But PACKAGE_POWER_SKU is legacy
register and on some platforms it may not be valid but
REG_PKG_RAPL_LIMIT will be valid. In that case it doesn't make sense to
block power1_max attribute. So please feel free to drop
xe_hwmon_process_reg.
Regards,
Badal
>
> Lucas De Marchi
next prev parent reply other threads:[~2024-05-10 6:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 13:01 [PATCH v7 0/4] drm/xe/hwmon: Update xe hwmon with couple of fixes Karthik Poosa
2024-04-05 13:01 ` [PATCH v7 1/4] drm/xe: Define xe_reg_is_valid Karthik Poosa
2024-04-05 13:01 ` [PATCH v7 2/4] drm/xe/hwmon: Update xe_hwmon_get_reg to return struct xe_reg Karthik Poosa
2024-04-09 16:55 ` Lucas De Marchi
2024-04-05 13:01 ` [PATCH v7 3/4] drm/xe/hwmon: Update xe_hwmon_process_reg Karthik Poosa
2024-04-09 17:52 ` Lucas De Marchi
2024-04-09 18:52 ` Rodrigo Vivi
2024-04-14 14:24 ` Poosa, Karthik
2024-04-18 13:14 ` Lucas De Marchi
2024-04-24 8:16 ` Nilawar, Badal
2024-04-24 11:40 ` Lucas De Marchi
2024-05-10 6:14 ` Nilawar, Badal [this message]
2024-04-05 13:01 ` [PATCH v7 4/4] drm/xe/hwmon: Cast result to output precision on left shift of operand Karthik Poosa
2024-04-05 14:20 ` ✓ CI.Patch_applied: success for drm/xe/hwmon: Update xe hwmon with couple of fixes (rev7) Patchwork
2024-04-05 14:20 ` ✗ CI.checkpatch: warning " Patchwork
2024-04-05 14:21 ` ✓ CI.KUnit: success " Patchwork
2024-04-05 14:32 ` ✓ CI.Build: " Patchwork
2024-04-05 14:35 ` ✓ CI.Hooks: " Patchwork
2024-04-05 14:36 ` ✓ CI.checksparse: " Patchwork
2024-04-05 14:57 ` ✓ CI.BAT: " Patchwork
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=2ffd302c-db00-4547-b272-4592ea2445b9@intel.com \
--to=badal.nilawar@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=karthik.poosa@intel.com \
--cc=lucas.demarchi@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox