]> git.itanic.dy.fi Git - linux-stable/commit
ACPI: CPPC: Fix access width used for PCC registers
authorVanshidhar Konda <vanshikonda@os.amperecomputing.com>
Thu, 11 Apr 2024 23:18:44 +0000 (16:18 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 22 Apr 2024 16:58:46 +0000 (18:58 +0200)
commitf489c948028b69cea235d9c0de1cc10eeb26a172
treec365fe59c641ff335cee4907edf8eccb4bd6916f
parent05d92ee782eeb7b939bdd0189e6efcab9195bf95
ACPI: CPPC: Fix access width used for PCC registers

commit 2f4a4d63a193 ("ACPI: CPPC: Use access_width over bit_width for system
memory accesses") modified cpc_read()/cpc_write() to use access_width to
read CPC registers.

However, for PCC registers the access width field in the ACPI register
macro specifies the PCC subspace ID.  For non-zero PCC subspace ID it is
incorrectly treated as access width. This causes errors when reading
from PCC registers in the CPPC driver.

For PCC registers, base the size of read/write on the bit width field.
The debug message in cpc_read()/cpc_write() is updated to print relevant
information for the address space type used to read the register.

Fixes: 2f4a4d63a193 ("ACPI: CPPC: Use access_width over bit_width for system memory accesses")
Signed-off-by: Vanshidhar Konda <vanshikonda@os.amperecomputing.com>
Tested-by: Jarred White <jarredwhite@linux.microsoft.com>
Reviewed-by: Jarred White <jarredwhite@linux.microsoft.com>
Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Cc: 5.15+ <stable@vger.kernel.org> # 5.15+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/cppc_acpi.c