Patch "ACPI: CPPC: Fix bit_offset shift in MASK_VAL() macro" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ACPI: CPPC: Fix bit_offset shift in MASK_VAL() macro

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     acpi-cppc-fix-bit_offset-shift-in-mask_val-macro.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 725de4f2dfd5637d19bd9f04cff11f24da241807
Author: Jarred White <jarredwhite@xxxxxxxxxxxxxxxxxxx>
Date:   Thu May 9 19:41:25 2024 +0000

    ACPI: CPPC: Fix bit_offset shift in MASK_VAL() macro
    
    commit 05d92ee782eeb7b939bdd0189e6efcab9195bf95 upstream
    
    Commit 2f4a4d63a193 ("ACPI: CPPC: Use access_width over bit_width for
    system memory accesses") neglected to properly wrap the bit_offset shift
    when it comes to applying the mask. This may cause incorrect values to be
    read and may cause the cpufreq module not be loaded.
    
    [   11.059751] cpu_capacity: CPU0 missing/invalid highest performance.
    [   11.066005] cpu_capacity: partial information: fallback to 1024 for all CPUs
    
    Also, corrected the bitmask generation in GENMASK (extra bit being added).
    
    Fixes: 2f4a4d63a193 ("ACPI: CPPC: Use access_width over bit_width for system memory accesses")
    Signed-off-by: Jarred White <jarredwhite@xxxxxxxxxxxxxxxxxxx>
    Cc: 5.15+ <stable@xxxxxxxxxxxxxxx> # 5.15+
    Reviewed-by: Vanshidhar Konda <vanshikonda@xxxxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Easwar Hariharan <eahariha@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 408b1fda5702d..6aa456cda0ed9 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -165,8 +165,8 @@ show_cppc_data(cppc_get_perf_ctrs, cppc_perf_fb_ctrs, wraparound_time);
 #define GET_BIT_WIDTH(reg) ((reg)->access_width ? (8 << ((reg)->access_width - 1)) : (reg)->bit_width)
 
 /* Shift and apply the mask for CPC reads/writes */
-#define MASK_VAL(reg, val) ((val) >> ((reg)->bit_offset & 			\
-					GENMASK(((reg)->bit_width), 0)))
+#define MASK_VAL(reg, val) (((val) >> (reg)->bit_offset) & 			\
+					GENMASK(((reg)->bit_width) - 1, 0))
 
 static ssize_t show_feedback_ctrs(struct kobject *kobj,
 		struct kobj_attribute *attr, char *buf)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux