diff options
Diffstat (limited to 'arch/x86/kernel')
| -rw-r--r-- | arch/x86/kernel/acpi/Makefile | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/acpi/processor.c | 101 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 4 |
3 files changed, 4 insertions, 103 deletions
diff --git a/arch/x86/kernel/acpi/Makefile b/arch/x86/kernel/acpi/Makefile index fd5ca97a2ad5..6f35260bb3ef 100644 --- a/arch/x86/kernel/acpi/Makefile +++ b/arch/x86/kernel/acpi/Makefile | |||
| @@ -4,7 +4,7 @@ obj-$(CONFIG_ACPI) += boot.o | |||
| 4 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup_rm.o wakeup_$(BITS).o | 4 | obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup_rm.o wakeup_$(BITS).o |
| 5 | 5 | ||
| 6 | ifneq ($(CONFIG_ACPI_PROCESSOR),) | 6 | ifneq ($(CONFIG_ACPI_PROCESSOR),) |
| 7 | obj-y += cstate.o processor.o | 7 | obj-y += cstate.o |
| 8 | endif | 8 | endif |
| 9 | 9 | ||
| 10 | $(obj)/wakeup_rm.o: $(obj)/realmode/wakeup.bin | 10 | $(obj)/wakeup_rm.o: $(obj)/realmode/wakeup.bin |
diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c deleted file mode 100644 index d85d1b2432ba..000000000000 --- a/arch/x86/kernel/acpi/processor.c +++ /dev/null | |||
| @@ -1,101 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005 Intel Corporation | ||
| 3 | * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> | ||
| 4 | * - Added _PDC for platforms with Intel CPUs | ||
| 5 | */ | ||
| 6 | |||
| 7 | #include <linux/kernel.h> | ||
| 8 | #include <linux/module.h> | ||
| 9 | #include <linux/init.h> | ||
| 10 | #include <linux/acpi.h> | ||
| 11 | |||
| 12 | #include <acpi/processor.h> | ||
| 13 | #include <asm/acpi.h> | ||
| 14 | |||
| 15 | static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c) | ||
| 16 | { | ||
| 17 | struct acpi_object_list *obj_list; | ||
| 18 | union acpi_object *obj; | ||
| 19 | u32 *buf; | ||
| 20 | |||
| 21 | /* allocate and initialize pdc. It will be used later. */ | ||
| 22 | obj_list = kmalloc(sizeof(struct acpi_object_list), GFP_KERNEL); | ||
| 23 | if (!obj_list) { | ||
| 24 | printk(KERN_ERR "Memory allocation error\n"); | ||
| 25 | return; | ||
| 26 | } | ||
| 27 | |||
| 28 | obj = kmalloc(sizeof(union acpi_object), GFP_KERNEL); | ||
| 29 | if (!obj) { | ||
| 30 | printk(KERN_ERR "Memory allocation error\n"); | ||
| 31 | kfree(obj_list); | ||
| 32 | return; | ||
| 33 | } | ||
| 34 | |||
| 35 | buf = kmalloc(12, GFP_KERNEL); | ||
| 36 | if (!buf) { | ||
| 37 | printk(KERN_ERR "Memory allocation error\n"); | ||
| 38 | kfree(obj); | ||
| 39 | kfree(obj_list); | ||
| 40 | return; | ||
| 41 | } | ||
| 42 | |||
| 43 | buf[0] = ACPI_PDC_REVISION_ID; | ||
| 44 | buf[1] = 1; | ||
| 45 | buf[2] = ACPI_PDC_C_CAPABILITY_SMP; | ||
| 46 | |||
| 47 | /* | ||
| 48 | * The default of PDC_SMP_T_SWCOORD bit is set for intel x86 cpu so | ||
| 49 | * that OSPM is capable of native ACPI throttling software | ||
| 50 | * coordination using BIOS supplied _TSD info. | ||
| 51 | */ | ||
| 52 | buf[2] |= ACPI_PDC_SMP_T_SWCOORD; | ||
| 53 | if (cpu_has(c, X86_FEATURE_EST)) | ||
| 54 | buf[2] |= ACPI_PDC_EST_CAPABILITY_SWSMP; | ||
| 55 | |||
| 56 | if (cpu_has(c, X86_FEATURE_ACPI)) | ||
| 57 | buf[2] |= ACPI_PDC_T_FFH; | ||
| 58 | |||
| 59 | /* | ||
| 60 | * If mwait/monitor is unsupported, C2/C3_FFH will be disabled | ||
| 61 | */ | ||
| 62 | if (!cpu_has(c, X86_FEATURE_MWAIT)) | ||
| 63 | buf[2] &= ~(ACPI_PDC_C_C2C3_FFH); | ||
| 64 | |||
| 65 | obj->type = ACPI_TYPE_BUFFER; | ||
| 66 | obj->buffer.length = 12; | ||
| 67 | obj->buffer.pointer = (u8 *) buf; | ||
| 68 | obj_list->count = 1; | ||
| 69 | obj_list->pointer = obj; | ||
| 70 | pr->pdc = obj_list; | ||
| 71 | |||
| 72 | return; | ||
| 73 | } | ||
| 74 | |||
| 75 | |||
| 76 | /* Initialize _PDC data based on the CPU vendor */ | ||
| 77 | void arch_acpi_processor_init_pdc(struct acpi_processor *pr) | ||
| 78 | { | ||
| 79 | struct cpuinfo_x86 *c = &cpu_data(pr->id); | ||
| 80 | |||
| 81 | pr->pdc = NULL; | ||
| 82 | if (c->x86_vendor == X86_VENDOR_INTEL || | ||
| 83 | c->x86_vendor == X86_VENDOR_CENTAUR) | ||
| 84 | init_intel_pdc(pr, c); | ||
| 85 | |||
| 86 | return; | ||
| 87 | } | ||
| 88 | |||
| 89 | EXPORT_SYMBOL(arch_acpi_processor_init_pdc); | ||
| 90 | |||
| 91 | void arch_acpi_processor_cleanup_pdc(struct acpi_processor *pr) | ||
| 92 | { | ||
| 93 | if (pr->pdc) { | ||
| 94 | kfree(pr->pdc->pointer->buffer.pointer); | ||
| 95 | kfree(pr->pdc->pointer); | ||
| 96 | kfree(pr->pdc); | ||
| 97 | pr->pdc = NULL; | ||
| 98 | } | ||
| 99 | } | ||
| 100 | |||
| 101 | EXPORT_SYMBOL(arch_acpi_processor_cleanup_pdc); | ||
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index f28decf8dde3..1b1920fa7c80 100644 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | |||
| @@ -190,9 +190,11 @@ static void do_drv_write(void *_cmd) | |||
| 190 | 190 | ||
| 191 | static void drv_read(struct drv_cmd *cmd) | 191 | static void drv_read(struct drv_cmd *cmd) |
| 192 | { | 192 | { |
| 193 | int err; | ||
| 193 | cmd->val = 0; | 194 | cmd->val = 0; |
| 194 | 195 | ||
| 195 | smp_call_function_single(cpumask_any(cmd->mask), do_drv_read, cmd, 1); | 196 | err = smp_call_function_any(cmd->mask, do_drv_read, cmd, 1); |
| 197 | WARN_ON_ONCE(err); /* smp_call_function_any() was buggy? */ | ||
| 196 | } | 198 | } |
| 197 | 199 | ||
| 198 | static void drv_write(struct drv_cmd *cmd) | 200 | static void drv_write(struct drv_cmd *cmd) |
