[PATCH v7 3/4] drm/xe/hwmon: Update xe_hwmon_process_reg

Lucas De Marchi lucas.demarchi at intel.com
Wed Apr 24 11:40:33 UTC 2024


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.

Lucas De Marchi


More information about the Intel-xe mailing list