aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2009-01-09 03:37:48 -0500
committerLen Brown <len.brown@intel.com>2009-01-09 03:37:48 -0500
commitd0302bc62af7983040ea1cd1b5dd2b36e1a6a509 (patch)
treeef45618ae057e21fff7c82190939fe5f4466cf06
parent106ad8d6b0a7c1a597fab56ec692c39f553fabbc (diff)
parent237889bf0a62f1399fb2ba0c2a259e6a96597131 (diff)
Merge branch 'misc' into release
Conflicts: include/acpi/acpixf.h Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--Documentation/kernel-parameters.txt1
-rw-r--r--arch/ia64/kernel/acpi.c1
-rw-r--r--arch/x86/kernel/acpi/boot.c6
-rw-r--r--arch/x86/kernel/acpi/cstate.c4
-rw-r--r--drivers/acpi/acpica/tbutils.c3
-rw-r--r--drivers/acpi/pci_link.c4
-rw-r--r--drivers/acpi/video.c5
-rw-r--r--drivers/cpuidle/governors/menu.c10
-rw-r--r--include/acpi/acpixf.h1
9 files changed, 27 insertions, 8 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index c9115c1b672c..136f02842de9 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -139,6 +139,7 @@ and is between 256 and 4096 characters. It is defined in the file
139 ht -- run only enough ACPI to enable Hyper Threading 139 ht -- run only enough ACPI to enable Hyper Threading
140 strict -- Be less tolerant of platforms that are not 140 strict -- Be less tolerant of platforms that are not
141 strictly ACPI specification compliant. 141 strictly ACPI specification compliant.
142 rsdt -- prefer RSDT over (default) XSDT
142 143
143 See also Documentation/power/pm.txt, pci=noacpi 144 See also Documentation/power/pm.txt, pci=noacpi
144 145
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index bd7acc71e8a9..c19b686db9b8 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -65,6 +65,7 @@ EXPORT_SYMBOL(pm_idle);
65void (*pm_power_off) (void); 65void (*pm_power_off) (void);
66EXPORT_SYMBOL(pm_power_off); 66EXPORT_SYMBOL(pm_power_off);
67 67
68u32 acpi_rsdt_forced;
68unsigned int acpi_cpei_override; 69unsigned int acpi_cpei_override;
69unsigned int acpi_cpei_phys_cpuid; 70unsigned int acpi_cpei_phys_cpuid;
70 71
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index de8ce79dd881..39ae3d0e3a4a 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -47,7 +47,7 @@
47#endif 47#endif
48 48
49static int __initdata acpi_force = 0; 49static int __initdata acpi_force = 0;
50 50u32 acpi_rsdt_forced;
51#ifdef CONFIG_ACPI 51#ifdef CONFIG_ACPI
52int acpi_disabled = 0; 52int acpi_disabled = 0;
53#else 53#else
@@ -1794,6 +1794,10 @@ static int __init parse_acpi(char *arg)
1794 disable_acpi(); 1794 disable_acpi();
1795 acpi_ht = 1; 1795 acpi_ht = 1;
1796 } 1796 }
1797 /* acpi=rsdt use RSDT instead of XSDT */
1798 else if (strcmp(arg, "rsdt") == 0) {
1799 acpi_rsdt_forced = 1;
1800 }
1797 /* "acpi=noirq" disables ACPI interrupt routing */ 1801 /* "acpi=noirq" disables ACPI interrupt routing */
1798 else if (strcmp(arg, "noirq") == 0) { 1802 else if (strcmp(arg, "noirq") == 0) {
1799 acpi_noirq_set(); 1803 acpi_noirq_set();
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index c2502eb9aa83..a4805b3b4095 100644
--- a/arch/x86/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
@@ -56,6 +56,7 @@ static struct cstate_entry *cpu_cstate_entry; /* per CPU ptr */
56static short mwait_supported[ACPI_PROCESSOR_MAX_POWER]; 56static short mwait_supported[ACPI_PROCESSOR_MAX_POWER];
57 57
58#define MWAIT_SUBSTATE_MASK (0xf) 58#define MWAIT_SUBSTATE_MASK (0xf)
59#define MWAIT_CSTATE_MASK (0xf)
59#define MWAIT_SUBSTATE_SIZE (4) 60#define MWAIT_SUBSTATE_SIZE (4)
60 61
61#define CPUID_MWAIT_LEAF (5) 62#define CPUID_MWAIT_LEAF (5)
@@ -98,7 +99,8 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
98 cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx); 99 cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx);
99 100
100 /* Check whether this particular cx_type (in CST) is supported or not */ 101 /* Check whether this particular cx_type (in CST) is supported or not */
101 cstate_type = (cx->address >> MWAIT_SUBSTATE_SIZE) + 1; 102 cstate_type = ((cx->address >> MWAIT_SUBSTATE_SIZE) &
103 MWAIT_CSTATE_MASK) + 1;
102 edx_part = edx >> (cstate_type * MWAIT_SUBSTATE_SIZE); 104 edx_part = edx >> (cstate_type * MWAIT_SUBSTATE_SIZE);
103 num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK; 105 num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK;
104 106
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 3a8d8d2eee92..9684cc827930 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -445,7 +445,8 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags)
445 445
446 /* Differentiate between RSDT and XSDT root tables */ 446 /* Differentiate between RSDT and XSDT root tables */
447 447
448 if (rsdp->revision > 1 && rsdp->xsdt_physical_address) { 448 if (rsdp->revision > 1 && rsdp->xsdt_physical_address
449 && !acpi_rsdt_forced) {
449 /* 450 /*
450 * Root table is an XSDT (64-bit physical addresses). We must use the 451 * Root table is an XSDT (64-bit physical addresses). We must use the
451 * XSDT if the revision is > 1 and the XSDT pointer is present, as per 452 * XSDT if the revision is > 1 and the XSDT pointer is present, as per
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index 4869fa1b7892..1c6e73c7865e 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -796,10 +796,6 @@ static int irqrouter_resume(struct sys_device *dev)
796 struct list_head *node = NULL; 796 struct list_head *node = NULL;
797 struct acpi_pci_link *link = NULL; 797 struct acpi_pci_link *link = NULL;
798 798
799
800 /* Make sure SCI is enabled again (Apple firmware bug?) */
801 acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1);
802
803 list_for_each(node, &acpi_link.entries) { 799 list_for_each(node, &acpi_link.entries) {
804 link = list_entry(node, struct acpi_pci_link, node); 800 link = list_entry(node, struct acpi_pci_link, node);
805 if (!link) { 801 if (!link) {
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 38bf8b43fd19..f261737636da 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -482,6 +482,7 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
482 int status = AE_OK; 482 int status = AE_OK;
483 union acpi_object arg0 = { ACPI_TYPE_INTEGER }; 483 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
484 struct acpi_object_list args = { 1, &arg0 }; 484 struct acpi_object_list args = { 1, &arg0 };
485 int state;
485 486
486 487
487 arg0.integer.value = level; 488 arg0.integer.value = level;
@@ -490,6 +491,10 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
490 status = acpi_evaluate_object(device->dev->handle, "_BCM", 491 status = acpi_evaluate_object(device->dev->handle, "_BCM",
491 &args, NULL); 492 &args, NULL);
492 device->brightness->curr = level; 493 device->brightness->curr = level;
494 for (state = 2; state < device->brightness->count; state++)
495 if (level == device->brightness->levels[state])
496 device->backlight->props.brightness = state - 2;
497
493 return status; 498 return status;
494} 499}
495 500
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 8d7cf3f31450..f1df59f59a37 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -15,12 +15,14 @@
15#include <linux/tick.h> 15#include <linux/tick.h>
16 16
17#define BREAK_FUZZ 4 /* 4 us */ 17#define BREAK_FUZZ 4 /* 4 us */
18#define PRED_HISTORY_PCT 50
18 19
19struct menu_device { 20struct menu_device {
20 int last_state_idx; 21 int last_state_idx;
21 22
22 unsigned int expected_us; 23 unsigned int expected_us;
23 unsigned int predicted_us; 24 unsigned int predicted_us;
25 unsigned int current_predicted_us;
24 unsigned int last_measured_us; 26 unsigned int last_measured_us;
25 unsigned int elapsed_us; 27 unsigned int elapsed_us;
26}; 28};
@@ -47,6 +49,12 @@ static int menu_select(struct cpuidle_device *dev)
47 data->expected_us = 49 data->expected_us =
48 (u32) ktime_to_ns(tick_nohz_get_sleep_length()) / 1000; 50 (u32) ktime_to_ns(tick_nohz_get_sleep_length()) / 1000;
49 51
52 /* Recalculate predicted_us based on prediction_history_pct */
53 data->predicted_us *= PRED_HISTORY_PCT;
54 data->predicted_us += (100 - PRED_HISTORY_PCT) *
55 data->current_predicted_us;
56 data->predicted_us /= 100;
57
50 /* find the deepest idle state that satisfies our constraints */ 58 /* find the deepest idle state that satisfies our constraints */
51 for (i = CPUIDLE_DRIVER_STATE_START + 1; i < dev->state_count; i++) { 59 for (i = CPUIDLE_DRIVER_STATE_START + 1; i < dev->state_count; i++) {
52 struct cpuidle_state *s = &dev->states[i]; 60 struct cpuidle_state *s = &dev->states[i];
@@ -97,7 +105,7 @@ static void menu_reflect(struct cpuidle_device *dev)
97 measured_us = -1; 105 measured_us = -1;
98 106
99 /* Predict time until next break event */ 107 /* Predict time until next break event */
100 data->predicted_us = max(measured_us, data->last_measured_us); 108 data->current_predicted_us = max(measured_us, data->last_measured_us);
101 109
102 if (last_idle_us + BREAK_FUZZ < 110 if (last_idle_us + BREAK_FUZZ <
103 data->expected_us - target->exit_latency) { 111 data->expected_us - target->exit_latency) {
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 7c7074f20087..c8e8cf45830f 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -70,6 +70,7 @@ extern u32 acpi_gbl_trace_flags;
70extern u32 acpi_current_gpe_count; 70extern u32 acpi_current_gpe_count;
71extern struct acpi_table_fadt acpi_gbl_FADT; 71extern struct acpi_table_fadt acpi_gbl_FADT;
72 72
73extern u32 acpi_rsdt_forced;
73/* 74/*
74 * Global interfaces 75 * Global interfaces
75 */ 76 */