Patch "Revert "ACPI: CPPC: Use access_width over bit_width for system memory accesses"" 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

    Revert "ACPI: CPPC: Use access_width over bit_width for system memory accesses"

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:
     revert-acpi-cppc-use-access_width-over-bit_width-for-system-memory-accesses.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.


>From 1a9210d55a6203deb3b8f946b3e5bac6880f9680 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 12 Apr 2024 10:23:42 +0200
Subject: Revert "ACPI: CPPC: Use access_width over bit_width for system memory accesses"

From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

This reverts commit 4949affd5288b867cdf115f5b08d6166b2027f87 which is
commit 2f4a4d63a193be6fd530d180bb13c3592052904c upstream.

It breaks AmpereOne systems and should not have been added to the stable
tree just yet.

Link: https://lore.kernel.org/r/97d25ef7-dee9-4cc5-842a-273f565869b3@xxxxxxxxxxxxxxxxxxx
Reported-by: Easwar Hariharan <eahariha@xxxxxxxxxxxxxxxxxxx>
Cc: Jarred White <jarredwhite@xxxxxxxxxxxxxxxxxxx>
Cc: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/acpi/cppc_acpi.c |   27 +++------------------------
 1 file changed, 3 insertions(+), 24 deletions(-)

--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -161,13 +161,6 @@ show_cppc_data(cppc_get_perf_caps, cppc_
 show_cppc_data(cppc_get_perf_ctrs, cppc_perf_fb_ctrs, reference_perf);
 show_cppc_data(cppc_get_perf_ctrs, cppc_perf_fb_ctrs, wraparound_time);
 
-/* Check for valid access_width, otherwise, fallback to using bit_width */
-#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)))
-
 static ssize_t show_feedback_ctrs(struct kobject *kobj,
 		struct kobj_attribute *attr, char *buf)
 {
@@ -769,10 +762,8 @@ int acpi_cppc_processor_probe(struct acp
 			} else if (gas_t->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
 				if (gas_t->address) {
 					void __iomem *addr;
-					size_t access_width;
 
-					access_width = GET_BIT_WIDTH(gas_t) / 8;
-					addr = ioremap(gas_t->address, access_width);
+					addr = ioremap(gas_t->address, gas_t->bit_width/8);
 					if (!addr)
 						goto out_free;
 					cpc_ptr->cpc_regs[i-2].sys_mem_vaddr = addr;
@@ -945,7 +936,6 @@ static int cpc_read(int cpu, struct cpc_
 {
 	int ret_val = 0;
 	void __iomem *vaddr = NULL;
-	int size;
 	int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu);
 	struct cpc_reg *reg = &reg_res->cpc_entry.reg;
 
@@ -965,9 +955,7 @@ static int cpc_read(int cpu, struct cpc_
 		return acpi_os_read_memory((acpi_physical_address)reg->address,
 				val, reg->bit_width);
 
-	size = GET_BIT_WIDTH(reg);
-
-	switch (size) {
+	switch (reg->bit_width) {
 	case 8:
 		*val = readb_relaxed(vaddr);
 		break;
@@ -986,16 +974,12 @@ static int cpc_read(int cpu, struct cpc_
 		ret_val = -EFAULT;
 	}
 
-	if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
-		*val = MASK_VAL(reg, *val);
-
 	return ret_val;
 }
 
 static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
 {
 	int ret_val = 0;
-	int size;
 	void __iomem *vaddr = NULL;
 	int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu);
 	struct cpc_reg *reg = &reg_res->cpc_entry.reg;
@@ -1010,12 +994,7 @@ static int cpc_write(int cpu, struct cpc
 		return acpi_os_write_memory((acpi_physical_address)reg->address,
 				val, reg->bit_width);
 
-	size = GET_BIT_WIDTH(reg);
-
-	if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
-		val = MASK_VAL(reg, val);
-
-	switch (size) {
+	switch (reg->bit_width) {
 	case 8:
 		writeb_relaxed(val, vaddr);
 		break;


Patches currently in stable-queue which might be from gregkh@xxxxxxxxxxxxxxxxxxx are

queue-5.15/revert-acpi-cppc-use-access_width-over-bit_width-for-system-memory-accesses.patch
queue-5.15/usb-typec-tcpci-add-generic-tcpci-fallback-compatibl.patch
queue-5.15/bluetooth-btintel-fixe-build-regression.patch
queue-5.15/gcc-plugins-stackleak-ignore-.noinstr.text-and-.entry.text.patch
queue-5.15/usb-sl811-hcd-only-defined-function-checkdone-if-qui.patch
queue-5.15/net-dsa-fix-panic-when-dsa-master-device-unbinds-on-shutdown.patch
queue-5.15/x86-mm-pat-fix-vm_pat-handling-in-cow-mappings.patch
queue-5.15/vmci-fix-possible-memcpy-run-time-warning-in-vmci_datagram_invoke_guest_handler.patch
queue-5.15/virtio-reenable-config-if-freezing-device-failed.patch
queue-5.15/gcc-plugins-stackleak-avoid-.head.text-section.patch
queue-5.15/tty-n_gsm-require-cap_net_admin-to-attach-n_gsm0710-ldisc.patch




[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