OpenCloudOS-Kernel/include
Clément Léger 8ad28208be ACPI: CPPC: Fix MASK_VAL() usage
[ Upstream commit 60949b7b805424f21326b450ca4f1806c06d982e ]

MASK_VAL() was added as a way to handle bit_offset and bit_width for
registers located in system memory address space. However, while suited
for reading, it does not work for writing and result in corrupted
registers when writing values with bit_offset > 0. Moreover, when a
register is collocated with another one at the same address but with a
different mask, the current code results in the other registers being
overwritten with 0s. The write procedure for SYSTEM_MEMORY registers
should actually read the value, mask it, update it and write it with the
updated value. Moreover, since registers can be located in the same
word, we must take care of locking the access before doing it. We should
potentially use a global lock since we don't know in if register
addresses aren't shared with another _CPC package but better not
encourage vendors to do so. Assume that registers can use the same word
inside a _CPC package and thus, use a per _CPC package lock.

Fixes: 2f4a4d63a193 ("ACPI: CPPC: Use access_width over bit_width for system memory accesses")
Signed-off-by: Clément Léger <cleger@rivosinc.com>
Link: https://patch.msgid.link/20240826101648.95654-1-cleger@rivosinc.com
[ rjw: Dropped redundant semicolon ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-10-04 16:28:53 +02:00
..
acpi ACPI: CPPC: Fix MASK_VAL() usage 2024-10-04 16:28:53 +02:00
asm-generic vmlinux.lds.h: catch .bss..L* sections into BSS") 2024-08-03 08:53:35 +02:00
clocksource pwm: xilinx: Fix u32 overflow issue in 32-bit width PWM mode. 2024-09-08 07:54:44 +02:00
crypto crypto: af_alg - Disallow multiple in-flight AIO requests 2024-01-25 15:35:16 -08:00
drm accel: Use XArray instead of IDR for minors 2024-09-30 16:25:13 +02:00
dt-bindings clk: renesas: r8a779g0: Correct PFC/GPIO parent clocks 2024-03-26 18:19:47 -04:00
keys
kunit - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
kvm KVM: arm64: Fix host-programmed guest events in nVHE 2024-04-10 16:35:48 +02:00
linux net/mlx5: Correct TASR typo into TSAR 2024-09-18 19:24:08 +02:00
math-emu
media media: cec: core: avoid recursive cec_claim_log_addrs 2024-06-12 11:12:43 +02:00
memory
misc
net wifi: mac80211: don't use rate mask for offchannel TX either 2024-10-04 16:28:52 +02:00
pcmcia
ras
rdma RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz 2023-12-13 18:45:16 +01:00
rv rv: Set variable 'da_mon_##name' to static 2023-09-01 21:00:00 -04:00
scsi scsi: core: Fix the return value of scsi_logical_block_count() 2024-08-29 17:33:52 +02:00
soc net: mscc: ocelot: serialize access to the injection/extraction groups 2024-08-29 17:33:45 +02:00
sound ALSA: ump: Transmit RPN/NRPN message at each MSB/LSB data reception 2024-09-08 07:54:30 +02:00
target
trace platform/x86/intel/ifs: Gen2 Scan test support 2024-08-14 13:58:37 +02:00
uapi drm/amdgpu: handle gfx12 in amdgpu_display_verify_sizes 2024-09-12 11:11:43 +02:00
ufs scsi: ufs: core: Check LSDBS cap when !mcq 2024-09-08 07:54:29 +02:00
vdso
video fbdev: stifb: Make the STI next font pointer a 32-bit signed offset 2023-11-28 17:19:58 +00:00
xen xen/events: reduce externally visible helper functions 2024-03-01 13:34:57 +01:00