From d0d0f7432c9cbd52cb2f31d499f8292b13a7ecac Mon Sep 17 00:00:00 2001 From: Matt Mackall Date: Thu, 9 Oct 2008 12:41:50 -0500 Subject: x86: remove magic number from ACPI sleep stack buffer x86_64 SMP suspend to RAM uses a 10k temporary stack for saving the kernel state, but only 4k of it is used. Shrink it to 4k. Signed-off-by: Matt Mackall Acked-by: Pavel Machek Signed-off-by: Len Brown --- arch/x86/kernel/acpi/sleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 426e5d91b63..29cf3403abe 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c @@ -97,7 +97,7 @@ int acpi_save_state_mem(void) #else /* CONFIG_64BIT */ header->trampoline_segment = setup_trampoline() >> 4; #ifdef CONFIG_SMP - stack_start.sp = temp_stack + 4096; + stack_start.sp = temp_stack + sizeof(temp_stack); #endif initial_code = (unsigned long)wakeup_long64; saved_magic = 0x123456789abcdef0; -- cgit v1.2.3 From 5000cadcf3188e935dae28c4fc7e24639704ea55 Mon Sep 17 00:00:00 2001 From: Matt Mackall Date: Thu, 9 Oct 2008 11:56:21 -0500 Subject: x86: trim ACPI sleep stack buffer x86_64 SMP suspend to RAM uses a 10k temporary stack for saving the kernel state, but only 4k of it is used. Shrink it to 4k. Signed-off-by: Matt Mackall Signed-off-by: Len Brown --- arch/x86/kernel/acpi/sleep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 29cf3403abe..55d10cbe65b 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c @@ -21,7 +21,7 @@ unsigned long acpi_realmode_flags; static unsigned long acpi_realmode; #if defined(CONFIG_SMP) && defined(CONFIG_64BIT) -static char temp_stack[10240]; +static char temp_stack[4096]; #endif /** -- cgit v1.2.3 From 4b5fcb353ba46adfa2f98546e3d34e7dc65221cb Mon Sep 17 00:00:00 2001 From: Alexey Starikovskiy Date: Wed, 10 Sep 2008 14:33:43 +0400 Subject: ACPI: acpi_driver_data could only be applied to acpi_device Signed-off-by: Alexey Starikovskiy CC: Hannes Reinecke Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown --- drivers/acpi/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index f6f52c1a2ab..e7b8853c310 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -384,7 +384,7 @@ static int acpi_device_remove(struct device * dev) acpi_drv->ops.remove(acpi_dev, acpi_dev->removal_type); } acpi_dev->driver = NULL; - acpi_driver_data(dev) = NULL; + acpi_driver_data(acpi_dev) = NULL; put_device(dev); return 0; -- cgit v1.2.3 From 9e113e0014204bfb44a2baa29b2a141ede41b074 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Mon, 22 Sep 2008 14:37:29 -0700 Subject: ACPI: toshiba_acpi.c fix sparse signedness mismatch warnings set_bit expects unsigned int, and we start with a u32 anyway. drivers/acpi/toshiba_acpi.c:397:14: warning: incorrect type in argument 1 (different signedness) drivers/acpi/toshiba_acpi.c:397:14: expected unsigned int [usertype] *word drivers/acpi/toshiba_acpi.c:397:14: got int * drivers/acpi/toshiba_acpi.c:399:14: warning: incorrect type in argument 1 (different signedness) drivers/acpi/toshiba_acpi.c:399:14: expected unsigned int [usertype] *word drivers/acpi/toshiba_acpi.c:399:14: got int * drivers/acpi/toshiba_acpi.c:401:14: warning: incorrect type in argument 1 (different signedness) drivers/acpi/toshiba_acpi.c:401:14: expected unsigned int [usertype] *word drivers/acpi/toshiba_acpi.c:401:14: got int * Signed-off-by: Harvey Harrison Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/toshiba_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c index 0a43c8e0eff..4172d290f27 100644 --- a/drivers/acpi/toshiba_acpi.c +++ b/drivers/acpi/toshiba_acpi.c @@ -392,7 +392,7 @@ static unsigned long write_video(const char *buffer, unsigned long count) hci_read1(HCI_VIDEO_OUT, &video_out, &hci_result); if (hci_result == HCI_SUCCESS) { - int new_video_out = video_out; + unsigned int new_video_out = video_out; if (lcd_out != -1) _set_bit(&new_video_out, HCI_VIDEO_OUT_LCD, lcd_out); if (crt_out != -1) -- cgit v1.2.3 From db89b4f0dbab837d0f3de2c3e9427a8d5393afa3 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 22 Sep 2008 14:37:34 -0700 Subject: ACPI: catch calls of acpi_driver_data on pointer of wrong type Catch attempts to use of acpi_driver_data on pointers of wrong type. akpm: rewritten to use proper C typechecking and remove the "function"-used-as-lvalue thing. Signed-off-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/ac.c | 2 +- drivers/acpi/acpi_memhotplug.c | 2 +- drivers/acpi/asus_acpi.c | 2 +- drivers/acpi/battery.c | 2 +- drivers/acpi/button.c | 2 +- drivers/acpi/container.c | 2 +- drivers/acpi/ec.c | 4 ++-- drivers/acpi/fan.c | 2 +- drivers/acpi/pci_link.c | 2 +- drivers/acpi/pci_root.c | 2 +- drivers/acpi/power.c | 4 ++-- drivers/acpi/processor_core.c | 2 +- drivers/acpi/sbs.c | 2 +- drivers/acpi/sbshc.c | 4 ++-- drivers/acpi/scan.c | 4 ++-- drivers/acpi/thermal.c | 2 +- drivers/acpi/video.c | 6 +++--- drivers/misc/asus-laptop.c | 2 +- drivers/misc/eeepc-laptop.c | 2 +- drivers/misc/fujitsu-laptop.c | 4 ++-- drivers/misc/intel_menlow.c | 2 +- drivers/misc/thinkpad_acpi.c | 2 +- include/acpi/acpi_bus.h | 6 +++++- 23 files changed, 34 insertions(+), 30 deletions(-) diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 831883b7d6c..8b6a84a43b1 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -269,7 +269,7 @@ static int acpi_ac_add(struct acpi_device *device) ac->device = device; strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_AC_CLASS); - acpi_driver_data(device) = ac; + device->driver_data = ac; result = acpi_ac_get_state(ac); if (result) diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 5f1127ad5a9..afd955fc0dc 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@ -403,7 +403,7 @@ static int acpi_memory_device_add(struct acpi_device *device) mem_device->device = device; sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME); sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS); - acpi_driver_data(device) = mem_device; + device->driver_data = mem_device; /* Get the range from the _CRS */ result = acpi_memory_get_device_resources(mem_device); diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index d3d0886d637..91571fc0f17 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c @@ -1321,7 +1321,7 @@ static int asus_hotk_add(struct acpi_device *device) hotk->handle = device->handle; strcpy(acpi_device_name(device), ACPI_HOTK_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_HOTK_CLASS); - acpi_driver_data(device) = hotk; + device->driver_data = hotk; hotk->device = device; result = asus_hotk_check(); diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index b1c723f9f58..de8046933bc 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -804,7 +804,7 @@ static int acpi_battery_add(struct acpi_device *device) battery->device = device; strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); - acpi_driver_data(device) = battery; + device->driver_data = battery; mutex_init(&battery->lock); acpi_battery_update(battery); #ifdef CONFIG_ACPI_PROCFS_POWER diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 1dfec413588..e22033ea261 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -384,7 +384,7 @@ static int acpi_button_add(struct acpi_device *device) return -ENOMEM; button->device = device; - acpi_driver_data(device) = button; + device->driver_data = button; button->input = input = input_allocate_device(); if (!input) { diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c index 3c25ec7a187..03ea8478e39 100644 --- a/drivers/acpi/container.c +++ b/drivers/acpi/container.c @@ -108,7 +108,7 @@ static int acpi_container_add(struct acpi_device *device) container->handle = device->handle; strcpy(acpi_device_name(device), ACPI_CONTAINER_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_CONTAINER_CLASS); - acpi_driver_data(device) = container; + device->driver_data = container; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n", acpi_device_name(device), acpi_device_bid(device))); diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 13593f9f219..5741d99d603 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -788,7 +788,7 @@ static int acpi_ec_add(struct acpi_device *device) if (!first_ec) first_ec = ec; - acpi_driver_data(device) = ec; + device->driver_data = ec; acpi_ec_add_fs(device); pr_info(PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx\n", ec->gpe, ec->command_addr, ec->data_addr); @@ -813,7 +813,7 @@ static int acpi_ec_remove(struct acpi_device *device, int type) } mutex_unlock(&ec->lock); acpi_ec_remove_fs(device); - acpi_driver_data(device) = NULL; + device->driver_data = NULL; if (ec == first_ec) first_ec = NULL; kfree(ec); diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 2655bc1b4ee..e603e407070 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c @@ -265,7 +265,7 @@ static int acpi_fan_add(struct acpi_device *device) dev_info(&device->dev, "registered as cooling_device%d\n", cdev->id); - acpi_driver_data(device) = cdev; + device->driver_data = cdev; result = sysfs_create_link(&device->dev.kobj, &cdev->device.kobj, "thermal_cooling"); diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index cf47805a744..54cd77a0a78 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -737,7 +737,7 @@ static int acpi_pci_link_add(struct acpi_device *device) link->device = device; strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); - acpi_driver_data(device) = link; + device->driver_data = link; mutex_lock(&acpi_link_lock); result = acpi_pci_link_get_possible(link); diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index c3fed31166b..add1a19bbbf 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -206,7 +206,7 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) root->device = device; strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); - acpi_driver_data(device) = root; + device->driver_data = root; device->ops.bind = acpi_pci_bind; diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 4ab21cb1c8c..1bef9429189 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -657,7 +657,7 @@ static int acpi_power_add(struct acpi_device *device) strcpy(resource->name, device->pnp.bus_id); strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_POWER_CLASS); - acpi_driver_data(device) = resource; + device->driver_data = resource; /* Evalute the object to get the system level and resource order. */ status = acpi_evaluate_object(device->handle, NULL, NULL, &buffer); @@ -733,7 +733,7 @@ static int acpi_power_resume(struct acpi_device *device) if (!device || !acpi_driver_data(device)) return -EINVAL; - resource = (struct acpi_power_resource *)acpi_driver_data(device); + resource = acpi_driver_data(device); result = acpi_power_get_state(resource, &state); if (result) diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index ee68ac54c0d..28946164919 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -818,7 +818,7 @@ static int acpi_processor_add(struct acpi_device *device) pr->handle = device->handle; strcpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS); - acpi_driver_data(device) = pr; + device->driver_data = pr; return 0; } diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index 10a36512647..d0033250b5a 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -931,7 +931,7 @@ static int acpi_sbs_add(struct acpi_device *device) sbs->device = device; strcpy(acpi_device_name(device), ACPI_SBS_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_SBS_CLASS); - acpi_driver_data(device) = sbs; + device->driver_data = sbs; result = acpi_charger_add(sbs); if (result) diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c index a4e3767b8c6..001d9143a2c 100644 --- a/drivers/acpi/sbshc.c +++ b/drivers/acpi/sbshc.c @@ -282,7 +282,7 @@ static int acpi_smbus_hc_add(struct acpi_device *device) hc->ec = acpi_driver_data(device->parent); hc->offset = (val >> 8) & 0xff; hc->query_bit = val & 0xff; - acpi_driver_data(device) = hc; + device->driver_data = hc; acpi_ec_add_query_handler(hc->ec, hc->query_bit, NULL, smbus_alarm, hc); printk(KERN_INFO PREFIX "SBS HC: EC = 0x%p, offset = 0x%0x, query_bit = 0x%0x\n", @@ -303,7 +303,7 @@ static int acpi_smbus_hc_remove(struct acpi_device *device, int type) hc = acpi_driver_data(device); acpi_ec_remove_query_handler(hc->ec, hc->query_bit); kfree(hc); - acpi_driver_data(device) = NULL; + device->driver_data = NULL; return 0; } diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index e7b8853c310..b88536ab040 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -384,7 +384,7 @@ static int acpi_device_remove(struct device * dev) acpi_drv->ops.remove(acpi_dev, acpi_dev->removal_type); } acpi_dev->driver = NULL; - acpi_driver_data(acpi_dev) = NULL; + acpi_dev->driver_data = NULL; put_device(dev); return 0; @@ -537,7 +537,7 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver) result = driver->ops.add(device); if (result) { device->driver = NULL; - acpi_driver_data(device) = NULL; + device->driver_data = NULL; return result; } diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 912703691d3..e052a75c29c 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -1647,7 +1647,7 @@ static int acpi_thermal_add(struct acpi_device *device) strcpy(tz->name, device->pnp.bus_id); strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS); - acpi_driver_data(device) = tz; + device->driver_data = tz; mutex_init(&tz->lock); diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index e8a51a1700f..85c6554bcb4 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -1491,7 +1491,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device, strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); - acpi_driver_data(device) = data; + device->driver_data = data; data->device_id = device_id; data->video = video; @@ -1982,7 +1982,7 @@ static int acpi_video_bus_add(struct acpi_device *device) video->device = device; strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); - acpi_driver_data(device) = video; + device->driver_data = video; acpi_video_bus_find_cap(video); error = acpi_video_bus_check(video); @@ -2058,7 +2058,7 @@ static int acpi_video_bus_add(struct acpi_device *device) acpi_video_bus_remove_fs(device); err_free_video: kfree(video); - acpi_driver_data(device) = NULL; + device->driver_data = NULL; return error; } diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c index 7c6dfd03de9..de82f2f5a81 100644 --- a/drivers/misc/asus-laptop.c +++ b/drivers/misc/asus-laptop.c @@ -996,7 +996,7 @@ static int asus_hotk_add(struct acpi_device *device) hotk->handle = device->handle; strcpy(acpi_device_name(device), ASUS_HOTK_DEVICE_NAME); strcpy(acpi_device_class(device), ASUS_HOTK_CLASS); - acpi_driver_data(device) = hotk; + device->driver_data = hotk; hotk->device = device; result = asus_hotk_check(); diff --git a/drivers/misc/eeepc-laptop.c b/drivers/misc/eeepc-laptop.c index 1ee8501e90f..c1247056116 100644 --- a/drivers/misc/eeepc-laptop.c +++ b/drivers/misc/eeepc-laptop.c @@ -411,7 +411,7 @@ static int eeepc_hotk_add(struct acpi_device *device) ehotk->handle = device->handle; strcpy(acpi_device_name(device), EEEPC_HOTK_DEVICE_NAME); strcpy(acpi_device_class(device), EEEPC_HOTK_CLASS); - acpi_driver_data(device) = ehotk; + device->driver_data = ehotk; ehotk->device = device; result = eeepc_hotk_check(); if (result) diff --git a/drivers/misc/fujitsu-laptop.c b/drivers/misc/fujitsu-laptop.c index 3e56203e494..7b69cfb7de5 100644 --- a/drivers/misc/fujitsu-laptop.c +++ b/drivers/misc/fujitsu-laptop.c @@ -490,7 +490,7 @@ static int acpi_fujitsu_add(struct acpi_device *device) fujitsu->acpi_handle = device->handle; sprintf(acpi_device_name(device), "%s", ACPI_FUJITSU_DEVICE_NAME); sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS); - acpi_driver_data(device) = fujitsu; + device->driver_data = fujitsu; status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, @@ -703,7 +703,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) sprintf(acpi_device_name(device), "%s", ACPI_FUJITSU_HOTKEY_DEVICE_NAME); sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS); - acpi_driver_data(device) = fujitsu_hotkey; + device->driver_data = fujitsu_hotkey; status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, diff --git a/drivers/misc/intel_menlow.c b/drivers/misc/intel_menlow.c index 80a13635240..cd3ea7faa5b 100644 --- a/drivers/misc/intel_menlow.c +++ b/drivers/misc/intel_menlow.c @@ -175,7 +175,7 @@ static int intel_menlow_memory_add(struct acpi_device *device) goto end; } - acpi_driver_data(device) = cdev; + device->driver_data = cdev; result = sysfs_create_link(&device->dev.kobj, &cdev->device.kobj, "thermal_cooling"); if (result) diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 6b9300779a4..62aebaa8591 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -543,7 +543,7 @@ static int __init setup_acpi_notify(struct ibm_struct *ibm) return -ENODEV; } - acpi_driver_data(ibm->acpi->device) = ibm; + ibm->acpi->device->driver_data = ibm; sprintf(acpi_device_class(ibm->acpi->device), "%s/%s", TPACPI_ACPI_EVENT_PREFIX, ibm->name); diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index a5ac0bc7f52..47682465f1f 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -300,7 +300,11 @@ struct acpi_device { enum acpi_bus_removal_type removal_type; /* indicate for different removal type */ }; -#define acpi_driver_data(d) ((d)->driver_data) +static inline void *acpi_driver_data(struct acpi_device *d) +{ + return d->driver_data; +} + #define to_acpi_device(d) container_of(d, struct acpi_device, dev) #define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) -- cgit v1.2.3 From b3cef8f6eba47a10b80aa3e7a99e27110e34f3df Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Fri, 19 Sep 2008 14:06:59 -0700 Subject: toshiba_acpi: depends on INPUT CONFIG_ACPI_TOSHIBA can =y when CONFIG_INPUT=m, so prevent that combination and its subsequent build errors: toshiba_acpi.c:(.text+0x3e877): undefined reference to `input_event' toshiba_acpi.c:(.text+0x3e98a): undefined reference to `input_unregister_polled_device' toshiba_acpi.c:(.text+0x3e994): undefined reference to `input_free_polled_device' toshiba_acpi.c:(.init.text+0x21b4): undefined reference to `input_allocate_polled_device' toshiba_acpi.c:(.init.text+0x2263): undefined reference to `input_register_polled_device' make[1]: *** [.tmp_vmlinux1] Error 1 Signed-off-by: Randy Dunlap Signed-off-by: Len Brown --- drivers/acpi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 735f5ea1747..79540db2980 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -259,7 +259,7 @@ config ACPI_ASUS config ACPI_TOSHIBA tristate "Toshiba Laptop Extras" - depends on X86 + depends on X86 && INPUT select BACKLIGHT_CLASS_DEVICE ---help--- This driver adds support for access to certain system settings -- cgit v1.2.3 From 1339c367a842a9fc34b8fcfa1abadb07b11848ad Mon Sep 17 00:00:00 2001 From: Pavel Vasilyev Date: Wed, 15 Oct 2008 17:33:48 -0400 Subject: fix CONFIG_MMCONFIG=n build warning arch/x86/kernel/acpi/boot.c:100: warning: 'acpi_mcfg_64bit_base_addr' defined but not used http://bugzilla.kernel.org/show_bug.cgi?id=11743 Signed-off-by: Pavel Vasilyev Signed-off-by: Len Brown --- arch/x86/kernel/acpi/boot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index c102af85df9..0c2742f8c4d 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -97,7 +97,6 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; #warning ACPI uses CMPXCHG, i486 and later hardware #endif -static int acpi_mcfg_64bit_base_addr __initdata = FALSE; /* -------------------------------------------------------------------------- Boot-time Configuration @@ -156,6 +155,9 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size) } #ifdef CONFIG_PCI_MMCONFIG + +static int acpi_mcfg_64bit_base_addr __initdata = FALSE; + /* The physical address of the MMCONFIG aperture. Set from ACPI tables. */ struct acpi_mcfg_allocation *pci_mmcfg_config; int pci_mmcfg_config_num; -- cgit v1.2.3 From 0ef9cff15d47b296d4a7feecf36e7989cebf9a33 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 16 Oct 2008 15:15:35 -0400 Subject: sony-laptop: newline-terminate the printk for backlight change failure Signed-off-by: Adam Jackson Signed-off-by: Len Brown --- drivers/misc/sony-laptop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 60775be2282..5a97d3a9d74 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c @@ -970,7 +970,7 @@ static int sony_nc_resume(struct acpi_device *device) /* set the last requested brightness level */ if (sony_backlight_device && !sony_backlight_update_status(sony_backlight_device)) - printk(KERN_WARNING DRV_PFX "unable to restore brightness level"); + printk(KERN_WARNING DRV_PFX "unable to restore brightness level\n"); /* re-initialize models with specific requirements */ dmi_check_system(sony_nc_ids); -- cgit v1.2.3 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 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 --- drivers/acpi/asus_acpi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index 91571fc0f17..428e47b1ca6 100644 --- 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; -- cgit v1.2.3 From 22a94d79a34bf010d11996d30eed8ee3fc1a4fbf Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Fri, 17 Oct 2008 02:41:20 -0400 Subject: ACPI: Allow overriding to higher critical trip point. http://bugzilla.kernel.org/show_bug.cgi?id=9129 lenb: Note that overriding a critical trip point may simply fool the user into thinking that they have control that they do not actually have. For it is EC firmware that decides when the EC sends Linux temperature change events, and the EC may or may not decide to send Linux these events anywhere in the neighborhood of the fake override trip points. Beware. note also that thermal.nocrt is already available to disable crtical trip point actios, and thermal.crt=-1 is already available to disabled critical trip points entirely. Signed-off-by: Zhang Rui Signed-off-by: Len Brown --- Documentation/kernel-parameters.txt | 2 +- drivers/acpi/thermal.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 1150444a21a..070742360a2 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -2146,7 +2146,7 @@ and is between 256 and 4096 characters. It is defined in the file thermal.crt= [HW,ACPI] -1: disable all critical trip points in all thermal zones - : lower all critical trip points + : override all critical trip points thermal.nocrt= [HW,ACPI] Set to disable actions on ACPI thermal zone diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index e052a75c29c..e9e17dfc5dc 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -388,10 +388,12 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) } else if (crt > 0) { unsigned long crt_k = CELSIUS_TO_KELVIN(crt); /* - * Allow override to lower critical threshold + * Allow override critical threshold */ - if (crt_k < tz->trips.critical.temperature) - tz->trips.critical.temperature = crt_k; + if (crt_k > tz->trips.critical.temperature) + printk(KERN_WARNING PREFIX + "Critical threshold %d C\n", crt); + tz->trips.critical.temperature = crt_k; } } } -- cgit v1.2.3 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 Add support for P30/P35. http://bugzilla.kernel.org/show_bug.cgi?id=10848 Signed-off-by: Corentin Chary Signed-off-by: Len Brown --- drivers/misc/asus-laptop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c index de82f2f5a81..df82cda8769 100644 --- a/drivers/misc/asus-laptop.c +++ b/drivers/misc/asus-laptop.c @@ -139,6 +139,7 @@ ASUS_HANDLE(lcd_switch, "\\_SB.PCI0.SBRG.EC0._Q10", /* All new models */ "\\_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 */ -- cgit v1.2.3 From 5d1e072b6b9cffebefa681faca1c6d608310d4b2 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Wed, 22 Oct 2008 14:58:43 -0400 Subject: ACPI suspend: Fix CONFIG_ACPI_SLEEP dependence and some compilation warnings Initially CONFIG_PM_SLEEP was defined as CONFIG_SUSPEND || CONFIG_HIBERNATION and some ACPI code, most importantly the code in drivers/acpi/main.c, was written with this assumption. Currently, however, CONFIG_PM_SLEEP is also set when CONFIG_XEN_SAVE_RESTORE is set. This causes some compilation warnings to appear in drivers/acpi/main.c if both CONFIG_SUSPEND and CONFIG_HIBERNATION are unset and CONFIG_PM_SLEEP is set (this was impossible before). To fix this problem, redefine CONFIG_ACPI_SLEEP do depend directly on CONFIG_SUSPEND || CONFIG_HIBERNATION, as originally intended, and use it instead of CONFIG_PM_SLEEP in drivers/acpi/main.c, wherever appropriate. Additionally, move the acpi_target_sleep_state definition from under the #ifdef to prevent compilation from failing in some cases. Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- drivers/acpi/Kconfig | 2 +- drivers/acpi/sleep/main.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 79540db2980..325b4b5fa7d 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -42,7 +42,7 @@ if ACPI config ACPI_SLEEP bool - depends on PM_SLEEP + depends on SUSPEND || HIBERNATION default y config ACPI_PROCFS diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index d13194a031b..4c21480b582 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c @@ -23,6 +23,7 @@ #include "sleep.h" u8 sleep_states[ACPI_S_STATE_COUNT]; +static u32 acpi_target_sleep_state = ACPI_STATE_S0; static int acpi_sleep_prepare(u32 acpi_state) { @@ -45,9 +46,7 @@ static int acpi_sleep_prepare(u32 acpi_state) return 0; } -#ifdef CONFIG_PM_SLEEP -static u32 acpi_target_sleep_state = ACPI_STATE_S0; - +#ifdef CONFIG_ACPI_SLEEP /* * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the * user to request that behavior by using the 'acpi_old_suspend_ordering' @@ -132,7 +131,7 @@ static void acpi_pm_end(void) */ acpi_target_sleep_state = ACPI_STATE_S0; } -#endif /* CONFIG_PM_SLEEP */ +#endif /* CONFIG_ACPI_SLEEP */ #ifdef CONFIG_SUSPEND extern void do_suspend_lowlevel(void); -- cgit v1.2.3 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 Fix http://bugzilla.kernel.org/show_bug.cgi?id=11613 . Signed-off-by: Corentin Chary Signed-off-by: Len Brown --- drivers/misc/asus-laptop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c index df82cda8769..57d81c713ea 100644 --- a/drivers/misc/asus-laptop.c +++ b/drivers/misc/asus-laptop.c @@ -351,7 +351,7 @@ static void write_status(acpi_handle handle, int out, int mask) 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) \ -- cgit v1.2.3