[PATCH 33/33] Revert "ACPI throttling: Use this_cpu_has and simplify code"

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

 



From: Len Brown <len.brown@xxxxxxxxx>

This reverts commit 630c6a2603a844b3771f007224e22db8cc16a038.

b/c the build isn't ready for it yet:

drivers/acpi/processor_throttling.c: In function
âacpi_throttling_rdmsrâ:
drivers/acpi/processor_throttling.c:672: error: implicit declaration of
function âthis_cpu_hasâ
---
 drivers/acpi/processor_throttling.c |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 2e773d9..ff36327 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -662,14 +662,20 @@ static int acpi_processor_get_throttling_fadt(struct acpi_processor *pr)
 }
 
 #ifdef CONFIG_X86
-static int acpi_throttling_rdmsr(u64 *value)
+static int acpi_throttling_rdmsr(struct acpi_processor *pr,
+					u64 *value)
 {
+	struct cpuinfo_x86 *c;
 	u64 msr_high, msr_low;
+	unsigned int cpu;
 	u64 msr = 0;
 	int ret = -1;
 
-	if ((this_cpu_read(cpu_info.x86_vendor) != X86_VENDOR_INTEL) ||
-		!this_cpu_has(X86_FEATURE_ACPI)) {
+	cpu = pr->id;
+	c = &cpu_data(cpu);
+
+	if ((c->x86_vendor != X86_VENDOR_INTEL) ||
+		!cpu_has(c, X86_FEATURE_ACPI)) {
 		printk(KERN_ERR PREFIX
 			"HARDWARE addr space,NOT supported yet\n");
 	} else {
@@ -684,13 +690,18 @@ static int acpi_throttling_rdmsr(u64 *value)
 	return ret;
 }
 
-static int acpi_throttling_wrmsr(u64 value)
+static int acpi_throttling_wrmsr(struct acpi_processor *pr, u64 value)
 {
+	struct cpuinfo_x86 *c;
+	unsigned int cpu;
 	int ret = -1;
 	u64 msr;
 
-	if ((this_cpu_read(cpu_info.x86_vendor) != X86_VENDOR_INTEL) ||
-		!this_cpu_has(X86_FEATURE_ACPI)) {
+	cpu = pr->id;
+	c = &cpu_data(cpu);
+
+	if ((c->x86_vendor != X86_VENDOR_INTEL) ||
+		!cpu_has(c, X86_FEATURE_ACPI)) {
 		printk(KERN_ERR PREFIX
 			"HARDWARE addr space,NOT supported yet\n");
 	} else {
@@ -702,14 +713,15 @@ static int acpi_throttling_wrmsr(u64 value)
 	return ret;
 }
 #else
-static int acpi_throttling_rdmsr(u64 *value)
+static int acpi_throttling_rdmsr(struct acpi_processor *pr,
+				u64 *value)
 {
 	printk(KERN_ERR PREFIX
 		"HARDWARE addr space,NOT supported yet\n");
 	return -1;
 }
 
-static int acpi_throttling_wrmsr(u64 value)
+static int acpi_throttling_wrmsr(struct acpi_processor *pr, u64 value)
 {
 	printk(KERN_ERR PREFIX
 		"HARDWARE addr space,NOT supported yet\n");
@@ -741,7 +753,7 @@ static int acpi_read_throttling_status(struct acpi_processor *pr,
 		ret = 0;
 		break;
 	case ACPI_ADR_SPACE_FIXED_HARDWARE:
-		ret = acpi_throttling_rdmsr(value);
+		ret = acpi_throttling_rdmsr(pr, value);
 		break;
 	default:
 		printk(KERN_ERR PREFIX "Unknown addr space %d\n",
@@ -774,7 +786,7 @@ static int acpi_write_throttling_state(struct acpi_processor *pr,
 		ret = 0;
 		break;
 	case ACPI_ADR_SPACE_FIXED_HARDWARE:
-		ret = acpi_throttling_wrmsr(value);
+		ret = acpi_throttling_wrmsr(pr, value);
 		break;
 	default:
 		printk(KERN_ERR PREFIX "Unknown addr space %d\n",
-- 
1.7.3.3.557.gb5c17

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux