powercap: RAPL: fix invalid initialization for pl4_supported field
authorSumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Thu, 8 Jun 2023 02:30:06 +0000 (08:00 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 12 Jun 2023 17:44:52 +0000 (19:44 +0200)
commitd05b5e0baf424c8c4b4709ac11f66ab726c8deaf
tree0682a5c972ff5ed1bb49333c12c7dd3a57a65b71
parent9eef7f9da928c54149199e7b3215b82c2d595ccd
powercap: RAPL: fix invalid initialization for pl4_supported field

The current initialization of the struct x86_cpu_id via
pl4_support_ids[] is partial and wrong. It is initializing
"stepping" field with "X86_FEATURE_ANY" instead of "feature" field.

Use X86_MATCH_INTEL_FAM6_MODEL macro instead of initializing
each field of the struct x86_cpu_id for pl4_supported list of CPUs.
This X86_MATCH_INTEL_FAM6_MODEL macro internally uses another macro
X86_MATCH_VENDOR_FAM_MODEL_FEATURE for X86 based CPU matching with
appropriate initialized values.

Reported-by: Dave Hansen <dave.hansen@intel.com>
Link: https://lore.kernel.org/lkml/28ead36b-2d9e-1a36-6f4e-04684e420260@intel.com
Fixes: eb52bc2ae5b8 ("powercap: RAPL: Add Power Limit4 support for Meteor Lake SoC")
Fixes: b08b95cf30f5 ("powercap: RAPL: Add Power Limit4 support for Alder Lake-N and Raptor Lake-P")
Fixes: 515755906921 ("powercap: RAPL: Add Power Limit4 support for RaptorLake")
Fixes: 1cc5b9a411e4 ("powercap: Add Power Limit4 support for Alder Lake SoC")
Fixes: 8365a898fe53 ("powercap: Add Power Limit4 support")
Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/powercap/intel_rapl_msr.c