From 7bcf71027349260717f036ab1c5df2241cbe857c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 3 Feb 2009 15:31:14 -0800 Subject: [PATCH] .27 patches --- ...the-acpi-handle-as-early-as-possible.patch | 55 + ...ow-when-_cst-mwait-hint-bits-are-set.patch | 63 + ...-to-support-64-bit-on-32-bit-kernels.patch | 1103 +++++++++++++++++ .../acpi-do-not-modify-sci_en-directly.patch | 39 + ...due-to-use-of-uninitialized-variable.patch | 49 + ...ced-by-32-to-64-bit-acpi-conversions.patch | 44 + ...00-workstation-for-old-code-ordering.patch | 44 + ...valid-handle-in-acpi_get_object_info.patch | 38 + ...e-descriptor-length-for-64-bit-build.patch | 38 + ...eaks-associated-with-implicit-return.patch | 57 + .../asus-laptop-add-support-for-p30-p35.patch | 32 + ...op-fix-the-led-behavior-with-value-1.patch | 31 + ...history-logic-to-menu-idle-predictor.patch | 69 ++ ...idle-reflecting-actual-state-entered.patch | 34 + ...-to-default_idle-rather-than-polling.patch | 50 + ...can-reflect-the-actual-state-entered.patch | 48 + ...-asus-acpi-if-model-is-not-supported.patch | 32 + ...ight-differ-from-one-just-removed-so.patch | 43 + queue-2.6.27/series | 21 + ...b-isp1760-fix-probe-in-pci-glue-code.patch | 189 +++ ...he-brightness-when-poking-brightness.patch | 43 + ...x-page-attribute-corruption-with-cpa.patch | 138 +++ 22 files changed, 2260 insertions(+) create mode 100644 queue-2.6.27/acpi-attach-the-acpi-device-to-the-acpi-handle-as-early-as-possible.patch create mode 100644 queue-2.6.27/acpi-avoid-array-address-overflow-when-_cst-mwait-hint-bits-are-set.patch create mode 100644 queue-2.6.27/acpi-change-acpi_evaluate_integer-to-support-64-bit-on-32-bit-kernels.patch create mode 100644 queue-2.6.27/acpi-do-not-modify-sci_en-directly.patch create mode 100644 queue-2.6.27/acpi-ec-fix-regression-due-to-use-of-uninitialized-variable.patch create mode 100644 queue-2.6.27/acpi-fix-compiler-warnings-introduced-by-32-to-64-bit-acpi-conversions.patch create mode 100644 queue-2.6.27/acpi-suspend-blacklist-hp-xw4600-workstation-for-old-code-ordering.patch create mode 100644 queue-2.6.27/acpica-add-check-for-invalid-handle-in-acpi_get_object_info.patch create mode 100644 queue-2.6.27/acpica-fix-wrong-resource-descriptor-length-for-64-bit-build.patch create mode 100644 queue-2.6.27/acpica-fixed-a-couple-memory-leaks-associated-with-implicit-return.patch create mode 100644 queue-2.6.27/asus-laptop-add-support-for-p30-p35.patch create mode 100644 queue-2.6.27/asus-laptop-fix-the-led-behavior-with-value-1.patch create mode 100644 queue-2.6.27/cpuidle-add-decaying-history-logic-to-menu-idle-predictor.patch create mode 100644 queue-2.6.27/cpuidle-update-the-last_state-acpi-cpuidle-reflecting-actual-state-entered.patch create mode 100644 queue-2.6.27/cpuidle-upon-bios-bug-default-to-default_idle-rather-than-polling.patch create mode 100644 queue-2.6.27/cpuidle-use-last_state-which-can-reflect-the-actual-state-entered.patch create mode 100644 queue-2.6.27/don-t-load-asus-acpi-if-model-is-not-supported.patch create mode 100644 queue-2.6.27/newly-inserted-battery-might-differ-from-one-just-removed-so.patch create mode 100644 queue-2.6.27/usb-isp1760-fix-probe-in-pci-glue-code.patch create mode 100644 queue-2.6.27/video-always-update-the-brightness-when-poking-brightness.patch create mode 100644 queue-2.6.27/x86-fix-page-attribute-corruption-with-cpa.patch diff --git a/queue-2.6.27/acpi-attach-the-acpi-device-to-the-acpi-handle-as-early-as-possible.patch b/queue-2.6.27/acpi-attach-the-acpi-device-to-the-acpi-handle-as-early-as-possible.patch new file mode 100644 index 00000000000..2715e2566d0 --- /dev/null +++ b/queue-2.6.27/acpi-attach-the-acpi-device-to-the-acpi-handle-as-early-as-possible.patch @@ -0,0 +1,55 @@ +From eab4b645769fa2f8703f5a3cb0cc4ac090d347af Mon Sep 17 00:00:00 2001 +From: Zhao Yakui +Date: Mon, 11 Aug 2008 14:54:16 +0800 +Subject: ACPI: Attach the ACPI device to the ACPI handle as early as possible + +From: Zhao Yakui + +commit eab4b645769fa2f8703f5a3cb0cc4ac090d347af upstream. + +Attach the ACPI device to the ACPI handle as early as possible so that OS +can get the corresponding ACPI device by the acpi handle in the course +of getting the power/wakeup/performance flags. + +http://bugzilla.kernel.org/show_bug.cgi?id=8049 +http://bugzilla.kernel.org/show_bug.cgi?id=11000 + +Signed-off-by: Zhao Yakui +Signed-off-by: Zhang Rui +Signed-off-by: Andi Kleen +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/scan.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -1262,6 +1262,16 @@ acpi_add_single_object(struct acpi_devic + acpi_device_set_id(device, parent, handle, type); + + /* ++ * The ACPI device is attached to acpi handle before getting ++ * the power/wakeup/peformance flags. Otherwise OS can't get ++ * the corresponding ACPI device by the acpi handle in the course ++ * of getting the power/wakeup/performance flags. ++ */ ++ result = acpi_device_set_context(device, type); ++ if (result) ++ goto end; ++ ++ /* + * Power Management + * ---------------- + */ +@@ -1291,8 +1301,6 @@ acpi_add_single_object(struct acpi_devic + goto end; + } + +- if ((result = acpi_device_set_context(device, type))) +- goto end; + + result = acpi_device_register(device, parent); + diff --git a/queue-2.6.27/acpi-avoid-array-address-overflow-when-_cst-mwait-hint-bits-are-set.patch b/queue-2.6.27/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.27/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.27/acpi-change-acpi_evaluate_integer-to-support-64-bit-on-32-bit-kernels.patch b/queue-2.6.27/acpi-change-acpi_evaluate_integer-to-support-64-bit-on-32-bit-kernels.patch new file mode 100644 index 00000000000..575e3a33aeb --- /dev/null +++ b/queue-2.6.27/acpi-change-acpi_evaluate_integer-to-support-64-bit-on-32-bit-kernels.patch @@ -0,0 +1,1103 @@ +From trenn@suse.de Tue Feb 3 15:07:09 2009 +From: Thomas Renninger +Date: Tue, 27 Jan 2009 17:38:51 +0100 +Subject: ACPI: Change acpi_evaluate_integer to support 64-bit on 32-bit kernels +To: stable@kernel.org +Cc: Matthew Wilcox , Len Brown +Message-ID: <1233074343-23414-10-git-send-email-trenn@suse.de> + + +From: Matthew Wilcox + +commit 27663c5855b10af9ec67bc7dfba001426ba21222 upstream + +As of version 2.0, ACPI can return 64-bit integers. The current +acpi_evaluate_integer only supports 64-bit integers on 64-bit platforms. +Change the argument to take a pointer to an acpi_integer so we support +64-bit integers on all platforms. + +lenb: replaced use of "acpi_integer" with "unsigned long long" +lenb: fixed bug in acpi_thermal_trips_update() + +Signed-off-by: Matthew Wilcox +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + arch/ia64/sn/kernel/io_acpi_init.c | 8 +++--- + drivers/acpi/ac.c | 2 - + drivers/acpi/acpi_memhotplug.c | 5 +--- + drivers/acpi/asus_acpi.c | 2 - + drivers/acpi/bay.c | 2 - + drivers/acpi/bus.c | 4 +-- + drivers/acpi/button.c | 4 +-- + drivers/acpi/container.c | 2 - + drivers/acpi/dock.c | 6 ++--- + drivers/acpi/ec.c | 7 ++++- + drivers/acpi/numa.c | 2 - + drivers/acpi/osl.c | 5 +--- + drivers/acpi/pci_root.c | 2 - + drivers/acpi/pci_slot.c | 10 ++++---- + drivers/acpi/power.c | 2 - + drivers/acpi/processor_core.c | 4 +-- + drivers/acpi/processor_perflib.c | 2 - + drivers/acpi/processor_throttling.c | 2 - + drivers/acpi/sbshc.c | 2 - + drivers/acpi/sleep/main.c | 2 - + drivers/acpi/thermal.c | 43 ++++++++++++++++++++++-------------- + drivers/acpi/utils.c | 4 +-- + drivers/acpi/video.c | 42 +++++++++++++++++------------------ + drivers/ata/libata-acpi.c | 2 - + drivers/misc/asus-laptop.c | 12 +++++----- + drivers/misc/eeepc-laptop.c | 2 - + drivers/misc/fujitsu-laptop.c | 8 +++--- + drivers/misc/intel_menlow.c | 27 +++++++++++----------- + drivers/pci/hotplug/acpiphp_glue.c | 14 +++++------ + drivers/pci/hotplug/acpiphp_ibm.c | 2 - + drivers/pci/hotplug/sgi_hotplug.c | 4 +-- + include/acpi/acpi_bus.h | 2 - + 32 files changed, 125 insertions(+), 112 deletions(-) + +--- a/arch/ia64/sn/kernel/io_acpi_init.c ++++ b/arch/ia64/sn/kernel/io_acpi_init.c +@@ -232,7 +232,7 @@ exit: + static unsigned int + get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle) + { +- unsigned long adr; ++ unsigned long long adr; + acpi_handle child; + unsigned int devfn; + int function; +@@ -292,8 +292,8 @@ get_host_devfn(acpi_handle device_handle + static acpi_status + find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv) + { +- unsigned long bbn = -1; +- unsigned long adr; ++ unsigned long long bbn = -1; ++ unsigned long long adr; + acpi_handle parent = NULL; + acpi_status status; + unsigned int devfn; +@@ -348,7 +348,7 @@ sn_acpi_get_pcidev_info(struct pci_dev * + unsigned int host_devfn; + struct sn_pcidev_match pcidev_match; + acpi_handle rootbus_handle; +- unsigned long segment; ++ unsigned long long segment; + acpi_status status; + + rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle; +--- a/drivers/acpi/ac.c ++++ b/drivers/acpi/ac.c +@@ -85,7 +85,7 @@ struct acpi_ac { + struct power_supply charger; + #endif + struct acpi_device * device; +- unsigned long state; ++ unsigned long long state; + }; + + #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger); +--- a/drivers/acpi/acpi_memhotplug.c ++++ b/drivers/acpi/acpi_memhotplug.c +@@ -194,8 +194,7 @@ acpi_memory_get_device(acpi_handle handl + + static int acpi_memory_check_device(struct acpi_memory_device *mem_device) + { +- unsigned long current_status; +- ++ unsigned long long current_status; + + /* Get device present/absent information from the _STA */ + if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA", +@@ -264,7 +263,7 @@ static int acpi_memory_powerdown_device( + acpi_status status; + struct acpi_object_list arg_list; + union acpi_object arg; +- unsigned long current_status; ++ unsigned long long current_status; + + + /* Issue the _EJ0 command */ +--- a/drivers/acpi/asus_acpi.c ++++ b/drivers/acpi/asus_acpi.c +@@ -753,7 +753,7 @@ static int get_lcd_state(void) + /* That's what the AML code does */ + lcd = out_obj.integer.value >> 8; + } else if (hotk->model == F3Sa) { +- unsigned long tmp; ++ unsigned long long tmp; + union acpi_object param; + struct acpi_object_list input; + acpi_status status; +--- a/drivers/acpi/bay.c ++++ b/drivers/acpi/bay.c +@@ -90,7 +90,7 @@ static int is_ejectable(acpi_handle hand + */ + static int bay_present(struct bay *bay) + { +- unsigned long sta; ++ unsigned long long sta; + acpi_status status; + + if (bay) { +--- a/drivers/acpi/bus.c ++++ b/drivers/acpi/bus.c +@@ -77,7 +77,7 @@ EXPORT_SYMBOL(acpi_bus_get_device); + int acpi_bus_get_status(struct acpi_device *device) + { + acpi_status status = AE_OK; +- unsigned long sta = 0; ++ unsigned long long sta = 0; + + + if (!device) +@@ -155,7 +155,7 @@ int acpi_bus_get_power(acpi_handle handl + int result = 0; + acpi_status status = 0; + struct acpi_device *device = NULL; +- unsigned long psc = 0; ++ unsigned long long psc = 0; + + + result = acpi_bus_get_device(handle, &device); +--- a/drivers/acpi/button.c ++++ b/drivers/acpi/button.c +@@ -145,7 +145,7 @@ static int acpi_button_state_seq_show(st + { + struct acpi_button *button = seq->private; + acpi_status status; +- unsigned long state; ++ unsigned long long state; + + if (!button || !button->device) + return 0; +@@ -253,7 +253,7 @@ static int acpi_button_remove_fs(struct + -------------------------------------------------------------------------- */ + static int acpi_lid_send_state(struct acpi_button *button) + { +- unsigned long state; ++ unsigned long long state; + acpi_status status; + + status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, +--- a/drivers/acpi/container.c ++++ b/drivers/acpi/container.c +@@ -76,7 +76,7 @@ static int is_device_present(acpi_handle + { + acpi_handle temp; + acpi_status status; +- unsigned long sta; ++ unsigned long long sta; + + + status = acpi_get_handle(handle, "_STA", &temp); +--- a/drivers/acpi/dock.c ++++ b/drivers/acpi/dock.c +@@ -229,7 +229,7 @@ EXPORT_SYMBOL_GPL(is_dock_device); + */ + static int dock_present(struct dock_station *ds) + { +- unsigned long sta; ++ unsigned long long sta; + acpi_status status; + + if (ds) { +@@ -730,13 +730,13 @@ static DEVICE_ATTR(undock, S_IWUSR, NULL + static ssize_t show_dock_uid(struct device *dev, + struct device_attribute *attr, char *buf) + { +- unsigned long lbuf; ++ unsigned long long lbuf; + acpi_status status = acpi_evaluate_integer(dock_station->handle, + "_UID", NULL, &lbuf); + if (ACPI_FAILURE(status)) + return 0; + +- return snprintf(buf, PAGE_SIZE, "%lx\n", lbuf); ++ return snprintf(buf, PAGE_SIZE, "%llx\n", lbuf); + } + static DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL); + +--- a/drivers/acpi/ec.c ++++ b/drivers/acpi/ec.c +@@ -769,6 +769,7 @@ static acpi_status + ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) + { + acpi_status status; ++ unsigned long long tmp; + + struct acpi_ec *ec = context; + status = acpi_walk_resources(handle, METHOD_NAME__CRS, +@@ -778,11 +779,13 @@ ec_parse_device(acpi_handle handle, u32 + + /* Get GPE bit assignment (EC events). */ + /* TODO: Add support for _GPE returning a package */ +- status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe); ++ status = acpi_evaluate_integer(handle, "_GPE", NULL, &tmp); + if (ACPI_FAILURE(status)) + return status; ++ ec->gpe = tmp; + /* Use the global lock for all EC transactions? */ +- acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock); ++ acpi_evaluate_integer(handle, "_GLK", NULL, &tmp); ++ ec->global_lock = tmp; + ec->handle = handle; + return AE_CTRL_TERMINATE; + } +--- a/drivers/acpi/numa.c ++++ b/drivers/acpi/numa.c +@@ -258,7 +258,7 @@ int __init acpi_numa_init(void) + + int acpi_get_pxm(acpi_handle h) + { +- unsigned long pxm; ++ unsigned long long pxm; + acpi_status status; + acpi_handle handle; + acpi_handle phandle = h; +--- a/drivers/acpi/osl.c ++++ b/drivers/acpi/osl.c +@@ -608,7 +608,7 @@ static void acpi_os_derive_pci_id_2(acpi + acpi_handle handle; + struct acpi_pci_id *pci_id = *id; + acpi_status status; +- unsigned long temp; ++ unsigned long long temp; + acpi_object_type type; + + acpi_get_parent(chandle, &handle); +@@ -620,8 +620,7 @@ static void acpi_os_derive_pci_id_2(acpi + if ((ACPI_FAILURE(status)) || (type != ACPI_TYPE_DEVICE)) + return; + +- status = +- acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, ++ status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, + &temp); + if (ACPI_SUCCESS(status)) { + u32 val; +--- a/drivers/acpi/pci_root.c ++++ b/drivers/acpi/pci_root.c +@@ -190,7 +190,7 @@ static int __devinit acpi_pci_root_add(s + struct acpi_pci_root *root = NULL; + struct acpi_pci_root *tmp; + acpi_status status = AE_OK; +- unsigned long value = 0; ++ unsigned long long value = 0; + acpi_handle handle = NULL; + struct acpi_device *child; + +--- a/drivers/acpi/pci_slot.c ++++ b/drivers/acpi/pci_slot.c +@@ -76,10 +76,10 @@ static struct acpi_pci_driver acpi_pci_s + }; + + static int +-check_slot(acpi_handle handle, unsigned long *sun) ++check_slot(acpi_handle handle, unsigned long long *sun) + { + int device = -1; +- unsigned long adr, sta; ++ unsigned long long adr, sta; + acpi_status status; + struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; + +@@ -132,7 +132,7 @@ static acpi_status + register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) + { + int device; +- unsigned long sun; ++ unsigned long long sun; + char name[SLOT_NAME_SIZE]; + struct acpi_pci_slot *slot; + struct pci_slot *pci_slot; +@@ -182,7 +182,7 @@ static acpi_status + walk_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv) + { + int device, function; +- unsigned long adr; ++ unsigned long long adr; + acpi_status status; + acpi_handle dummy_handle; + acpi_walk_callback user_function; +@@ -239,7 +239,7 @@ static int + walk_root_bridge(acpi_handle handle, acpi_walk_callback user_function) + { + int seg, bus; +- unsigned long tmp; ++ unsigned long long tmp; + acpi_status status; + acpi_handle dummy_handle; + struct pci_bus *pci_bus; +--- a/drivers/acpi/power.c ++++ b/drivers/acpi/power.c +@@ -131,7 +131,7 @@ acpi_power_get_context(acpi_handle handl + static int acpi_power_get_state(struct acpi_power_resource *resource, int *state) + { + acpi_status status = AE_OK; +- unsigned long sta = 0; ++ unsigned long long sta = 0; + + + if (!resource || !state) +--- a/drivers/acpi/processor_core.c ++++ b/drivers/acpi/processor_core.c +@@ -563,7 +563,7 @@ static int acpi_processor_get_info(struc + + /* Check if it is a Device with HID and UID */ + if (has_uid) { +- unsigned long value; ++ unsigned long long value; + status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID, + NULL, &value); + if (ACPI_FAILURE(status)) { +@@ -875,7 +875,7 @@ static int acpi_processor_remove(struct + static int is_processor_present(acpi_handle handle) + { + acpi_status status; +- unsigned long sta = 0; ++ unsigned long long sta = 0; + + + status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); +--- a/drivers/acpi/processor_perflib.c ++++ b/drivers/acpi/processor_perflib.c +@@ -126,7 +126,7 @@ static struct notifier_block acpi_ppc_no + static int acpi_processor_get_platform_limit(struct acpi_processor *pr) + { + acpi_status status = 0; +- unsigned long ppc = 0; ++ unsigned long long ppc = 0; + + + if (!pr) +--- a/drivers/acpi/processor_throttling.c ++++ b/drivers/acpi/processor_throttling.c +@@ -274,7 +274,7 @@ static int acpi_processor_throttling_not + static int acpi_processor_get_platform_limit(struct acpi_processor *pr) + { + acpi_status status = 0; +- unsigned long tpc = 0; ++ unsigned long long tpc = 0; + + if (!pr) + return -EINVAL; +--- a/drivers/acpi/sbshc.c ++++ b/drivers/acpi/sbshc.c +@@ -258,7 +258,7 @@ extern int acpi_ec_add_query_handler(str + static int acpi_smbus_hc_add(struct acpi_device *device) + { + int status; +- unsigned long val; ++ unsigned long long val; + struct acpi_smb_hc *hc; + + if (!device) +--- a/drivers/acpi/sleep/main.c ++++ b/drivers/acpi/sleep/main.c +@@ -492,7 +492,7 @@ int acpi_pm_device_sleep_state(struct de + acpi_handle handle = DEVICE_ACPI_HANDLE(dev); + struct acpi_device *adev; + char acpi_method[] = "_SxD"; +- unsigned long d_min, d_max; ++ unsigned long long d_min, d_max; + + if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) { + printk(KERN_DEBUG "ACPI handle has no context!\n"); +--- a/drivers/acpi/thermal.c ++++ b/drivers/acpi/thermal.c +@@ -246,18 +246,18 @@ static const struct file_operations acpi + static int acpi_thermal_get_temperature(struct acpi_thermal *tz) + { + acpi_status status = AE_OK; +- ++ unsigned long long tmp; + + if (!tz) + return -EINVAL; + + tz->last_temperature = tz->temperature; + +- status = +- acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tz->temperature); ++ status = acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tmp); + if (ACPI_FAILURE(status)) + return -ENODEV; + ++ tz->temperature = tmp; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n", + tz->temperature)); + +@@ -267,17 +267,16 @@ static int acpi_thermal_get_temperature( + static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz) + { + acpi_status status = AE_OK; +- ++ unsigned long long tmp; + + if (!tz) + return -EINVAL; + +- status = +- acpi_evaluate_integer(tz->device->handle, "_TZP", NULL, +- &tz->polling_frequency); ++ status = acpi_evaluate_integer(tz->device->handle, "_TZP", NULL, &tmp); + if (ACPI_FAILURE(status)) + return -ENODEV; + ++ tz->polling_frequency = tmp; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n", + tz->polling_frequency)); + +@@ -356,6 +355,7 @@ do { \ + static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) + { + acpi_status status = AE_OK; ++ unsigned long long tmp; + struct acpi_handle_list devices; + int valid = 0; + int i; +@@ -363,7 +363,8 @@ static int acpi_thermal_trips_update(str + /* Critical Shutdown (required) */ + if (flag & ACPI_TRIPS_CRITICAL) { + status = acpi_evaluate_integer(tz->device->handle, +- "_CRT", NULL, &tz->trips.critical.temperature); ++ "_CRT", NULL, &tmp); ++ tz->trips.critical.temperature = tmp; + /* + * Treat freezing temperatures as invalid as well; some + * BIOSes return really low values and cause reboots at startup. +@@ -399,12 +400,13 @@ static int acpi_thermal_trips_update(str + /* Critical Sleep (optional) */ + if (flag & ACPI_TRIPS_HOT) { + status = acpi_evaluate_integer(tz->device->handle, +- "_HOT", NULL, &tz->trips.hot.temperature); ++ "_HOT", NULL, &tmp); + if (ACPI_FAILURE(status)) { + tz->trips.hot.flags.valid = 0; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "No hot threshold\n")); + } else { ++ tz->trips.hot.temperature = tmp; + tz->trips.hot.flags.valid = 1; + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Found hot threshold [%lu]\n", +@@ -418,33 +420,40 @@ static int acpi_thermal_trips_update(str + if (psv == -1) { + status = AE_SUPPORT; + } else if (psv > 0) { +- tz->trips.passive.temperature = CELSIUS_TO_KELVIN(psv); ++ tmp = CELSIUS_TO_KELVIN(psv); + status = AE_OK; + } else { + status = acpi_evaluate_integer(tz->device->handle, +- "_PSV", NULL, &tz->trips.passive.temperature); ++ "_PSV", NULL, &tmp); + } + + if (ACPI_FAILURE(status)) + tz->trips.passive.flags.valid = 0; + else { ++ tz->trips.passive.temperature = tmp; + tz->trips.passive.flags.valid = 1; + if (flag == ACPI_TRIPS_INIT) { + status = acpi_evaluate_integer( + tz->device->handle, "_TC1", +- NULL, &tz->trips.passive.tc1); ++ NULL, &tmp); + if (ACPI_FAILURE(status)) + tz->trips.passive.flags.valid = 0; ++ else ++ tz->trips.passive.tc1 = tmp; + status = acpi_evaluate_integer( + tz->device->handle, "_TC2", +- NULL, &tz->trips.passive.tc2); ++ NULL, &tmp); + if (ACPI_FAILURE(status)) + tz->trips.passive.flags.valid = 0; ++ else ++ tz->trips.passive.tc2 = tmp; + status = acpi_evaluate_integer( + tz->device->handle, "_TSP", +- NULL, &tz->trips.passive.tsp); ++ NULL, &tmp); + if (ACPI_FAILURE(status)) + tz->trips.passive.flags.valid = 0; ++ else ++ tz->trips.passive.tsp = tmp; + } + } + } +@@ -479,7 +488,7 @@ static int acpi_thermal_trips_update(str + + if (flag & ACPI_TRIPS_ACTIVE) { + status = acpi_evaluate_integer(tz->device->handle, +- name, NULL, &tz->trips.active[i].temperature); ++ name, NULL, &tmp); + if (ACPI_FAILURE(status)) { + tz->trips.active[i].flags.valid = 0; + if (i == 0) +@@ -500,8 +509,10 @@ static int acpi_thermal_trips_update(str + tz->trips.active[i - 2].temperature : + CELSIUS_TO_KELVIN(act)); + break; +- } else ++ } else { ++ tz->trips.active[i].temperature = tmp; + tz->trips.active[i].flags.valid = 1; ++ } + } + + name[2] = 'L'; +--- a/drivers/acpi/utils.c ++++ b/drivers/acpi/utils.c +@@ -256,7 +256,7 @@ EXPORT_SYMBOL(acpi_extract_package); + acpi_status + acpi_evaluate_integer(acpi_handle handle, + acpi_string pathname, +- struct acpi_object_list *arguments, unsigned long *data) ++ struct acpi_object_list *arguments, unsigned long long *data) + { + acpi_status status = AE_OK; + union acpi_object *element; +@@ -288,7 +288,7 @@ acpi_evaluate_integer(acpi_handle handle + *data = element->integer.value; + kfree(element); + +- ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%lu]\n", *data)); ++ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data)); + + return AE_OK; + } +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -291,20 +291,20 @@ static int acpi_video_device_lcd_set_lev + int level); + static int acpi_video_device_lcd_get_level_current( + struct acpi_video_device *device, +- unsigned long *level); ++ unsigned long long *level); + static int acpi_video_get_next_level(struct acpi_video_device *device, + u32 level_current, u32 event); + static void acpi_video_switch_brightness(struct acpi_video_device *device, + int event); + static int acpi_video_device_get_state(struct acpi_video_device *device, +- unsigned long *state); ++ unsigned long long *state); + static int acpi_video_output_get(struct output_device *od); + static int acpi_video_device_set_state(struct acpi_video_device *device, int state); + + /*backlight device sysfs support*/ + static int acpi_video_get_brightness(struct backlight_device *bd) + { +- unsigned long cur_level; ++ unsigned long long cur_level; + int i; + struct acpi_video_device *vd = + (struct acpi_video_device *)bl_get_data(bd); +@@ -336,7 +336,7 @@ static struct backlight_ops acpi_backlig + /*video output device sysfs support*/ + static int acpi_video_output_get(struct output_device *od) + { +- unsigned long state; ++ unsigned long long state; + struct acpi_video_device *vd = + (struct acpi_video_device *)dev_get_drvdata(&od->dev); + acpi_video_device_get_state(vd, &state); +@@ -370,7 +370,7 @@ static int video_get_cur_state(struct th + { + struct acpi_device *device = cdev->devdata; + struct acpi_video_device *video = acpi_driver_data(device); +- unsigned long level; ++ unsigned long long level; + int state; + + acpi_video_device_lcd_get_level_current(video, &level); +@@ -410,7 +410,7 @@ static struct thermal_cooling_device_ops + /* device */ + + static int +-acpi_video_device_query(struct acpi_video_device *device, unsigned long *state) ++acpi_video_device_query(struct acpi_video_device *device, unsigned long long *state) + { + int status; + +@@ -421,7 +421,7 @@ acpi_video_device_query(struct acpi_vide + + static int + acpi_video_device_get_state(struct acpi_video_device *device, +- unsigned long *state) ++ unsigned long long *state) + { + int status; + +@@ -436,7 +436,7 @@ acpi_video_device_set_state(struct acpi_ + int status; + union acpi_object arg0 = { ACPI_TYPE_INTEGER }; + struct acpi_object_list args = { 1, &arg0 }; +- unsigned long ret; ++ unsigned long long ret; + + + arg0.integer.value = state; +@@ -495,7 +495,7 @@ acpi_video_device_lcd_set_level(struct a + + static int + acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, +- unsigned long *level) ++ unsigned long long *level) + { + if (device->cap._BQC) + return acpi_evaluate_integer(device->dev->handle, "_BQC", NULL, +@@ -549,7 +549,7 @@ static int + acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option) + { + int status; +- unsigned long tmp; ++ unsigned long long tmp; + union acpi_object arg0 = { ACPI_TYPE_INTEGER }; + struct acpi_object_list args = { 1, &arg0 }; + +@@ -564,7 +564,7 @@ acpi_video_bus_set_POST(struct acpi_vide + } + + static int +-acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long *id) ++acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long long *id) + { + int status; + +@@ -575,7 +575,7 @@ acpi_video_bus_get_POST(struct acpi_vide + + static int + acpi_video_bus_POST_options(struct acpi_video_bus *video, +- unsigned long *options) ++ unsigned long long *options) + { + int status; + +@@ -918,7 +918,7 @@ static int acpi_video_device_state_seq_s + { + int status; + struct acpi_video_device *dev = seq->private; +- unsigned long state; ++ unsigned long long state; + + + if (!dev) +@@ -927,14 +927,14 @@ static int acpi_video_device_state_seq_s + status = acpi_video_device_get_state(dev, &state); + seq_printf(seq, "state: "); + if (ACPI_SUCCESS(status)) +- seq_printf(seq, "0x%02lx\n", state); ++ seq_printf(seq, "0x%02llx\n", state); + else + seq_printf(seq, "\n"); + + status = acpi_video_device_query(dev, &state); + seq_printf(seq, "query: "); + if (ACPI_SUCCESS(status)) +- seq_printf(seq, "0x%02lx\n", state); ++ seq_printf(seq, "0x%02llx\n", state); + else + seq_printf(seq, "\n"); + +@@ -1217,7 +1217,7 @@ static int acpi_video_bus_ROM_open_fs(st + static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) + { + struct acpi_video_bus *video = seq->private; +- unsigned long options; ++ unsigned long long options; + int status; + + +@@ -1232,7 +1232,7 @@ static int acpi_video_bus_POST_info_seq_ + printk(KERN_WARNING PREFIX + "This indicates a BIOS bug. Please contact the manufacturer.\n"); + } +- printk("%lx\n", options); ++ printk("%llx\n", options); + seq_printf(seq, "can POST: "); + if (options & 2) + seq_printf(seq, " "); +@@ -1256,7 +1256,7 @@ static int acpi_video_bus_POST_seq_show( + { + struct acpi_video_bus *video = seq->private; + int status; +- unsigned long id; ++ unsigned long long id; + + + if (!video) +@@ -1303,7 +1303,7 @@ acpi_video_bus_write_POST(struct file *f + struct seq_file *m = file->private_data; + struct acpi_video_bus *video = m->private; + char str[12] = { 0 }; +- unsigned long opt, options; ++ unsigned long long opt, options; + + + if (!video || count + 1 > sizeof str) +@@ -1473,7 +1473,7 @@ static int + acpi_video_bus_get_one_device(struct acpi_device *device, + struct acpi_video_bus *video) + { +- unsigned long device_id; ++ unsigned long long device_id; + int status; + struct acpi_video_device *data; + struct acpi_video_device_attrib* attribute; +@@ -1724,7 +1724,7 @@ acpi_video_get_next_level(struct acpi_vi + static void + acpi_video_switch_brightness(struct acpi_video_device *device, int event) + { +- unsigned long level_current, level_next; ++ unsigned long long level_current, level_next; + if (!device->brightness) + return; + acpi_video_device_lcd_get_level_current(device, &level_current); +--- a/drivers/ata/libata-acpi.c ++++ b/drivers/ata/libata-acpi.c +@@ -180,7 +180,7 @@ static void ata_acpi_handle_hotplug(stru + int wait = 0; + unsigned long flags; + acpi_handle handle, tmphandle; +- unsigned long sta; ++ unsigned long long sta; + acpi_status status; + + if (dev) { +--- a/drivers/misc/asus-laptop.c ++++ b/drivers/misc/asus-laptop.c +@@ -280,7 +280,7 @@ static int write_acpi_int(acpi_handle ha + + static int read_wireless_status(int mask) + { +- ulong status; ++ unsigned long long status; + acpi_status rv = AE_OK; + + if (!wireless_status_handle) +@@ -297,7 +297,7 @@ static int read_wireless_status(int mask + + static int read_gps_status(void) + { +- ulong status; ++ unsigned long long status; + acpi_status rv = AE_OK; + + rv = acpi_evaluate_integer(gps_status_handle, NULL, NULL, &status); +@@ -404,7 +404,7 @@ static void lcd_blank(int blank) + + static int read_brightness(struct backlight_device *bd) + { +- ulong value; ++ unsigned long long value; + acpi_status rv = AE_OK; + + rv = acpi_evaluate_integer(brightness_get_handle, NULL, NULL, &value); +@@ -455,7 +455,7 @@ static ssize_t show_infos(struct device + struct device_attribute *attr, char *page) + { + int len = 0; +- ulong temp; ++ unsigned long long temp; + char buf[16]; //enough for all info + acpi_status rv = AE_OK; + +@@ -603,7 +603,7 @@ static void set_display(int value) + + static int read_display(void) + { +- ulong value = 0; ++ unsigned long long value = 0; + acpi_status rv = AE_OK; + + /* In most of the case, we know how to set the display, but sometime +@@ -849,7 +849,7 @@ static int asus_hotk_get_info(void) + { + struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; + union acpi_object *model = NULL; +- ulong bsts_result, hwrs_result; ++ unsigned long long bsts_result, hwrs_result; + char *string = NULL; + acpi_status status; + +--- a/drivers/misc/eeepc-laptop.c ++++ b/drivers/misc/eeepc-laptop.c +@@ -204,7 +204,7 @@ static int write_acpi_int(acpi_handle ha + static int read_acpi_int(acpi_handle handle, const char *method, int *val) + { + acpi_status status; +- ulong result; ++ unsigned long long result; + + status = acpi_evaluate_integer(handle, (char *)method, NULL, &result); + if (ACPI_FAILURE(status)) { +--- a/drivers/misc/fujitsu-laptop.c ++++ b/drivers/misc/fujitsu-laptop.c +@@ -224,7 +224,7 @@ static int set_lcd_level_alt(int level) + + static int get_lcd_level(void) + { +- unsigned long state = 0; ++ unsigned long long state = 0; + acpi_status status = AE_OK; + + vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLL\n"); +@@ -246,7 +246,7 @@ static int get_lcd_level(void) + + static int get_max_brightness(void) + { +- unsigned long state = 0; ++ unsigned long long state = 0; + acpi_status status = AE_OK; + + vdbg_printk(FUJLAPTOP_DBG_TRACE, "get max lcd level via RBLL\n"); +@@ -263,7 +263,7 @@ static int get_max_brightness(void) + + static int get_lcd_level_alt(void) + { +- unsigned long state = 0; ++ unsigned long long state = 0; + acpi_status status = AE_OK; + + vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLS\n"); +@@ -384,7 +384,7 @@ static ssize_t store_lcd_level(struct de + + static int get_irb(void) + { +- unsigned long state = 0; ++ unsigned long long state = 0; + acpi_status status = AE_OK; + + vdbg_printk(FUJLAPTOP_DBG_TRACE, "Get irb\n"); +--- a/drivers/misc/intel_menlow.c ++++ b/drivers/misc/intel_menlow.c +@@ -57,7 +57,7 @@ static int memory_get_int_max_bandwidth( + { + struct acpi_device *device = cdev->devdata; + acpi_handle handle = device->handle; +- unsigned long value; ++ unsigned long long value; + struct acpi_object_list arg_list; + union acpi_object arg; + acpi_status status = AE_OK; +@@ -90,7 +90,7 @@ static int memory_get_cur_bandwidth(stru + { + struct acpi_device *device = cdev->devdata; + acpi_handle handle = device->handle; +- unsigned long value; ++ unsigned long long value; + struct acpi_object_list arg_list; + union acpi_object arg; + acpi_status status = AE_OK; +@@ -115,7 +115,7 @@ static int memory_set_cur_bandwidth(stru + struct acpi_object_list arg_list; + union acpi_object arg; + acpi_status status; +- int temp; ++ unsigned long long temp; + unsigned long max_state; + + if (memory_get_int_max_bandwidth(cdev, &max_state)) +@@ -131,7 +131,7 @@ static int memory_set_cur_bandwidth(stru + + status = + acpi_evaluate_integer(handle, MEMORY_SET_BANDWIDTH, &arg_list, +- (unsigned long *)&temp); ++ &temp); + + printk(KERN_INFO + "Bandwidth value was %d: status is %d\n", state, status); +@@ -252,7 +252,8 @@ static DEFINE_MUTEX(intel_menlow_attr_lo + * @auxtype : AUX0/AUX1 + * @buf: syfs buffer + */ +-static int sensor_get_auxtrip(acpi_handle handle, int index, int *value) ++static int sensor_get_auxtrip(acpi_handle handle, int index, ++ unsigned long long *value) + { + acpi_status status; + +@@ -260,7 +261,7 @@ static int sensor_get_auxtrip(acpi_handl + return -EINVAL; + + status = acpi_evaluate_integer(handle, index ? GET_AUX1 : GET_AUX0, +- NULL, (unsigned long *)value); ++ NULL, value); + if (ACPI_FAILURE(status)) + return -EIO; + +@@ -282,13 +283,13 @@ static int sensor_set_auxtrip(acpi_handl + struct acpi_object_list args = { + 1, &arg + }; +- int temp; ++ unsigned long long temp; + + if (index != 0 && index != 1) + return -EINVAL; + + status = acpi_evaluate_integer(handle, index ? GET_AUX0 : GET_AUX1, +- NULL, (unsigned long *)&temp); ++ NULL, &temp); + if (ACPI_FAILURE(status)) + return -EIO; + if ((index && value < temp) || (!index && value > temp)) +@@ -296,7 +297,7 @@ static int sensor_set_auxtrip(acpi_handl + + arg.integer.value = value; + status = acpi_evaluate_integer(handle, index ? SET_AUX1 : SET_AUX0, +- &args, (unsigned long *)&temp); ++ &args, &temp); + if (ACPI_FAILURE(status)) + return -EIO; + +@@ -312,7 +313,7 @@ static ssize_t aux0_show(struct device * + struct device_attribute *dev_attr, char *buf) + { + struct intel_menlow_attribute *attr = to_intel_menlow_attr(dev_attr); +- int value; ++ unsigned long long value; + int result; + + result = sensor_get_auxtrip(attr->handle, 0, &value); +@@ -324,7 +325,7 @@ static ssize_t aux1_show(struct device * + struct device_attribute *dev_attr, char *buf) + { + struct intel_menlow_attribute *attr = to_intel_menlow_attr(dev_attr); +- int value; ++ unsigned long long value; + int result; + + result = sensor_get_auxtrip(attr->handle, 1, &value); +@@ -376,7 +377,7 @@ static ssize_t bios_enabled_show(struct + struct device_attribute *attr, char *buf) + { + acpi_status status; +- unsigned long bios_enabled; ++ unsigned long long bios_enabled; + + status = acpi_evaluate_integer(NULL, BIOS_ENABLED, NULL, &bios_enabled); + if (ACPI_FAILURE(status)) +@@ -492,7 +493,7 @@ static int __init intel_menlow_module_in + { + int result = -ENODEV; + acpi_status status; +- unsigned long enable; ++ unsigned long long enable; + + if (acpi_disabled) + return result; +--- a/drivers/pci/hotplug/acpiphp_glue.c ++++ b/drivers/pci/hotplug/acpiphp_glue.c +@@ -180,7 +180,7 @@ register_slot(acpi_handle handle, u32 lv + struct acpiphp_func *newfunc; + acpi_handle tmp; + acpi_status status = AE_OK; +- unsigned long adr, sun; ++ unsigned long long adr, sun; + int device, function, retval; + + status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); +@@ -528,7 +528,7 @@ find_p2p_bridge(acpi_handle handle, u32 + { + acpi_status status; + acpi_handle dummy_handle; +- unsigned long tmp; ++ unsigned long long tmp; + int device, function; + struct pci_dev *dev; + struct pci_bus *pci_bus = context; +@@ -573,7 +573,7 @@ find_p2p_bridge(acpi_handle handle, u32 + static int add_bridge(acpi_handle handle) + { + acpi_status status; +- unsigned long tmp; ++ unsigned long long tmp; + int seg, bus; + acpi_handle dummy_handle; + struct pci_bus *pci_bus; +@@ -767,7 +767,7 @@ static int get_gsi_base(acpi_handle hand + { + acpi_status status; + int result = -1; +- unsigned long gsb; ++ unsigned long long gsb; + struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; + union acpi_object *obj; + void *table; +@@ -808,7 +808,7 @@ static acpi_status + ioapic_add(acpi_handle handle, u32 lvl, void *context, void **rv) + { + acpi_status status; +- unsigned long sta; ++ unsigned long long sta; + acpi_handle tmp; + struct pci_dev *pdev; + u32 gsi_base; +@@ -872,7 +872,7 @@ static acpi_status + ioapic_remove(acpi_handle handle, u32 lvl, void *context, void **rv) + { + acpi_status status; +- unsigned long sta; ++ unsigned long long sta; + acpi_handle tmp; + u32 gsi_base; + struct acpiphp_ioapic *pos, *n, *ioapic = NULL; +@@ -1264,7 +1264,7 @@ static int disable_device(struct acpiphp + static unsigned int get_slot_status(struct acpiphp_slot *slot) + { + acpi_status status; +- unsigned long sta = 0; ++ unsigned long long sta = 0; + u32 dvid; + struct list_head *l; + struct acpiphp_func *func; +--- a/drivers/pci/hotplug/acpiphp_ibm.c ++++ b/drivers/pci/hotplug/acpiphp_ibm.c +@@ -183,7 +183,7 @@ static int ibm_set_attention_status(stru + union acpi_object args[2]; + struct acpi_object_list params = { .pointer = args, .count = 2 }; + acpi_status stat; +- unsigned long rc; ++ unsigned long long rc; + union apci_descriptor *ibm_slot; + + ibm_slot = ibm_slot_from_id(hpslot_to_sun(slot)); +--- a/drivers/pci/hotplug/sgi_hotplug.c ++++ b/drivers/pci/hotplug/sgi_hotplug.c +@@ -413,7 +413,7 @@ static int enable_slot(struct hotplug_sl + /* + * Add the slot's devices to the ACPI infrastructure */ + if (SN_ACPI_BASE_SUPPORT() && ssdt) { +- unsigned long adr; ++ unsigned long long adr; + struct acpi_device *pdevice; + struct acpi_device *device; + acpi_handle phandle; +@@ -505,7 +505,7 @@ static int disable_slot(struct hotplug_s + /* free the ACPI resources for the slot */ + if (SN_ACPI_BASE_SUPPORT() && + PCI_CONTROLLER(slot->pci_bus)->acpi_handle) { +- unsigned long adr; ++ unsigned long long adr; + struct acpi_device *device; + acpi_handle phandle; + acpi_handle chandle = NULL; +--- a/include/acpi/acpi_bus.h ++++ b/include/acpi/acpi_bus.h +@@ -46,7 +46,7 @@ acpi_extract_package(union acpi_object * + acpi_status + acpi_evaluate_integer(acpi_handle handle, + acpi_string pathname, +- struct acpi_object_list *arguments, unsigned long *data); ++ struct acpi_object_list *arguments, unsigned long long *data); + acpi_status + acpi_evaluate_reference(acpi_handle handle, + acpi_string pathname, diff --git a/queue-2.6.27/acpi-do-not-modify-sci_en-directly.patch b/queue-2.6.27/acpi-do-not-modify-sci_en-directly.patch new file mode 100644 index 00000000000..67ec40fffd3 --- /dev/null +++ b/queue-2.6.27/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.27/acpi-ec-fix-regression-due-to-use-of-uninitialized-variable.patch b/queue-2.6.27/acpi-ec-fix-regression-due-to-use-of-uninitialized-variable.patch new file mode 100644 index 00000000000..d7d040095f5 --- /dev/null +++ b/queue-2.6.27/acpi-ec-fix-regression-due-to-use-of-uninitialized-variable.patch @@ -0,0 +1,49 @@ +From d21cf3c16b1191f3154a51e0b20c82bf851cc553 Mon Sep 17 00:00:00 2001 +From: Alexey Starikovskiy +Date: Mon, 3 Nov 2008 14:26:40 -0500 +Subject: ACPI EC: Fix regression due to use of uninitialized variable + +From: Alexey Starikovskiy + +commit d21cf3c16b1191f3154a51e0b20c82bf851cc553 upstream. + +breakage introduced by following patch +commit 27663c5855b10af9ec67bc7dfba001426ba21222 +Author: Matthew Wilcox +Date: Fri Oct 10 02:22:59 2008 -0400 + +acpi_evaluate_integer() does not clear passed variable if +there is an error at evaluation. +So if we ignore error, we must supply initialized variable. + +http://bugzilla.kernel.org/show_bug.cgi?id=11917 + +Signed-off-by: Alexey Starikovskiy +Tested-by: Alan Jenkins +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/ec.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/acpi/ec.c ++++ b/drivers/acpi/ec.c +@@ -769,7 +769,7 @@ static acpi_status + ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) + { + acpi_status status; +- unsigned long long tmp; ++ unsigned long long tmp = 0; + + struct acpi_ec *ec = context; + status = acpi_walk_resources(handle, METHOD_NAME__CRS, +@@ -784,6 +784,7 @@ ec_parse_device(acpi_handle handle, u32 + return status; + ec->gpe = tmp; + /* Use the global lock for all EC transactions? */ ++ tmp = 0; + acpi_evaluate_integer(handle, "_GLK", NULL, &tmp); + ec->global_lock = tmp; + ec->handle = handle; diff --git a/queue-2.6.27/acpi-fix-compiler-warnings-introduced-by-32-to-64-bit-acpi-conversions.patch b/queue-2.6.27/acpi-fix-compiler-warnings-introduced-by-32-to-64-bit-acpi-conversions.patch new file mode 100644 index 00000000000..bdd6b4c386c --- /dev/null +++ b/queue-2.6.27/acpi-fix-compiler-warnings-introduced-by-32-to-64-bit-acpi-conversions.patch @@ -0,0 +1,44 @@ +From trenn@suse.de Tue Feb 3 15:08:18 2009 +From: Thomas Renninger +Date: Tue, 27 Jan 2009 17:38:52 +0100 +Subject: ACPI: Fix compiler warnings introduced by 32 to 64 bit acpi conversions +To: stable@kernel.org +Cc: Thomas Renninger +Message-ID: <1233074343-23414-11-git-send-email-trenn@suse.de> + + +commit: 27663c5855b10af9ec67bc7dfba001426ba21222 forgot to convert things at +two prints. + +Cc: Matthew Wilcox +Cc: Len Brown +Signed-off-by: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/intel_menlow.c | 2 +- + drivers/pci/hotplug/acpiphp_ibm.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/misc/intel_menlow.c ++++ b/drivers/misc/intel_menlow.c +@@ -104,7 +104,7 @@ static int memory_get_cur_bandwidth(stru + if (ACPI_FAILURE(status)) + return -EFAULT; + +- return sprintf(buf, "%ld\n", value); ++ return sprintf(buf, "%lld\n", value); + } + + static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev, +--- a/drivers/pci/hotplug/acpiphp_ibm.c ++++ b/drivers/pci/hotplug/acpiphp_ibm.c +@@ -204,7 +204,7 @@ static int ibm_set_attention_status(stru + err("APLS evaluation failed: 0x%08x\n", stat); + return -ENODEV; + } else if (!rc) { +- err("APLS method failed: 0x%08lx\n", rc); ++ err("APLS method failed: 0x%08llx\n", rc); + return -ERANGE; + } + return 0; diff --git a/queue-2.6.27/acpi-suspend-blacklist-hp-xw4600-workstation-for-old-code-ordering.patch b/queue-2.6.27/acpi-suspend-blacklist-hp-xw4600-workstation-for-old-code-ordering.patch new file mode 100644 index 00000000000..69230b26221 --- /dev/null +++ b/queue-2.6.27/acpi-suspend-blacklist-hp-xw4600-workstation-for-old-code-ordering.patch @@ -0,0 +1,44 @@ +From trenn@suse.de Tue Feb 3 15:26:40 2009 +From: Rafael J. Wysocki +Date: Tue, 27 Jan 2009 17:39:02 +0100 +Subject: ACPI suspend: Blacklist HP xw4600 Workstation for old code ordering +To: stable@kernel.org +Cc: "Rafael J. Wysocki" , Len Brown +Message-ID: <1233074343-23414-21-git-send-email-trenn@suse.de> + + +From: Rafael J. Wysocki + +commit 4fb507b6b764195bb7821cf2baa988f6eb677d30 + +HP xw4600 Workstation is known to require the "old" (ie. compatible +with ACPI 1.0) suspend code ordering, so blacklist it for this +purpose. + +Signed-off-by: Rafael J. Wysocki +Tested-by: John Brown +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/sleep/main.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/acpi/sleep/main.c ++++ b/drivers/acpi/sleep/main.c +@@ -344,6 +344,14 @@ static struct dmi_system_id __initdata a + DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"), + }, + }, ++ { ++ .callback = init_old_suspend_ordering, ++ .ident = "HP xw4600 Workstation", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"), ++ }, ++ }, + {}, + }; + #endif /* CONFIG_SUSPEND */ diff --git a/queue-2.6.27/acpica-add-check-for-invalid-handle-in-acpi_get_object_info.patch b/queue-2.6.27/acpica-add-check-for-invalid-handle-in-acpi_get_object_info.patch new file mode 100644 index 00000000000..c051e3aeb04 --- /dev/null +++ b/queue-2.6.27/acpica-add-check-for-invalid-handle-in-acpi_get_object_info.patch @@ -0,0 +1,38 @@ +From trenn@suse.de Tue Feb 3 15:05:49 2009 +From: Fiodor Suietov +Date: Tue, 27 Jan 2009 17:38:50 +0100 +Subject: ACPICA: Add check for invalid handle in acpi_get_object_info +To: stable@kernel.org +Cc: Len Brown , Andi Kleen , Lin Ming , Bob Moore , Fiodor Suietov , Thomas Renninger +Message-ID: <1233074343-23414-9-git-send-email-trenn@suse.de> + +From: Fiodor Suietov + +commit 237a927682a63f02adb542dbdaafe8a81566451d upstream + +Return AE_BAD_PARAMETER if input handle is invalid. + +http://www.acpica.org/bugzilla/show_bug.cgi?id=474 + +Signed-off-by: Fiodor Suietov +Signed-off-by: Bob Moore +Signed-off-by: Lin Ming +Signed-off-by: Andi Kleen +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/namespace/nsxfname.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/acpi/namespace/nsxfname.c ++++ b/drivers/acpi/namespace/nsxfname.c +@@ -253,6 +253,7 @@ acpi_get_object_info(acpi_handle handle, + node = acpi_ns_map_handle_to_node(handle); + if (!node) { + (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); ++ status = AE_BAD_PARAMETER; + goto cleanup; + } + diff --git a/queue-2.6.27/acpica-fix-wrong-resource-descriptor-length-for-64-bit-build.patch b/queue-2.6.27/acpica-fix-wrong-resource-descriptor-length-for-64-bit-build.patch new file mode 100644 index 00000000000..2c4d072a281 --- /dev/null +++ b/queue-2.6.27/acpica-fix-wrong-resource-descriptor-length-for-64-bit-build.patch @@ -0,0 +1,38 @@ +From 9db4fcd99f7ef886ded97cd26a8642c70fbe34df Mon Sep 17 00:00:00 2001 +From: Bob Moore +Date: Fri, 4 Jul 2008 10:56:13 +0800 +Subject: ACPICA: Fix wrong resource descriptor length for 64-bit build + +From: Bob Moore + +commit 9db4fcd99f7ef886ded97cd26a8642c70fbe34df upstream. + +The "minimal" descriptors such as EndTag are calculated as 12 +bytes long, but the actual length in the internal descriptor is +16 because of the round-up to 8 on 64-bit build. + +http://www.acpica.org/bugzilla/show_bug.cgi?id=728 + +Signed-off-by: Bob Moore +Signed-off-by: Lin Ming +Signed-off-by: Andi Kleen +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + include/acpi/actypes.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/acpi/actypes.h ++++ b/include/acpi/actypes.h +@@ -1225,8 +1225,8 @@ struct acpi_resource { + + #pragma pack() + +-#define ACPI_RS_SIZE_MIN 12 + #define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */ ++#define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12) + #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) + + #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) diff --git a/queue-2.6.27/acpica-fixed-a-couple-memory-leaks-associated-with-implicit-return.patch b/queue-2.6.27/acpica-fixed-a-couple-memory-leaks-associated-with-implicit-return.patch new file mode 100644 index 00000000000..7e7e7a105fe --- /dev/null +++ b/queue-2.6.27/acpica-fixed-a-couple-memory-leaks-associated-with-implicit-return.patch @@ -0,0 +1,57 @@ +From trenn@suse.de Tue Feb 3 15:04:59 2009 +From: Lin Ming +Date: Tue, 27 Jan 2009 17:38:49 +0100 +Subject: ACPICA: Fixed a couple memory leaks associated with "implicit return" +To: stable@kernel.org +Cc: Len Brown , Bob Moore , Lin Ming +Message-ID: <1233074343-23414-8-git-send-email-trenn@suse.de> + + +From: Lin Ming + +commit d8a0ec914afa1a994d2f6184ac4c6668b5f8068f upstream + +Fixed a couple memory leaks associated with "implicit return" objects +when the AML Interpreter slack mode is enabled. + +http://www.acpica.org/bugzilla/show_bug.cgi?id=349 + +Signed-off-by: Lin Ming +Signed-off-by: Bob Moore +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/dispatcher/dsmethod.c | 3 +++ + drivers/acpi/parser/psparse.c | 4 +++- + 2 files changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/acpi/dispatcher/dsmethod.c ++++ b/drivers/acpi/dispatcher/dsmethod.c +@@ -103,6 +103,9 @@ acpi_ds_method_error(acpi_status status, + NULL); + acpi_ex_enter_interpreter(); + } ++ ++ acpi_ds_clear_implicit_return(walk_state); ++ + #ifdef ACPI_DISASSEMBLER + if (ACPI_FAILURE(status)) { + +--- a/drivers/acpi/parser/psparse.c ++++ b/drivers/acpi/parser/psparse.c +@@ -641,10 +641,12 @@ acpi_status acpi_ps_parse_aml(struct acp + ACPI_WALK_METHOD_RESTART; + } + } else { +- /* On error, delete any return object */ ++ /* On error, delete any return object or implicit return */ + + acpi_ut_remove_reference(previous_walk_state-> + return_desc); ++ acpi_ds_clear_implicit_return ++ (previous_walk_state); + } + } + diff --git a/queue-2.6.27/asus-laptop-add-support-for-p30-p35.patch b/queue-2.6.27/asus-laptop-add-support-for-p30-p35.patch new file mode 100644 index 00000000000..e86fedb3523 --- /dev/null +++ b/queue-2.6.27/asus-laptop-add-support-for-p30-p35.patch @@ -0,0 +1,32 @@ +From 4d0b856ef7eea5c03f4c1fa57793286ac068f4cd Mon Sep 17 00:00:00 2001 +From: Torsten Krah +Date: Fri, 17 Oct 2008 09:47:57 +0200 +Subject: asus-laptop: Add support for P30/P35 + +From: Torsten Krah + +commit 4d0b856ef7eea5c03f4c1fa57793286ac068f4cd upstream. + +Add support for P30/P35. + +http://bugzilla.kernel.org/show_bug.cgi?id=10848 + +Signed-off-by: Corentin Chary +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/asus-laptop.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/misc/asus-laptop.c ++++ b/drivers/misc/asus-laptop.c +@@ -139,6 +139,7 @@ ASUS_HANDLE(lcd_switch, "\\_SB.PCI0.SBRG + "\\_SB.PCI0.PX40.ECD0._Q10", /* L3C */ + "\\_SB.PCI0.PX40.EC0.Q10", /* M1A */ + "\\_SB.PCI0.LPCB.EC0._Q10", /* P30 */ ++ "\\_SB.PCI0.LPCB.EC0._Q0E", /* P30/P35 */ + "\\_SB.PCI0.PX40.Q10", /* S1x */ + "\\Q10"); /* A2x, L2D, L3D, M2E */ + diff --git a/queue-2.6.27/asus-laptop-fix-the-led-behavior-with-value-1.patch b/queue-2.6.27/asus-laptop-fix-the-led-behavior-with-value-1.patch new file mode 100644 index 00000000000..c2b88088983 --- /dev/null +++ b/queue-2.6.27/asus-laptop-fix-the-led-behavior-with-value-1.patch @@ -0,0 +1,31 @@ +From e3deda9c87ac5eef2b5d18cd0b5511370979ca26 Mon Sep 17 00:00:00 2001 +From: Corentin Chary +Date: Wed, 24 Sep 2008 10:35:55 +0200 +Subject: asus-laptop: Fix the led behavior with value > 1 + +From: Corentin Chary + +commit e3deda9c87ac5eef2b5d18cd0b5511370979ca26 upstream. + +Fix http://bugzilla.kernel.org/show_bug.cgi?id=11613 . + +Signed-off-by: Corentin Chary +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/asus-laptop.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/misc/asus-laptop.c ++++ b/drivers/misc/asus-laptop.c +@@ -351,7 +351,7 @@ static void write_status(acpi_handle han + static void object##_led_set(struct led_classdev *led_cdev, \ + enum led_brightness value) \ + { \ +- object##_led_wk = value; \ ++ object##_led_wk = (value > 0) ? 1 : 0; \ + queue_work(led_workqueue, &object##_led_work); \ + } \ + static void object##_led_update(struct work_struct *ignored) \ diff --git a/queue-2.6.27/cpuidle-add-decaying-history-logic-to-menu-idle-predictor.patch b/queue-2.6.27/cpuidle-add-decaying-history-logic-to-menu-idle-predictor.patch new file mode 100644 index 00000000000..5e96d67f530 --- /dev/null +++ b/queue-2.6.27/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.27/cpuidle-update-the-last_state-acpi-cpuidle-reflecting-actual-state-entered.patch b/queue-2.6.27/cpuidle-update-the-last_state-acpi-cpuidle-reflecting-actual-state-entered.patch new file mode 100644 index 00000000000..46de0c1ae44 --- /dev/null +++ b/queue-2.6.27/cpuidle-update-the-last_state-acpi-cpuidle-reflecting-actual-state-entered.patch @@ -0,0 +1,34 @@ +From trenn@suse.de Tue Feb 3 14:51:29 2009 +From: Venkatesh Pallipadi +Date: Tue, 27 Jan 2009 17:38:43 +0100 +Subject: cpuidle: update the last_state acpi cpuidle reflecting actual state entered +To: stable@kernel.org +Cc: Len Brown , Venkatesh Pallipadi +Message-ID: <1233074343-23414-2-git-send-email-trenn@suse.de> + +From: Venkatesh Pallipadi + +commit addbad46ed0906cd584784423b9d0babc7476446 + +reflect the actual state entered in dev->last_state, when actaul state entered +is different from intended one. + +Signed-off-by: Venkatesh Pallipadi +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/processor_idle.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/acpi/processor_idle.c ++++ b/drivers/acpi/processor_idle.c +@@ -1587,6 +1587,7 @@ static int acpi_idle_enter_bm(struct cpu + + if (acpi_idle_bm_check()) { + if (dev->safe_state) { ++ dev->last_state = dev->safe_state; + return dev->safe_state->enter(dev, dev->safe_state); + } else { + local_irq_disable(); diff --git a/queue-2.6.27/cpuidle-upon-bios-bug-default-to-default_idle-rather-than-polling.patch b/queue-2.6.27/cpuidle-upon-bios-bug-default-to-default_idle-rather-than-polling.patch new file mode 100644 index 00000000000..a587fc848b9 --- /dev/null +++ b/queue-2.6.27/cpuidle-upon-bios-bug-default-to-default_idle-rather-than-polling.patch @@ -0,0 +1,50 @@ +From trenn@suse.de Tue Feb 3 14:52:29 2009 +From: Venkatesh Pallipadi +Date: Tue, 27 Jan 2009 17:38:44 +0100 +Subject: cpuidle: upon BIOS bug, default to default_idle rather than polling +To: stable@kernel.org +Cc: Len Brown , Venkatesh Pallipadi +Message-ID: <1233074343-23414-3-git-send-email-trenn@suse.de> + +From: Venkatesh Pallipadi + +commit 89cedfefca1d446ee2598fd3bcbb23ee3802e26a upstream + +http://bugzilla.kernel.org/show_bug.cgi?id=11345 + +Signed-off-by: Venkatesh Pallipadi +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/Kconfig | 3 +++ + drivers/cpuidle/cpuidle.c | 4 ++++ + 2 files changed, 7 insertions(+) + +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -123,6 +123,9 @@ config GENERIC_TIME_VSYSCALL + config ARCH_HAS_CPU_RELAX + def_bool y + ++config ARCH_HAS_DEFAULT_IDLE ++ def_bool y ++ + config ARCH_HAS_CACHE_LINE_SIZE + def_bool y + +--- a/drivers/cpuidle/cpuidle.c ++++ b/drivers/cpuidle/cpuidle.c +@@ -56,7 +56,11 @@ static void cpuidle_idle_call(void) + if (pm_idle_old) + pm_idle_old(); + else ++#if defined(CONFIG_ARCH_HAS_DEFAULT_IDLE) ++ default_idle(); ++#else + local_irq_enable(); ++#endif + return; + } + diff --git a/queue-2.6.27/cpuidle-use-last_state-which-can-reflect-the-actual-state-entered.patch b/queue-2.6.27/cpuidle-use-last_state-which-can-reflect-the-actual-state-entered.patch new file mode 100644 index 00000000000..f788d704149 --- /dev/null +++ b/queue-2.6.27/cpuidle-use-last_state-which-can-reflect-the-actual-state-entered.patch @@ -0,0 +1,48 @@ +From trenn@suse.de Tue Feb 3 14:54:29 2009 +From: Venkatesh Pallipadi +Date: Tue, 27 Jan 2009 17:38:45 +0100 +Subject: cpuidle: use last_state which can reflect the actual state entered +To: stable@kernel.org +Cc: Len Brown , Venkatesh Pallipadi +Message-ID: <1233074343-23414-4-git-send-email-trenn@suse.de> + + +From: Venkatesh Pallipadi + +commit 887e301aa1105326f1412a98749024263b1031c7 upstream + +cpuidle accounts the idle time for the C-state it was trying to enter and +not to the actual state that the driver eventually entered. The driver may +select a different state than the one chosen by cpuidle due to +constraints like bus-mastering, etc. + +Change the time acounting code to look at the dev->last_state after +returning from target_state->enter(). Driver can modify dev->last_state +internally, inside the enter routine to reflect the actual C-state +entered. + +Signed-off-by: Venkatesh Pallipadi +Tested-by: Kevin Hilman +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/cpuidle/cpuidle.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/cpuidle/cpuidle.c ++++ b/drivers/cpuidle/cpuidle.c +@@ -71,8 +71,11 @@ static void cpuidle_idle_call(void) + target_state = &dev->states[next_state]; + + /* enter the state and update stats */ +- dev->last_residency = target_state->enter(dev, target_state); + dev->last_state = target_state; ++ dev->last_residency = target_state->enter(dev, target_state); ++ if (dev->last_state) ++ target_state = dev->last_state; ++ + target_state->time += (unsigned long long)dev->last_residency; + target_state->usage++; + diff --git a/queue-2.6.27/don-t-load-asus-acpi-if-model-is-not-supported.patch b/queue-2.6.27/don-t-load-asus-acpi-if-model-is-not-supported.patch new file mode 100644 index 00000000000..48a6c91c1d3 --- /dev/null +++ b/queue-2.6.27/don-t-load-asus-acpi-if-model-is-not-supported.patch @@ -0,0 +1,32 @@ +From 7745384080ef70f7710530afa3e45477b126e056 Mon Sep 17 00:00:00 2001 +From: Zhang Rui +Date: Fri, 17 Oct 2008 01:42:41 -0400 +Subject: don't load asus-acpi if model is not supported + +From: Zhang Rui + +commit 7745384080ef70f7710530afa3e45477b126e056 upstream. + +asus_hotk_get_info should return -ENODEV if the model is not supported. +http://bugzilla.kernel.org/show_bug.cgi?id=10389 + +Signed-off-by: Zhang Rui +Signed-off-by: Len Brown +Cc: Thomas Renninger +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/acpi/asus_acpi.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/acpi/asus_acpi.c ++++ b/drivers/acpi/asus_acpi.c +@@ -1244,6 +1244,8 @@ static int asus_hotk_get_info(void) + "default values\n", string); + printk(KERN_NOTICE + " send /proc/acpi/dsdt to the developers\n"); ++ kfree(model); ++ return -ENODEV; + } + hotk->methods = &model_conf[hotk->model]; + return AE_OK; diff --git a/queue-2.6.27/newly-inserted-battery-might-differ-from-one-just-removed-so.patch b/queue-2.6.27/newly-inserted-battery-might-differ-from-one-just-removed-so.patch new file mode 100644 index 00000000000..229c5048896 --- /dev/null +++ b/queue-2.6.27/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 +@@ -472,7 +472,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; +@@ -483,7 +483,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.27/series b/queue-2.6.27/series index 421a0eecb4f..1729b72ac19 100644 --- a/queue-2.6.27/series +++ b/queue-2.6.27/series @@ -13,3 +13,24 @@ nfsd-ensure-nfsv4-calls-the-underlying-filesystem-on-lockt.patch nfsd-only-set-file_lock.fl_lmops-in-nfsd4_lockt-if-a-stateowner-is-found.patch pci-irq-and-pci_ids-patch-for-intel-tigerpoint-deviceids.patch sata_nv-fix-mcp5x-reset.patch +usb-isp1760-fix-probe-in-pci-glue-code.patch +x86-fix-page-attribute-corruption-with-cpa.patch +cpuidle-update-the-last_state-acpi-cpuidle-reflecting-actual-state-entered.patch +cpuidle-upon-bios-bug-default-to-default_idle-rather-than-polling.patch +cpuidle-use-last_state-which-can-reflect-the-actual-state-entered.patch +cpuidle-add-decaying-history-logic-to-menu-idle-predictor.patch +acpi-avoid-array-address-overflow-when-_cst-mwait-hint-bits-are-set.patch +acpi-attach-the-acpi-device-to-the-acpi-handle-as-early-as-possible.patch +acpica-fixed-a-couple-memory-leaks-associated-with-implicit-return.patch +acpica-add-check-for-invalid-handle-in-acpi_get_object_info.patch +acpi-change-acpi_evaluate_integer-to-support-64-bit-on-32-bit-kernels.patch +acpi-fix-compiler-warnings-introduced-by-32-to-64-bit-acpi-conversions.patch +acpi-ec-fix-regression-due-to-use-of-uninitialized-variable.patch +acpica-fix-wrong-resource-descriptor-length-for-64-bit-build.patch +asus-laptop-add-support-for-p30-p35.patch +asus-laptop-fix-the-led-behavior-with-value-1.patch +video-always-update-the-brightness-when-poking-brightness.patch +don-t-load-asus-acpi-if-model-is-not-supported.patch +newly-inserted-battery-might-differ-from-one-just-removed-so.patch +acpi-do-not-modify-sci_en-directly.patch +acpi-suspend-blacklist-hp-xw4600-workstation-for-old-code-ordering.patch diff --git a/queue-2.6.27/usb-isp1760-fix-probe-in-pci-glue-code.patch b/queue-2.6.27/usb-isp1760-fix-probe-in-pci-glue-code.patch new file mode 100644 index 00000000000..8ab848d95aa --- /dev/null +++ b/queue-2.6.27/usb-isp1760-fix-probe-in-pci-glue-code.patch @@ -0,0 +1,189 @@ +From stefan.bader@canonical.com Tue Feb 3 14:48:28 2009 +From: Karl Bongers +Date: Thu, 29 Jan 2009 18:37:38 +0100 +Subject: USB: isp1760: Fix probe in PCI glue code +To: stable@kernel.org +Message-ID: <4981E962.1020507@canonical.com> + +From: Karl Bongers + +This is the backported version of the upstream commit +Stefan Bader did the backport + +Contains fixes so probe on x86 PCI runs, apparently I'm first to try +this. Several fixes to memory access to probe host scratch register. +Previously would bug check on chip_addr var used uninitialized. +Scratch reg write failed in one instance due to 16-bit initial access +mode, so added "& 0x0000ffff" to the readl as fix. +Includes some general cleanup - remove global vars, organize memory map +resource use. + +Signed-off-by: Karl Bongers +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Stefan Bader +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/isp1760-if.c | 96 ++++++++++++++++++++++++------------------ + 1 file changed, 55 insertions(+), 41 deletions(-) + +--- a/drivers/usb/host/isp1760-if.c ++++ b/drivers/usb/host/isp1760-if.c +@@ -129,23 +129,23 @@ static struct of_platform_driver isp1760 + #endif + + #ifdef CONFIG_PCI +-static u32 nxp_pci_io_base; +-static u32 iolength; +-static u32 pci_mem_phy0; +-static u32 length; +-static u8 __iomem *chip_addr; +-static u8 __iomem *iobase; +- + static int __devinit isp1761_pci_probe(struct pci_dev *dev, + const struct pci_device_id *id) + { + u8 latency, limit; + __u32 reg_data; + int retry_count; +- int length; +- int status = 1; + struct usb_hcd *hcd; + unsigned int devflags = 0; ++ int ret_status = 0; ++ ++ resource_size_t pci_mem_phy0; ++ resource_size_t memlength; ++ ++ u8 __iomem *chip_addr; ++ u8 __iomem *iobase; ++ resource_size_t nxp_pci_io_base; ++ resource_size_t iolength; + + if (usb_disabled()) + return -ENODEV; +@@ -168,26 +168,30 @@ static int __devinit isp1761_pci_probe(s + iobase = ioremap_nocache(nxp_pci_io_base, iolength); + if (!iobase) { + printk(KERN_ERR "ioremap #1\n"); +- release_mem_region(nxp_pci_io_base, iolength); +- return -ENOMEM; ++ ret_status = -ENOMEM; ++ goto cleanup1; + } + /* Grab the PLX PCI shared memory of the ISP 1761 we need */ + pci_mem_phy0 = pci_resource_start(dev, 3); +- length = pci_resource_len(dev, 3); +- +- if (length < 0xffff) { +- printk(KERN_ERR "memory length for this resource is less than " +- "required\n"); +- release_mem_region(nxp_pci_io_base, iolength); +- iounmap(iobase); +- return -ENOMEM; ++ memlength = pci_resource_len(dev, 3); ++ if (memlength < 0xffff) { ++ printk(KERN_ERR "memory length for this resource is wrong\n"); ++ ret_status = -ENOMEM; ++ goto cleanup2; + } + +- if (!request_mem_region(pci_mem_phy0, length, "ISP-PCI")) { ++ if (!request_mem_region(pci_mem_phy0, memlength, "ISP-PCI")) { + printk(KERN_ERR "host controller already in use\n"); +- release_mem_region(nxp_pci_io_base, iolength); +- iounmap(iobase); +- return -EBUSY; ++ ret_status = -EBUSY; ++ goto cleanup2; ++ } ++ ++ /* map available memory */ ++ chip_addr = ioremap_nocache(pci_mem_phy0,memlength); ++ if (!chip_addr) { ++ printk(KERN_ERR "Error ioremap failed\n"); ++ ret_status = -ENOMEM; ++ goto cleanup3; + } + + /* bad pci latencies can contribute to overruns */ +@@ -210,38 +214,54 @@ static int __devinit isp1761_pci_probe(s + * */ + writel(0xface, chip_addr + HC_SCRATCH_REG); + udelay(100); +- reg_data = readl(chip_addr + HC_SCRATCH_REG); ++ reg_data = readl(chip_addr + HC_SCRATCH_REG) & 0x0000ffff; + retry_count--; + } + ++ iounmap(chip_addr); ++ + /* Host Controller presence is detected by writing to scratch register + * and reading back and checking the contents are same or not + */ + if (reg_data != 0xFACE) { + err("scratch register mismatch %x", reg_data); +- goto clean; ++ ret_status = -ENOMEM; ++ goto cleanup3; + } + + pci_set_master(dev); + +- status = readl(iobase + 0x68); +- status |= 0x900; +- writel(status, iobase + 0x68); ++ /* configure PLX PCI chip to pass interrupts */ ++#define PLX_INT_CSR_REG 0x68 ++ reg_data = readl(iobase + PLX_INT_CSR_REG); ++ reg_data |= 0x900; ++ writel(reg_data, iobase + PLX_INT_CSR_REG); + + dev->dev.dma_mask = NULL; +- hcd = isp1760_register(pci_mem_phy0, length, dev->irq, ++ hcd = isp1760_register(pci_mem_phy0, memlength, dev->irq, + IRQF_SHARED | IRQF_DISABLED, &dev->dev, dev_name(&dev->dev), + devflags); ++ if (IS_ERR(hcd)) { ++ ret_status = -ENODEV; ++ goto cleanup3; ++ } ++ ++ /* done with PLX IO access */ ++ iounmap(iobase); ++ release_mem_region(nxp_pci_io_base, iolength); ++ + pci_set_drvdata(dev, hcd); +- if (!hcd) +- return 0; +-clean: +- status = -ENODEV; ++ return 0; ++ ++cleanup3: ++ release_mem_region(pci_mem_phy0, memlength); ++cleanup2: + iounmap(iobase); +- release_mem_region(pci_mem_phy0, length); ++cleanup1: + release_mem_region(nxp_pci_io_base, iolength); +- return status; ++ return ret_status; + } ++ + static void isp1761_pci_remove(struct pci_dev *dev) + { + struct usb_hcd *hcd; +@@ -254,12 +274,6 @@ static void isp1761_pci_remove(struct pc + usb_put_hcd(hcd); + + pci_disable_device(dev); +- +- iounmap(iobase); +- iounmap(chip_addr); +- +- release_mem_region(nxp_pci_io_base, iolength); +- release_mem_region(pci_mem_phy0, length); + } + + static void isp1761_pci_shutdown(struct pci_dev *dev) diff --git a/queue-2.6.27/video-always-update-the-brightness-when-poking-brightness.patch b/queue-2.6.27/video-always-update-the-brightness-when-poking-brightness.patch new file mode 100644 index 00000000000..b2ff46260c5 --- /dev/null +++ b/queue-2.6.27/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 +@@ -482,6 +482,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; +@@ -490,6 +491,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; + } + diff --git a/queue-2.6.27/x86-fix-page-attribute-corruption-with-cpa.patch b/queue-2.6.27/x86-fix-page-attribute-corruption-with-cpa.patch new file mode 100644 index 00000000000..43a69ad1cf9 --- /dev/null +++ b/queue-2.6.27/x86-fix-page-attribute-corruption-with-cpa.patch @@ -0,0 +1,138 @@ +From suresh.b.siddha@intel.com Tue Feb 3 14:49:54 2009 +From: Suresh Siddha +Date: Wed, 28 Jan 2009 17:03:01 -0800 +Subject: x86: fix page attribute corruption with cpa() +To: Greg KH +Cc: Ingo Molnar , "stable@kernel.org" , "Pallipadi, Venkatesh" +Message-ID: <1233190981.15801.69.camel@vayu> + + +From: Suresh Siddha + +commit a1e46212a410793d575718818e81ddc442a65283 upstream. + +Impact: fix sporadic slowdowns and warning messages + +This patch fixes a performance issue reported by Linus on his +Nehalem system. While Linus reverted the PAT patch (commit +58dab916dfb57328d50deb0aa9b3fc92efa248ff) which exposed the issue, +existing cpa() code can potentially still cause wrong(page attribute +corruption) behavior. + +This patch also fixes the "WARNING: at arch/x86/mm/pageattr.c:560" that +various people reported. + +In 64bit kernel, kernel identity mapping might have holes depending +on the available memory and how e820 reports the address range +covering the RAM, ACPI, PCI reserved regions. If there is a 2MB/1GB hole +in the address range that is not listed by e820 entries, kernel identity +mapping will have a corresponding hole in its 1-1 identity mapping. + +If cpa() happens on the kernel identity mapping which falls into these +holes, +existing code fails like this: + +__change_page_attr_set_clr() + __change_page_attr() + returns 0 because of if (!kpte). But doesn't + set cpa->numpages and cpa->pfn. + cpa_process_alias() + uses uninitialized cpa->pfn (random value) + which can potentially lead to changing the page + attribute of kernel text/data, kernel identity + mapping of RAM pages etc. oops! + +This bug was easily exposed by another PAT patch which was doing +cpa() more often on kernel identity mapping holes (physical range +between +max_low_pfn_mapped and 4GB), where in here it was setting the +cache disable attribute(PCD) for kernel identity mappings aswell. + +Fix cpa() to handle the kernel identity mapping holes. Retain +the WARN() for cpa() calls to other not present address ranges +(kernel-text/data, ioremap() addresses) + +Signed-off-by: Suresh Siddha +Signed-off-by: Venkatesh Pallipadi +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + + +--- + arch/x86/mm/pageattr.c | 49 ++++++++++++++++++++++++++++++++++--------------- + 1 file changed, 34 insertions(+), 15 deletions(-) + +--- a/arch/x86/mm/pageattr.c ++++ b/arch/x86/mm/pageattr.c +@@ -582,6 +582,36 @@ out_unlock: + return 0; + } + ++static int __cpa_process_fault(struct cpa_data *cpa, unsigned long vaddr, ++ int primary) ++{ ++ /* ++ * Ignore all non primary paths. ++ */ ++ if (!primary) ++ return 0; ++ ++ /* ++ * Ignore the NULL PTE for kernel identity mapping, as it is expected ++ * to have holes. ++ * Also set numpages to '1' indicating that we processed cpa req for ++ * one virtual address page and its pfn. TBD: numpages can be set based ++ * on the initial value and the level returned by lookup_address(). ++ */ ++ if (within(vaddr, PAGE_OFFSET, ++ PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT))) { ++ cpa->numpages = 1; ++ cpa->pfn = __pa(vaddr) >> PAGE_SHIFT; ++ return 0; ++ } else { ++ WARN(1, KERN_WARNING "CPA: called for zero pte. " ++ "vaddr = %lx cpa->vaddr = %lx\n", vaddr, ++ cpa->vaddr); ++ ++ return -EINVAL; ++ } ++} ++ + static int __change_page_attr(struct cpa_data *cpa, int primary) + { + unsigned long address = cpa->vaddr; +@@ -592,17 +622,11 @@ static int __change_page_attr(struct cpa + repeat: + kpte = lookup_address(address, &level); + if (!kpte) +- return 0; ++ return __cpa_process_fault(cpa, address, primary); + + old_pte = *kpte; +- if (!pte_val(old_pte)) { +- if (!primary) +- return 0; +- WARN(1, KERN_WARNING "CPA: called for zero pte. " +- "vaddr = %lx cpa->vaddr = %lx\n", address, +- cpa->vaddr); +- return -EINVAL; +- } ++ if (!pte_val(old_pte)) ++ return __cpa_process_fault(cpa, address, primary); + + if (level == PG_LEVEL_4K) { + pte_t new_pte; +@@ -676,12 +700,7 @@ static int cpa_process_alias(struct cpa_ + * mapping already: + */ + if (!(within(cpa->vaddr, PAGE_OFFSET, +- PAGE_OFFSET + (max_low_pfn_mapped << PAGE_SHIFT)) +-#ifdef CONFIG_X86_64 +- || within(cpa->vaddr, PAGE_OFFSET + (1UL<<32), +- PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT)) +-#endif +- )) { ++ PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT)))) { + + alias_cpa = *cpa; + alias_cpa.vaddr = (unsigned long) __va(cpa->pfn << PAGE_SHIFT); -- 2.47.3