From: Greg Kroah-Hartman Date: Tue, 3 Feb 2009 23:30:30 +0000 (-0800) Subject: .28 patches X-Git-Tag: v2.6.28.3~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1d3047e2aaa8459b12366229ecb61fd822c03899;p=thirdparty%2Fkernel%2Fstable-queue.git .28 patches --- diff --git a/queue-2.6.28/acpi-avoid-array-address-overflow-when-_cst-mwait-hint-bits-are-set.patch b/queue-2.6.28/acpi-avoid-array-address-overflow-when-_cst-mwait-hint-bits-are-set.patch new file mode 100644 index 00000000000..6d6a9efc921 --- /dev/null +++ b/queue-2.6.28/acpi-avoid-array-address-overflow-when-_cst-mwait-hint-bits-are-set.patch @@ -0,0 +1,63 @@ +From 13b40a1a065824d2d4e55c8b48ea9f3f9d162929 Mon Sep 17 00:00:00 2001 +From: Zhao Yakui +Date: Sun, 4 Jan 2009 12:04:21 +0800 +Subject: ACPI: Avoid array address overflow when _CST MWAIT hint bits are set + +From: Zhao Yakui + +commit 13b40a1a065824d2d4e55c8b48ea9f3f9d162929 upstream. + +The Cx Register address obtained from the _CST object is used as the MWAIT +hints if the register type is FFixedHW. And it is used to check whether +the Cx type is supported or not. + +On some boxes the following Cx state package is obtained from _CST object: + >{ + ResourceTemplate () + { + Register (FFixedHW, + 0x01, // Bit Width + 0x02, // Bit Offset + 0x0000000000889759, // Address + 0x03, // Access Size + ) + }, + + 0x03, + 0xF5, + 0x015E } + + In such case we should use the bit[7:4] of Cx address to check whether +the Cx type is supported or not. + +mask the MWAIT hint to avoid array address overflow + +Signed-off-by: Zhao Yakui +Acked-by:Venki Pallipadi +Signed-off-by: Len Brown +Cc: Thomas Renninger + +--- + arch/x86/kernel/acpi/cstate.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/arch/x86/kernel/acpi/cstate.c ++++ b/arch/x86/kernel/acpi/cstate.c +@@ -56,6 +56,7 @@ static struct cstate_entry *cpu_cstate_e + static short mwait_supported[ACPI_PROCESSOR_MAX_POWER]; + + #define MWAIT_SUBSTATE_MASK (0xf) ++#define MWAIT_CSTATE_MASK (0xf) + #define MWAIT_SUBSTATE_SIZE (4) + + #define CPUID_MWAIT_LEAF (5) +@@ -98,7 +99,8 @@ int acpi_processor_ffh_cstate_probe(unsi + cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx); + + /* Check whether this particular cx_type (in CST) is supported or not */ +- cstate_type = (cx->address >> MWAIT_SUBSTATE_SIZE) + 1; ++ cstate_type = ((cx->address >> MWAIT_SUBSTATE_SIZE) & ++ MWAIT_CSTATE_MASK) + 1; + edx_part = edx >> (cstate_type * MWAIT_SUBSTATE_SIZE); + num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK; + diff --git a/queue-2.6.28/acpi-do-not-modify-sci_en-directly.patch b/queue-2.6.28/acpi-do-not-modify-sci_en-directly.patch new file mode 100644 index 00000000000..67ec40fffd3 --- /dev/null +++ b/queue-2.6.28/acpi-do-not-modify-sci_en-directly.patch @@ -0,0 +1,39 @@ +From 11e93130c7ce5228d484fd5e86f3984835d4256b Mon Sep 17 00:00:00 2001 +From: Rafael J. Wysocki +Date: Mon, 29 Dec 2008 19:19:07 +0100 +Subject: ACPI: Do not modify SCI_EN directly + +From: Rafael J. Wysocki + +commit 11e93130c7ce5228d484fd5e86f3984835d4256b upstream. + +According to the ACPI specification the SCI_EN flag is controlled by +the hardware, which sets this flag to inform the kernel that ACPI is +enabled. For this reason, we shouldn't try to modify SCI_EN +directly. Also, we don't need to do it in irqrouter_resume(), since +lower-level resume code takes care of enabling ACPI in case it hasn't +been enabled by the BIOS before passing control to the kernel (which +by the way is against the ACPI specification). + +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/pci_link.c | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/drivers/acpi/pci_link.c ++++ b/drivers/acpi/pci_link.c +@@ -796,10 +796,6 @@ static int irqrouter_resume(struct sys_d + struct list_head *node = NULL; + struct acpi_pci_link *link = NULL; + +- +- /* Make sure SCI is enabled again (Apple firmware bug?) */ +- acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1); +- + list_for_each(node, &acpi_link.entries) { + link = list_entry(node, struct acpi_pci_link, node); + if (!link) { diff --git a/queue-2.6.28/cpuidle-add-decaying-history-logic-to-menu-idle-predictor.patch b/queue-2.6.28/cpuidle-add-decaying-history-logic-to-menu-idle-predictor.patch new file mode 100644 index 00000000000..5e96d67f530 --- /dev/null +++ b/queue-2.6.28/cpuidle-add-decaying-history-logic-to-menu-idle-predictor.patch @@ -0,0 +1,69 @@ +From trenn@suse.de Tue Feb 3 14:59:11 2009 +From: Venkatesh Pallipadi +Date: Tue, 27 Jan 2009 17:38:46 +0100 +Subject: cpuidle: Add decaying history logic to menu idle predictor +To: stable@kernel.org +Cc: Len Brown , "Pallipadi, Venkatesh" +Message-ID: <1233074343-23414-5-git-send-email-trenn@suse.de> + + +From: Venkatesh Pallipadi + +commit 816bb611e41be29b476dc16f6297eb551bf4d747 upstream + +Add decaying history of predicted idle time, instead of using the last early +wakeup. This logic helps menu governor do better job of predicting idle time. + +With this change, we also measured noticable (~8%) power savings on +a DP server system with CPUs supporting deep C states, when system +was lightly loaded. There was no change to power or perf on other load +conditions. + +Signed-off-by: Venkatesh Pallipadi +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/cpuidle/governors/menu.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/cpuidle/governors/menu.c ++++ b/drivers/cpuidle/governors/menu.c +@@ -15,12 +15,14 @@ + #include + + #define BREAK_FUZZ 4 /* 4 us */ ++#define PRED_HISTORY_PCT 50 + + struct menu_device { + int last_state_idx; + + unsigned int expected_us; + unsigned int predicted_us; ++ unsigned int current_predicted_us; + unsigned int last_measured_us; + unsigned int elapsed_us; + }; +@@ -47,6 +49,12 @@ static int menu_select(struct cpuidle_de + data->expected_us = + (u32) ktime_to_ns(tick_nohz_get_sleep_length()) / 1000; + ++ /* Recalculate predicted_us based on prediction_history_pct */ ++ data->predicted_us *= PRED_HISTORY_PCT; ++ data->predicted_us += (100 - PRED_HISTORY_PCT) * ++ data->current_predicted_us; ++ data->predicted_us /= 100; ++ + /* find the deepest idle state that satisfies our constraints */ + for (i = CPUIDLE_DRIVER_STATE_START + 1; i < dev->state_count; i++) { + struct cpuidle_state *s = &dev->states[i]; +@@ -97,7 +105,7 @@ static void menu_reflect(struct cpuidle_ + measured_us = -1; + + /* Predict time until next break event */ +- data->predicted_us = max(measured_us, data->last_measured_us); ++ data->current_predicted_us = max(measured_us, data->last_measured_us); + + if (last_idle_us + BREAK_FUZZ < + data->expected_us - target->exit_latency) { diff --git a/queue-2.6.28/newly-inserted-battery-might-differ-from-one-just-removed-so.patch b/queue-2.6.28/newly-inserted-battery-might-differ-from-one-just-removed-so.patch new file mode 100644 index 00000000000..bb6d2cb1069 --- /dev/null +++ b/queue-2.6.28/newly-inserted-battery-might-differ-from-one-just-removed-so.patch @@ -0,0 +1,43 @@ +From 50b178512b7d6e7724f87459f6bd06504c9c2da1 Mon Sep 17 00:00:00 2001 +From: Alexey Starikovskiy +Date: Tue, 23 Dec 2008 02:44:54 +0300 +Subject: Newly inserted battery might differ from one just removed, so + update of battery info fields is required. + +From: Alexey Starikovskiy + +commit 50b178512b7d6e7724f87459f6bd06504c9c2da1 upstream. + +Signed-off-by: Alexey Starikovskiy +Acked-by: Andy Neitzke + +Signed-off-by: Alexey Starikovskiy suse.de> +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/battery.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/acpi/battery.c ++++ b/drivers/acpi/battery.c +@@ -471,7 +471,7 @@ static void sysfs_remove_battery(struct + + static int acpi_battery_update(struct acpi_battery *battery) + { +- int result; ++ int result, old_present = acpi_battery_present(battery); + result = acpi_battery_get_status(battery); + if (result) + return result; +@@ -482,7 +482,8 @@ static int acpi_battery_update(struct ac + return 0; + } + #endif +- if (!battery->update_time) { ++ if (!battery->update_time || ++ old_present != acpi_battery_present(battery)) { + result = acpi_battery_get_info(battery); + if (result) + return result; diff --git a/queue-2.6.28/series b/queue-2.6.28/series index 2d41a5ba642..f358b91f735 100644 --- a/queue-2.6.28/series +++ b/queue-2.6.28/series @@ -21,3 +21,8 @@ p54-fix-p54_read_eeprom-to-cope-with-tx_hdr_len.patch p54usb-rewriting-rx-tx-routines-to-make-use-of-usb_anchor-s-facilities.patch minstrel-fix-warning-if-lowest-supported-rate-index-is-not-0.patch pci-irq-and-pci_ids-patch-for-intel-tigerpoint-deviceids.patch +cpuidle-add-decaying-history-logic-to-menu-idle-predictor.patch +acpi-avoid-array-address-overflow-when-_cst-mwait-hint-bits-are-set.patch +video-always-update-the-brightness-when-poking-brightness.patch +newly-inserted-battery-might-differ-from-one-just-removed-so.patch +acpi-do-not-modify-sci_en-directly.patch diff --git a/queue-2.6.28/video-always-update-the-brightness-when-poking-brightness.patch b/queue-2.6.28/video-always-update-the-brightness-when-poking-brightness.patch new file mode 100644 index 00000000000..8a1d3bf0008 --- /dev/null +++ b/queue-2.6.28/video-always-update-the-brightness-when-poking-brightness.patch @@ -0,0 +1,43 @@ +From 9e6dada9d255497127251c03aaa59296d186f959 Mon Sep 17 00:00:00 2001 +From: Zhang Rui +Date: Wed, 31 Dec 2008 10:58:48 +0800 +Subject: video: always update the brightness when poking "brightness" + +From: Zhang Rui + +commit 9e6dada9d255497127251c03aaa59296d186f959 upstream. + +always update props.brightness no matter the backlight is changed +via procfs, hotkeys or sysfs. + +Sighed-off-by: Zhang Rui +Acked-by: Matthew Garrett +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/video.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -481,6 +481,7 @@ acpi_video_device_lcd_set_level(struct a + int status = AE_OK; + union acpi_object arg0 = { ACPI_TYPE_INTEGER }; + struct acpi_object_list args = { 1, &arg0 }; ++ int state; + + + arg0.integer.value = level; +@@ -489,6 +490,10 @@ acpi_video_device_lcd_set_level(struct a + status = acpi_evaluate_object(device->dev->handle, "_BCM", + &args, NULL); + device->brightness->curr = level; ++ for (state = 2; state < device->brightness->count; state++) ++ if (level == device->brightness->levels[state]) ++ device->backlight->props.brightness = state - 2; ++ + return status; + } +