Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (32 commits)
ACPI: thermal: show temperature in millidegree Celsius
thermal: fix generic thermal I/F for hwmon
acer-wmi: build depends on i8042
documentation: Move power-related files to Documentation/power/
ACPI: buffer array too short in drivers/acpi/system.c
acer-wmi: Add DMI quirk for mail LED support on Acer Aspire 3610/ 5610
acer-wmi: Fix DSDT path in documentation
acer-wmi: Make device detection error messages more descriptive
laptops: move laptop-mode.txt to Documentation/laptops/
ACPICA: Warn if packages with invalid references are evaluated
ACPI: add _PRT quirks to work around broken firmware
Hibernation: Fix mark_nosave_pages()
ACPI: Ignore _BQC object when registering backlight device
ACPI: WMI: Clean up handling of spec violating data blocks
acer-wmi: Don't warn if mail LED cannot be detected
acer-wmi: Rename mail LED correctly & remove hardcoded colour
ACPI: use ACPI_DEBUG_PRINT instead of printk in acpi_processor_hotplug_notify()
ACPI: button: make real parent for input devices in device tree
toshiba_acpi: Enable autoloading
ACPI: EC: Handle IRQ storm on Acer laptops
...

+426 -126
-6
Documentation/00-INDEX
··· 225 225 - documents the kernel probes debugging feature. 226 226 kref.txt 227 227 - docs on adding reference counters (krefs) to kernel objects. 228 - laptop-mode.txt 229 - - how to conserve battery power using laptop-mode. 230 228 laptops/ 231 229 - directory with laptop related info and laptop driver documentation. 232 230 ldm.txt ··· 299 301 - info on the Linux PCMCIA driver. 300 302 pi-futex.txt 301 303 - documentation on lightweight PI-futexes. 302 - pm.txt 303 - - info on Linux power management support. 304 304 pnp.txt 305 305 - Linux Plug and Play documentation. 306 - power_supply_class.txt 307 - - Tells userspace about battery, UPS, AC or DC power supply properties 308 306 power/ 309 307 - directory with info on Linux PCI power management. 310 308 powerpc/
+2 -2
Documentation/filesystems/proc.txt
··· 1506 1506 ----------- 1507 1507 1508 1508 laptop_mode is a knob that controls "laptop mode". All the things that are 1509 - controlled by this knob are discussed in Documentation/laptop-mode.txt. 1509 + controlled by this knob are discussed in Documentation/laptops/laptop-mode.txt. 1510 1510 1511 1511 block_dump 1512 1512 ---------- 1513 1513 1514 1514 block_dump enables block I/O debugging when set to a nonzero value. More 1515 - information on block I/O debugging is in Documentation/laptop-mode.txt. 1515 + information on block I/O debugging is in Documentation/laptops/laptop-mode.txt. 1516 1516 1517 1517 swap_token_timeout 1518 1518 ------------------
+1 -1
Documentation/kernel-parameters.txt
··· 138 138 strict -- Be less tolerant of platforms that are not 139 139 strictly ACPI specification compliant. 140 140 141 - See also Documentation/pm.txt, pci=noacpi 141 + See also Documentation/power/pm.txt, pci=noacpi 142 142 143 143 acpi_apic_instance= [ACPI, IOAPIC] 144 144 Format: <int>
Documentation/laptop-mode.txt Documentation/laptops/laptop-mode.txt
+2
Documentation/laptops/00-INDEX
··· 2 2 - This file 3 3 acer-wmi.txt 4 4 - information on the Acer Laptop WMI Extras driver. 5 + laptop-mode.txt 6 + - how to conserve battery power using laptop-mode. 5 7 sony-laptop.txt 6 8 - Sony Notebook Control Driver (SNC) Readme. 7 9 sonypi.txt
+2 -2
Documentation/laptops/acer-wmi.txt
··· 48 48 49 49 To send me the DSDT, as root/sudo: 50 50 51 - cat /sys/firmware/acpi/DSDT > dsdt 51 + cat /sys/firmware/acpi/tables/DSDT > dsdt 52 52 53 53 And send me the resulting 'dsdt' file. 54 54 ··· 169 169 170 170 The LED is exposed through the LED subsystem, and can be found in: 171 171 172 - /sys/devices/platform/acer-wmi/leds/acer-mail:green/ 172 + /sys/devices/platform/acer-wmi/leds/acer-wmi::mail/ 173 173 174 174 The mail LED is autodetected, so if you don't have one, the LED device won't 175 175 be registered.
+1 -1
Documentation/pm.txt Documentation/power/pm.txt
··· 108 108 * EINVAL if the request is not supported 109 109 * EBUSY if the device is now busy and cannot handle the request 110 110 * ENOMEM if the device was unable to handle the request due to memory 111 - * 111 + * 112 112 * Details: The device request callback will be called before the 113 113 * device/system enters a suspend state (ACPI D1-D3) or 114 114 * or after the device/system resumes from suspend (ACPI D0).
Documentation/pm_qos_interface.txt Documentation/power/pm_qos_interface.txt
+6
Documentation/power/00-INDEX
··· 14 14 - Registering suspend notifiers in device drivers 15 15 pci.txt 16 16 - How the PCI Subsystem Does Power Management 17 + pm.txt 18 + - info on Linux power management support. 19 + pm_qos_interface.txt 20 + - info on Linux PM Quality of Service interface 21 + power_supply_class.txt 22 + - Tells userspace about battery, UPS, AC or DC power supply properties 17 23 s2ram.txt 18 24 - How to get suspend to ram working (and debug it when it isn't) 19 25 states.txt
Documentation/power_supply_class.txt Documentation/power/power_supply_class.txt
+11 -11
Documentation/thermal/sysfs-api.txt
··· 143 143 This is given by thermal zone driver as part of registration. 144 144 Eg: "ACPI thermal zone" indicates it's a ACPI thermal device 145 145 RO 146 - Optional 146 + Required 147 147 148 148 temp Current temperature as reported by thermal zone (sensor) 149 - Unit: degree Celsius 149 + Unit: millidegree Celsius 150 150 RO 151 151 Required 152 152 ··· 163 163 charge of the thermal management. 164 164 165 165 trip_point_[0-*]_temp The temperature above which trip point will be fired 166 - Unit: degree Celsius 166 + Unit: millidegree Celsius 167 167 RO 168 168 Optional 169 169 ··· 193 193 eg. For memory controller device on intel_menlow platform: 194 194 this should be "Memory controller" 195 195 RO 196 - Optional 196 + Required 197 197 198 198 max_state The maximum permissible cooling state of this cooling device. 199 199 RO ··· 219 219 220 220 |thermal_zone1: 221 221 |-----type: ACPI thermal zone 222 - |-----temp: 37 222 + |-----temp: 37000 223 223 |-----mode: kernel 224 - |-----trip_point_0_temp: 100 224 + |-----trip_point_0_temp: 100000 225 225 |-----trip_point_0_type: critical 226 - |-----trip_point_1_temp: 80 226 + |-----trip_point_1_temp: 80000 227 227 |-----trip_point_1_type: passive 228 - |-----trip_point_2_temp: 70 229 - |-----trip_point_2_type: active[0] 230 - |-----trip_point_3_temp: 60 231 - |-----trip_point_3_type: active[1] 228 + |-----trip_point_2_temp: 70000 229 + |-----trip_point_2_type: active0 230 + |-----trip_point_3_temp: 60000 231 + |-----trip_point_3_type: active1 232 232 |-----cdev0: --->/sys/class/thermal/cooling_device0 233 233 |-----cdev0_trip_point: 1 /* cdev0 can be used for passive */ 234 234 |-----cdev1: --->/sys/class/thermal/cooling_device3
+1 -1
arch/x86/Kconfig
··· 1259 1259 machines with more than one CPU. 1260 1260 1261 1261 In order to use APM, you will need supporting software. For location 1262 - and more information, read <file:Documentation/pm.txt> and the 1262 + and more information, read <file:Documentation/power/pm.txt> and the 1263 1263 Battery Powered Linux mini-HOWTO, available from 1264 1264 <http://www.tldp.org/docs.html#howto>. 1265 1265
+9 -10
drivers/acpi/Kconfig
··· 283 283 If you have a legacy free Toshiba laptop (such as the Libretto L1 284 284 series), say Y. 285 285 286 - config ACPI_CUSTOM_DSDT 287 - bool "Include Custom DSDT" 286 + config ACPI_CUSTOM_DSDT_FILE 287 + string "Custom DSDT Table file to include" 288 + default "" 288 289 depends on !STANDALONE 289 - default n 290 290 help 291 291 This option supports a custom DSDT by linking it into the kernel. 292 292 See Documentation/acpi/dsdt-override.txt 293 293 294 - If unsure, say N. 295 - 296 - config ACPI_CUSTOM_DSDT_FILE 297 - string "Custom DSDT Table file to include" 298 - depends on ACPI_CUSTOM_DSDT 299 - default "" 300 - help 301 294 Enter the full path name to the file which includes the AmlCode 302 295 declaration. 296 + 297 + If unsure, don't enter a file name. 298 + 299 + config ACPI_CUSTOM_DSDT 300 + bool 301 + default ACPI_CUSTOM_DSDT_FILE != "" 303 302 304 303 config ACPI_CUSTOM_DSDT_INITRD 305 304 bool "Read Custom DSDT from initramfs"
+1 -1
drivers/acpi/bus.c
··· 776 776 777 777 acpi_kobj = kobject_create_and_add("acpi", firmware_kobj); 778 778 if (!acpi_kobj) { 779 - printk(KERN_WARNING "%s: kset create error\n", __FUNCTION__); 779 + printk(KERN_WARNING "%s: kset create error\n", __func__); 780 780 acpi_kobj = NULL; 781 781 } 782 782
+1
drivers/acpi/button.c
··· 449 449 input->phys = button->phys; 450 450 input->id.bustype = BUS_HOST; 451 451 input->id.product = button->type; 452 + input->dev.parent = &device->dev; 452 453 453 454 switch (button->type) { 454 455 case ACPI_BUTTON_TYPE_POWER:
+12 -5
drivers/acpi/ec.c
··· 129 129 struct mutex lock; 130 130 wait_queue_head_t wait; 131 131 struct list_head list; 132 + atomic_t irq_count; 132 133 u8 handlers_installed; 133 134 } *boot_ec, *first_ec; 134 135 ··· 182 181 { 183 182 int ret = 0; 184 183 184 + atomic_set(&ec->irq_count, 0); 185 + 185 186 if (unlikely(event == ACPI_EC_EVENT_OBF_1 && 186 187 test_bit(EC_FLAGS_NO_OBF1_GPE, &ec->flags))) 187 188 force_poll = 1; ··· 230 227 while (time_before(jiffies, delay)) { 231 228 if (acpi_ec_check_status(ec, event)) 232 229 goto end; 230 + msleep(5); 233 231 } 234 232 } 235 233 pr_err(PREFIX "acpi_ec_wait timeout," ··· 533 529 struct acpi_ec *ec = data; 534 530 535 531 pr_debug(PREFIX "~~~> interrupt\n"); 532 + atomic_inc(&ec->irq_count); 533 + if (atomic_read(&ec->irq_count) > 5) { 534 + pr_err(PREFIX "GPE storm detected, disabling EC GPE\n"); 535 + acpi_disable_gpe(NULL, ec->gpe, ACPI_ISR); 536 + clear_bit(EC_FLAGS_GPE_MODE, &ec->flags); 537 + return ACPI_INTERRUPT_HANDLED; 538 + } 536 539 clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags); 537 540 if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags)) 538 541 wake_up(&ec->wait); ··· 954 943 boot_ec->command_addr = ecdt_ptr->control.address; 955 944 boot_ec->data_addr = ecdt_ptr->data.address; 956 945 boot_ec->gpe = ecdt_ptr->gpe; 957 - if (ACPI_FAILURE(acpi_get_handle(NULL, ecdt_ptr->id, 958 - &boot_ec->handle))) { 959 - pr_info("Failed to locate handle for boot EC\n"); 960 - boot_ec->handle = ACPI_ROOT_OBJECT; 961 - } 946 + boot_ec->handle = ACPI_ROOT_OBJECT; 962 947 } else { 963 948 /* This workaround is needed only on some broken machines, 964 949 * which require early EC, but fail to provide ECDT */
+1 -1
drivers/acpi/osl.c
··· 1237 1237 1238 1238 if (clash) { 1239 1239 if (acpi_enforce_resources != ENFORCE_RESOURCES_NO) { 1240 - printk(KERN_INFO "%sACPI: %s resource %s [0x%llx-0x%llx]" 1240 + printk("%sACPI: %s resource %s [0x%llx-0x%llx]" 1241 1241 " conflicts with ACPI region %s" 1242 1242 " [0x%llx-0x%llx]\n", 1243 1243 acpi_enforce_resources == ENFORCE_RESOURCES_LAX
+98
drivers/acpi/pci_irq.c
··· 25 25 */ 26 26 27 27 28 + #include <linux/dmi.h> 28 29 #include <linux/kernel.h> 29 30 #include <linux/module.h> 30 31 #include <linux/init.h> ··· 77 76 return NULL; 78 77 } 79 78 79 + /* http://bugzilla.kernel.org/show_bug.cgi?id=4773 */ 80 + static struct dmi_system_id medion_md9580[] = { 81 + { 82 + .ident = "Medion MD9580-F laptop", 83 + .matches = { 84 + DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"), 85 + DMI_MATCH(DMI_PRODUCT_NAME, "A555"), 86 + }, 87 + }, 88 + { } 89 + }; 90 + 91 + /* http://bugzilla.kernel.org/show_bug.cgi?id=5044 */ 92 + static struct dmi_system_id dell_optiplex[] = { 93 + { 94 + .ident = "Dell Optiplex GX1", 95 + .matches = { 96 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"), 97 + DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex GX1 600S+"), 98 + }, 99 + }, 100 + { } 101 + }; 102 + 103 + /* http://bugzilla.kernel.org/show_bug.cgi?id=10138 */ 104 + static struct dmi_system_id hp_t5710[] = { 105 + { 106 + .ident = "HP t5710", 107 + .matches = { 108 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 109 + DMI_MATCH(DMI_PRODUCT_NAME, "hp t5000 series"), 110 + DMI_MATCH(DMI_BOARD_NAME, "098Ch"), 111 + }, 112 + }, 113 + { } 114 + }; 115 + 116 + struct prt_quirk { 117 + struct dmi_system_id *system; 118 + unsigned int segment; 119 + unsigned int bus; 120 + unsigned int device; 121 + unsigned char pin; 122 + char *source; /* according to BIOS */ 123 + char *actual_source; 124 + }; 125 + 126 + /* 127 + * These systems have incorrect _PRT entries. The BIOS claims the PCI 128 + * interrupt at the listed segment/bus/device/pin is connected to the first 129 + * link device, but it is actually connected to the second. 130 + */ 131 + static struct prt_quirk prt_quirks[] = { 132 + { medion_md9580, 0, 0, 9, 'A', 133 + "\\_SB_.PCI0.ISA.LNKA", 134 + "\\_SB_.PCI0.ISA.LNKB"}, 135 + { dell_optiplex, 0, 0, 0xd, 'A', 136 + "\\_SB_.LNKB", 137 + "\\_SB_.LNKA"}, 138 + { hp_t5710, 0, 0, 1, 'A', 139 + "\\_SB_.PCI0.LNK1", 140 + "\\_SB_.PCI0.LNK3"}, 141 + }; 142 + 143 + static void 144 + do_prt_fixups(struct acpi_prt_entry *entry, struct acpi_pci_routing_table *prt) 145 + { 146 + int i; 147 + struct prt_quirk *quirk; 148 + 149 + for (i = 0; i < ARRAY_SIZE(prt_quirks); i++) { 150 + quirk = &prt_quirks[i]; 151 + 152 + /* All current quirks involve link devices, not GSIs */ 153 + if (!prt->source) 154 + continue; 155 + 156 + if (dmi_check_system(quirk->system) && 157 + entry->id.segment == quirk->segment && 158 + entry->id.bus == quirk->bus && 159 + entry->id.device == quirk->device && 160 + entry->pin + 'A' == quirk->pin && 161 + !strcmp(prt->source, quirk->source) && 162 + strlen(prt->source) >= strlen(quirk->actual_source)) { 163 + printk(KERN_WARNING PREFIX "firmware reports " 164 + "%04x:%02x:%02x[%c] connected to %s; " 165 + "changing to %s\n", 166 + entry->id.segment, entry->id.bus, 167 + entry->id.device, 'A' + entry->pin, 168 + prt->source, quirk->actual_source); 169 + strcpy(prt->source, quirk->actual_source); 170 + } 171 + } 172 + } 173 + 80 174 static int 81 175 acpi_pci_irq_add_entry(acpi_handle handle, 82 176 int segment, int bus, struct acpi_pci_routing_table *prt) ··· 191 95 entry->id.device = (prt->address >> 16) & 0xFFFF; 192 96 entry->id.function = prt->address & 0xFFFF; 193 97 entry->pin = prt->pin; 98 + 99 + do_prt_fixups(entry, prt); 194 100 195 101 /* 196 102 * Type 1: Dynamic
+1 -1
drivers/acpi/pci_root.c
··· 184 184 } 185 185 } 186 186 187 - static int acpi_pci_root_add(struct acpi_device *device) 187 + static int __devinit acpi_pci_root_add(struct acpi_device *device) 188 188 { 189 189 int result = 0; 190 190 struct acpi_pci_root *root = NULL;
+14 -11
drivers/acpi/processor_core.c
··· 840 840 841 841 842 842 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); 843 - /* 844 - * if a processor object does not have an _STA object, 845 - * OSPM assumes that the processor is present. 846 - */ 847 - if (status == AE_NOT_FOUND) 848 - return 1; 849 843 850 844 if (ACPI_SUCCESS(status) && (sta & ACPI_STA_DEVICE_PRESENT)) 851 845 return 1; 852 846 853 - ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present")); 847 + /* 848 + * _STA is mandatory for a processor that supports hot plug 849 + */ 850 + if (status == AE_NOT_FOUND) 851 + ACPI_DEBUG_PRINT((ACPI_DB_INFO, 852 + "Processor does not support hot plug\n")); 853 + else 854 + ACPI_EXCEPTION((AE_INFO, status, 855 + "Processor Device is not present")); 854 856 return 0; 855 857 } 856 858 ··· 888 886 return 0; 889 887 } 890 888 891 - static void 892 - acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data) 889 + static void __ref acpi_processor_hotplug_notify(acpi_handle handle, 890 + u32 event, void *data) 893 891 { 894 892 struct acpi_processor *pr; 895 893 struct acpi_device *device = NULL; ··· 899 897 switch (event) { 900 898 case ACPI_NOTIFY_BUS_CHECK: 901 899 case ACPI_NOTIFY_DEVICE_CHECK: 902 - printk("Processor driver received %s event\n", 900 + ACPI_DEBUG_PRINT((ACPI_DB_INFO, 901 + "Processor driver received %s event\n", 903 902 (event == ACPI_NOTIFY_BUS_CHECK) ? 904 - "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK"); 903 + "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK")); 905 904 906 905 if (!is_processor_present(handle)) 907 906 break;
+3 -2
drivers/acpi/scan.c
··· 609 609 status = acpi_evaluate_object(handle, "_EJD", NULL, &buffer); 610 610 if (ACPI_SUCCESS(status)) { 611 611 obj = buffer.pointer; 612 - status = acpi_get_handle(NULL, obj->string.pointer, ejd); 612 + status = acpi_get_handle(ACPI_ROOT_OBJECT, obj->string.pointer, 613 + ejd); 613 614 kfree(buffer.pointer); 614 615 } 615 616 return status; ··· 967 966 case ACPI_BUS_TYPE_DEVICE: 968 967 status = acpi_get_object_info(handle, &buffer); 969 968 if (ACPI_FAILURE(status)) { 970 - printk(KERN_ERR PREFIX "%s: Error reading device info\n", __FUNCTION__); 969 + printk(KERN_ERR PREFIX "%s: Error reading device info\n", __func__); 971 970 return; 972 971 } 973 972
+1 -1
drivers/acpi/sleep/main.c
··· 504 504 static void acpi_power_off(void) 505 505 { 506 506 /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ 507 - printk("%s called\n", __FUNCTION__); 507 + printk("%s called\n", __func__); 508 508 local_irq_disable(); 509 509 acpi_enable_wakeup_device(ACPI_STATE_S5); 510 510 acpi_enter_sleep_state(ACPI_STATE_S5);
+1 -1
drivers/acpi/system.c
··· 319 319 goto fail; 320 320 321 321 for (i = 0; i < num_counters; ++i) { 322 - char buffer[10]; 322 + char buffer[12]; 323 323 char *name; 324 324 325 325 if (i < num_gpes)
+7 -5
drivers/acpi/thermal.c
··· 879 879 } 880 880 881 881 /* sys I/F for generic thermal sysfs support */ 882 + #define KELVIN_TO_MILLICELSIUS(t) (t * 100 - 273200) 883 + 882 884 static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf) 883 885 { 884 886 struct acpi_thermal *tz = thermal->devdata; ··· 888 886 if (!tz) 889 887 return -EINVAL; 890 888 891 - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature)); 889 + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature)); 892 890 } 893 891 894 892 static const char enabled[] = "kernel"; ··· 982 980 983 981 if (tz->trips.critical.flags.valid) { 984 982 if (!trip) 985 - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS( 983 + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS( 986 984 tz->trips.critical.temperature)); 987 985 trip--; 988 986 } 989 987 990 988 if (tz->trips.hot.flags.valid) { 991 989 if (!trip) 992 - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS( 990 + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS( 993 991 tz->trips.hot.temperature)); 994 992 trip--; 995 993 } 996 994 997 995 if (tz->trips.passive.flags.valid) { 998 996 if (!trip) 999 - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS( 997 + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS( 1000 998 tz->trips.passive.temperature)); 1001 999 trip--; 1002 1000 } ··· 1004 1002 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE && 1005 1003 tz->trips.active[i].flags.valid; i++) { 1006 1004 if (!trip) 1007 - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS( 1005 + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS( 1008 1006 tz->trips.active[i].temperature)); 1009 1007 trip--; 1010 1008 }
+7
drivers/acpi/toshiba_acpi.c
··· 99 99 #define HCI_VIDEO_OUT_CRT 0x2 100 100 #define HCI_VIDEO_OUT_TV 0x4 101 101 102 + static const struct acpi_device_id toshiba_device_ids[] = { 103 + {"TOS6200", 0}, 104 + {"TOS1900", 0}, 105 + {"", 0}, 106 + }; 107 + MODULE_DEVICE_TABLE(acpi, toshiba_device_ids); 108 + 102 109 /* utility 103 110 */ 104 111
+1 -1
drivers/acpi/utilities/utdebug.c
··· 109 109 * RETURN: Updated pointer to the function name 110 110 * 111 111 * DESCRIPTION: Remove the "Acpi" prefix from the function name, if present. 112 - * This allows compiler macros such as __FUNCTION__ to be used 112 + * This allows compiler macros such as __func__ to be used 113 113 * with no change to the debug output. 114 114 * 115 115 ******************************************************************************/
+1 -1
drivers/acpi/utilities/utobject.c
··· 432 432 * element -- which is legal) 433 433 */ 434 434 if (!internal_object) { 435 - *obj_length = 0; 435 + *obj_length = sizeof(union acpi_object); 436 436 return_ACPI_STATUS(AE_OK); 437 437 } 438 438
+6
drivers/acpi/utils.c
··· 407 407 break; 408 408 } 409 409 410 + if (!element->reference.handle) { 411 + printk(KERN_WARNING PREFIX "Invalid reference in" 412 + " package %s\n", pathname); 413 + status = AE_NULL_ENTRY; 414 + break; 415 + } 410 416 /* Get the acpi_handle. */ 411 417 412 418 list->handles[i] = element->reference.handle;
+2 -2
drivers/acpi/video.c
··· 713 713 714 714 kfree(obj); 715 715 716 - if (device->cap._BCL && device->cap._BCM && device->cap._BQC && max_level > 0){ 716 + if (device->cap._BCL && device->cap._BCM && max_level > 0) { 717 717 int result; 718 718 static int count = 0; 719 719 char *name; ··· 1201 1201 if (!video) 1202 1202 goto end; 1203 1203 1204 - printk(KERN_INFO PREFIX "Please implement %s\n", __FUNCTION__); 1204 + printk(KERN_INFO PREFIX "Please implement %s\n", __func__); 1205 1205 seq_printf(seq, "<TODO>\n"); 1206 1206 1207 1207 end:
+6 -4
drivers/acpi/wmi.c
··· 293 293 { 294 294 struct guid_block *block = NULL; 295 295 struct wmi_block *wblock = NULL; 296 - acpi_handle handle; 296 + acpi_handle handle, wc_handle; 297 297 acpi_status status, wc_status = AE_ERROR; 298 298 struct acpi_object_list input, wc_input; 299 299 union acpi_object wc_params[1], wq_params[1]; ··· 338 338 * expensive, but have no corresponding WCxx method. So we 339 339 * should not fail if this happens. 340 340 */ 341 - wc_status = acpi_evaluate_object(handle, wc_method, 342 - &wc_input, NULL); 341 + wc_status = acpi_get_handle(handle, wc_method, &wc_handle); 342 + if (ACPI_SUCCESS(wc_status)) 343 + wc_status = acpi_evaluate_object(handle, wc_method, 344 + &wc_input, NULL); 343 345 } 344 346 345 347 strcpy(method, "WQ"); ··· 353 351 * If ACPI_WMI_EXPENSIVE, call the relevant WCxx method, even if 354 352 * the WQxx method failed - we should disable collection anyway. 355 353 */ 356 - if ((block->flags & ACPI_WMI_EXPENSIVE) && wc_status) { 354 + if ((block->flags & ACPI_WMI_EXPENSIVE) && ACPI_SUCCESS(wc_status)) { 357 355 wc_params[0].integer.value = 0; 358 356 status = acpi_evaluate_object(handle, 359 357 wc_method, &wc_input, NULL);
+1
drivers/misc/Kconfig
··· 108 108 depends on ACPI 109 109 depends on LEDS_CLASS 110 110 depends on BACKLIGHT_CLASS_DEVICE 111 + depends on SERIO_I8042 111 112 select ACPI_WMI 112 113 ---help--- 113 114 This is a driver for newer Acer (and Wistron) laptops. It adds
+31 -13
drivers/misc/acer-wmi.c
··· 219 219 }, 220 220 { 221 221 .callback = dmi_matched, 222 + .ident = "Acer Aspire 3610", 223 + .matches = { 224 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 225 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3610"), 226 + }, 227 + .driver_data = &quirk_acer_travelmate_2490, 228 + }, 229 + { 230 + .callback = dmi_matched, 222 231 .ident = "Acer Aspire 5100", 223 232 .matches = { 224 233 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 225 234 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"), 235 + }, 236 + .driver_data = &quirk_acer_travelmate_2490, 237 + }, 238 + { 239 + .callback = dmi_matched, 240 + .ident = "Acer Aspire 5610", 241 + .matches = { 242 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 243 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"), 226 244 }, 227 245 .driver_data = &quirk_acer_travelmate_2490, 228 246 }, ··· 779 761 } 780 762 781 763 static struct led_classdev mail_led = { 782 - .name = "acer-mail:green", 764 + .name = "acer-wmi::mail", 783 765 .brightness_set = mail_led_set, 784 766 }; 785 767 786 - static int __init acer_led_init(struct device *dev) 768 + static int __devinit acer_led_init(struct device *dev) 787 769 { 788 770 return led_classdev_register(dev, &mail_led); 789 771 } ··· 816 798 .update_status = update_bl_status, 817 799 }; 818 800 819 - static int __init acer_backlight_init(struct device *dev) 801 + static int __devinit acer_backlight_init(struct device *dev) 820 802 { 821 803 struct backlight_device *bd; 822 804 ··· 835 817 return 0; 836 818 } 837 819 838 - static void __exit acer_backlight_exit(void) 820 + static void acer_backlight_exit(void) 839 821 { 840 822 backlight_device_unregister(acer_backlight_device); 841 823 } ··· 1070 1052 1071 1053 if (wmi_has_guid(WMID_GUID2) && interface) { 1072 1054 if (ACPI_FAILURE(WMID_set_capabilities())) { 1073 - printk(ACER_ERR "Unable to detect available devices\n"); 1055 + printk(ACER_ERR "Unable to detect available WMID " 1056 + "devices\n"); 1074 1057 return -ENODEV; 1075 1058 } 1076 1059 } else if (!wmi_has_guid(WMID_GUID2) && interface) { 1077 - printk(ACER_ERR "Unable to detect available devices\n"); 1060 + printk(ACER_ERR "No WMID device detection method found\n"); 1078 1061 return -ENODEV; 1079 1062 } 1080 1063 ··· 1083 1064 interface = &AMW0_interface; 1084 1065 1085 1066 if (ACPI_FAILURE(AMW0_set_capabilities())) { 1086 - printk(ACER_ERR "Unable to detect available devices\n"); 1067 + printk(ACER_ERR "Unable to detect available AMW0 " 1068 + "devices\n"); 1087 1069 return -ENODEV; 1088 1070 } 1089 1071 } 1090 1072 1091 - if (wmi_has_guid(AMW0_GUID1)) { 1092 - if (ACPI_FAILURE(AMW0_find_mailled())) 1093 - printk(ACER_ERR "Unable to detect mail LED\n"); 1094 - } 1073 + if (wmi_has_guid(AMW0_GUID1)) 1074 + AMW0_find_mailled(); 1095 1075 1096 1076 find_quirks(); 1097 1077 1098 1078 if (!interface) { 1099 - printk(ACER_ERR "No or unsupported WMI interface, unable to "); 1100 - printk(KERN_CONT "load.\n"); 1079 + printk(ACER_ERR "No or unsupported WMI interface, unable to " 1080 + "load\n"); 1101 1081 return -ENODEV; 1102 1082 } 1103 1083
+1 -1
drivers/misc/sony-laptop.c
··· 315 315 break; 316 316 317 317 default: 318 - if (event > ARRAY_SIZE(sony_laptop_input_index)) { 318 + if (event >= ARRAY_SIZE(sony_laptop_input_index)) { 319 319 dprintk("sony_laptop_report_input_event, event not known: %d\n", event); 320 320 break; 321 321 }
+16 -8
drivers/pci/pci-acpi.c
··· 272 272 { 273 273 acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); 274 274 acpi_handle tmp; 275 - static int state_conv[] = { 276 - [0] = 0, 277 - [1] = 1, 278 - [2] = 2, 279 - [3] = 3, 280 - [4] = 3 275 + static const u8 state_conv[] = { 276 + [PCI_D0] = ACPI_STATE_D0, 277 + [PCI_D1] = ACPI_STATE_D1, 278 + [PCI_D2] = ACPI_STATE_D2, 279 + [PCI_D3hot] = ACPI_STATE_D3, 280 + [PCI_D3cold] = ACPI_STATE_D3 281 281 }; 282 - int acpi_state = state_conv[(int __force) state]; 283 282 284 283 if (!handle) 285 284 return -ENODEV; 286 285 /* If the ACPI device has _EJ0, ignore the device */ 287 286 if (ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0", &tmp))) 288 287 return 0; 289 - return acpi_bus_set_power(handle, acpi_state); 288 + 289 + switch (state) { 290 + case PCI_D0: 291 + case PCI_D1: 292 + case PCI_D2: 293 + case PCI_D3hot: 294 + case PCI_D3cold: 295 + return acpi_bus_set_power(handle, state_conv[state]); 296 + } 297 + return -EINVAL; 290 298 } 291 299 292 300
+1
drivers/thermal/Kconfig
··· 4 4 5 5 menuconfig THERMAL 6 6 bool "Generic Thermal sysfs driver" 7 + select HWMON 7 8 default y 8 9 help 9 10 Generic Thermal Sysfs driver offers a generic mechanism for
+143 -26
drivers/thermal/thermal.c
··· 30 30 #include <linux/idr.h> 31 31 #include <linux/thermal.h> 32 32 #include <linux/spinlock.h> 33 + #include <linux/hwmon.h> 34 + #include <linux/hwmon-sysfs.h> 33 35 34 - MODULE_AUTHOR("Zhang Rui") 36 + MODULE_AUTHOR("Zhang Rui"); 35 37 MODULE_DESCRIPTION("Generic thermal management sysfs support"); 36 38 MODULE_LICENSE("GPL"); 37 39 ··· 57 55 static LIST_HEAD(thermal_tz_list); 58 56 static LIST_HEAD(thermal_cdev_list); 59 57 static DEFINE_MUTEX(thermal_list_lock); 58 + 59 + static struct device *thermal_hwmon; 60 + #define MAX_THERMAL_ZONES 10 60 61 61 62 static int get_idr(struct idr *idr, struct mutex *lock, int *id) 62 63 { ··· 92 87 mutex_unlock(lock); 93 88 } 94 89 95 - /* sys I/F for thermal zone */ 90 + /* hwmon sys I/F*/ 91 + static ssize_t 92 + name_show(struct device *dev, struct device_attribute *attr, char *buf) 93 + { 94 + return sprintf(buf, "thermal_sys_class\n"); 95 + } 96 + 97 + static ssize_t 98 + temp_input_show(struct device *dev, struct device_attribute *attr, char *buf) 99 + { 100 + struct thermal_zone_device *tz; 101 + struct sensor_device_attribute *sensor_attr 102 + = to_sensor_dev_attr(attr); 103 + 104 + list_for_each_entry(tz, &thermal_tz_list, node) 105 + if (tz->id == sensor_attr->index) 106 + return tz->ops->get_temp(tz, buf); 107 + 108 + return -ENODEV; 109 + } 110 + 111 + static ssize_t 112 + temp_crit_show(struct device *dev, struct device_attribute *attr, 113 + char *buf) 114 + { 115 + struct thermal_zone_device *tz; 116 + struct sensor_device_attribute *sensor_attr 117 + = to_sensor_dev_attr(attr); 118 + 119 + list_for_each_entry(tz, &thermal_tz_list, node) 120 + if (tz->id == sensor_attr->index) 121 + return tz->ops->get_trip_temp(tz, 0, buf); 122 + 123 + return -ENODEV; 124 + } 125 + 126 + static DEVICE_ATTR(name, 0444, name_show, NULL); 127 + static struct sensor_device_attribute sensor_attrs[] = { 128 + SENSOR_ATTR(temp1_input, 0444, temp_input_show, NULL, 0), 129 + SENSOR_ATTR(temp1_crit, 0444, temp_crit_show, NULL, 0), 130 + SENSOR_ATTR(temp2_input, 0444, temp_input_show, NULL, 1), 131 + SENSOR_ATTR(temp2_crit, 0444, temp_crit_show, NULL, 1), 132 + SENSOR_ATTR(temp3_input, 0444, temp_input_show, NULL, 2), 133 + SENSOR_ATTR(temp3_crit, 0444, temp_crit_show, NULL, 2), 134 + SENSOR_ATTR(temp4_input, 0444, temp_input_show, NULL, 3), 135 + SENSOR_ATTR(temp4_crit, 0444, temp_crit_show, NULL, 3), 136 + SENSOR_ATTR(temp5_input, 0444, temp_input_show, NULL, 4), 137 + SENSOR_ATTR(temp5_crit, 0444, temp_crit_show, NULL, 4), 138 + SENSOR_ATTR(temp6_input, 0444, temp_input_show, NULL, 5), 139 + SENSOR_ATTR(temp6_crit, 0444, temp_crit_show, NULL, 5), 140 + SENSOR_ATTR(temp7_input, 0444, temp_input_show, NULL, 6), 141 + SENSOR_ATTR(temp7_crit, 0444, temp_crit_show, NULL, 6), 142 + SENSOR_ATTR(temp8_input, 0444, temp_input_show, NULL, 7), 143 + SENSOR_ATTR(temp8_crit, 0444, temp_crit_show, NULL, 7), 144 + SENSOR_ATTR(temp9_input, 0444, temp_input_show, NULL, 8), 145 + SENSOR_ATTR(temp9_crit, 0444, temp_crit_show, NULL, 8), 146 + SENSOR_ATTR(temp10_input, 0444, temp_input_show, NULL, 9), 147 + SENSOR_ATTR(temp10_crit, 0444, temp_crit_show, NULL, 9), 148 + }; 149 + 150 + /* thermal zone sys I/F */ 96 151 97 152 #define to_thermal_zone(_dev) \ 98 153 container_of(_dev, struct thermal_zone_device, device) ··· 279 214 device_remove_file(_dev, &trip_point_attrs[_index * 2 + 1]); \ 280 215 } while (0) 281 216 282 - /* sys I/F for cooling device */ 217 + /* cooling device sys I/F */ 283 218 #define to_cooling_device(_dev) \ 284 219 container_of(_dev, struct thermal_cooling_device, device) 285 220 ··· 512 447 struct thermal_zone_device *pos; 513 448 int result; 514 449 450 + if (!type) 451 + return ERR_PTR(-EINVAL); 452 + 515 453 if (strlen(type) >= THERMAL_NAME_LENGTH) 516 454 return ERR_PTR(-EINVAL); 517 455 ··· 545 477 } 546 478 547 479 /* sys I/F */ 548 - if (type) { 549 - result = device_create_file(&cdev->device, &dev_attr_cdev_type); 550 - if (result) 551 - goto unregister; 552 - } 480 + result = device_create_file(&cdev->device, &dev_attr_cdev_type); 481 + if (result) 482 + goto unregister; 553 483 554 484 result = device_create_file(&cdev->device, &dev_attr_max_state); 555 485 if (result) ··· 613 547 tz->ops->unbind(tz, cdev); 614 548 } 615 549 mutex_unlock(&thermal_list_lock); 616 - if (cdev->type[0]) 617 - device_remove_file(&cdev->device, &dev_attr_cdev_type); 550 + 551 + device_remove_file(&cdev->device, &dev_attr_cdev_type); 618 552 device_remove_file(&cdev->device, &dev_attr_max_state); 619 553 device_remove_file(&cdev->device, &dev_attr_cur_state); 620 554 ··· 646 580 int result; 647 581 int count; 648 582 583 + if (!type) 584 + return ERR_PTR(-EINVAL); 585 + 649 586 if (strlen(type) >= THERMAL_NAME_LENGTH) 650 587 return ERR_PTR(-EINVAL); 651 588 ··· 670 601 kfree(tz); 671 602 return ERR_PTR(result); 672 603 } 604 + if (tz->id >= MAX_THERMAL_ZONES) { 605 + printk(KERN_ERR PREFIX 606 + "Too many thermal zones\n"); 607 + release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); 608 + kfree(tz); 609 + return ERR_PTR(-EINVAL); 610 + } 673 611 674 612 strcpy(tz->type, type); 675 613 tz->ops = ops; ··· 691 615 return ERR_PTR(result); 692 616 } 693 617 694 - /* sys I/F */ 695 - if (type) { 696 - result = device_create_file(&tz->device, &dev_attr_type); 697 - if (result) 698 - goto unregister; 618 + /* hwmon sys I/F */ 619 + result = device_create_file(thermal_hwmon, 620 + &sensor_attrs[tz->id * 2].dev_attr); 621 + if (result) 622 + goto unregister; 623 + 624 + if (trips > 0) { 625 + char buf[40]; 626 + result = tz->ops->get_trip_type(tz, 0, buf); 627 + if (result > 0 && !strcmp(buf, "critical\n")) { 628 + result = device_create_file(thermal_hwmon, 629 + &sensor_attrs[tz->id * 2 + 1].dev_attr); 630 + if (result) 631 + goto unregister; 632 + } 699 633 } 634 + 635 + /* sys I/F */ 636 + result = device_create_file(&tz->device, &dev_attr_type); 637 + if (result) 638 + goto unregister; 700 639 701 640 result = device_create_file(&tz->device, &dev_attr_temp); 702 641 if (result) ··· 778 687 tz->ops->unbind(tz, cdev); 779 688 mutex_unlock(&thermal_list_lock); 780 689 781 - if (tz->type[0]) 782 - device_remove_file(&tz->device, &dev_attr_type); 690 + device_remove_file(thermal_hwmon, 691 + &sensor_attrs[tz->id * 2].dev_attr); 692 + if (tz->trips > 0) { 693 + char buf[40]; 694 + if (tz->ops->get_trip_type(tz, 0, buf) > 0) 695 + if (!strcmp(buf, "critical\n")) 696 + device_remove_file(thermal_hwmon, 697 + &sensor_attrs[tz->id * 2 + 1].dev_attr); 698 + } 699 + 700 + device_remove_file(&tz->device, &dev_attr_type); 783 701 device_remove_file(&tz->device, &dev_attr_temp); 784 702 if (tz->ops->get_mode) 785 703 device_remove_file(&tz->device, &dev_attr_mode); ··· 805 705 806 706 EXPORT_SYMBOL(thermal_zone_device_unregister); 807 707 708 + static void thermal_exit(void) 709 + { 710 + if (thermal_hwmon) { 711 + device_remove_file(thermal_hwmon, &dev_attr_name); 712 + hwmon_device_unregister(thermal_hwmon); 713 + } 714 + class_unregister(&thermal_class); 715 + idr_destroy(&thermal_tz_idr); 716 + idr_destroy(&thermal_cdev_idr); 717 + mutex_destroy(&thermal_idr_lock); 718 + mutex_destroy(&thermal_list_lock); 719 + } 720 + 808 721 static int __init thermal_init(void) 809 722 { 810 723 int result = 0; ··· 829 716 mutex_destroy(&thermal_idr_lock); 830 717 mutex_destroy(&thermal_list_lock); 831 718 } 832 - return result; 833 - } 834 719 835 - static void __exit thermal_exit(void) 836 - { 837 - class_unregister(&thermal_class); 838 - idr_destroy(&thermal_tz_idr); 839 - idr_destroy(&thermal_cdev_idr); 840 - mutex_destroy(&thermal_idr_lock); 841 - mutex_destroy(&thermal_list_lock); 720 + thermal_hwmon = hwmon_device_register(NULL); 721 + if (IS_ERR(thermal_hwmon)) { 722 + result = PTR_ERR(thermal_hwmon); 723 + thermal_hwmon = NULL; 724 + printk(KERN_ERR PREFIX 725 + "unable to register hwmon device\n"); 726 + thermal_exit(); 727 + return result; 728 + } 729 + 730 + result = device_create_file(thermal_hwmon, &dev_attr_name); 731 + 732 + return result; 842 733 } 843 734 844 735 subsys_initcall(thermal_init);
+1 -1
kernel/power/Kconfig
··· 190 190 notification of APM "events" (e.g. battery status change). 191 191 192 192 In order to use APM, you will need supporting software. For location 193 - and more information, read <file:Documentation/pm.txt> and the 193 + and more information, read <file:Documentation/power/pm.txt> and the 194 194 Battery Powered Linux mini-HOWTO, available from 195 195 <http://www.tldp.org/docs.html#howto>. 196 196
+34 -7
kernel/power/snapshot.c
··· 447 447 * of @bm->cur_zone_bm are updated. 448 448 */ 449 449 450 - static void memory_bm_find_bit(struct memory_bitmap *bm, unsigned long pfn, 450 + static int memory_bm_find_bit(struct memory_bitmap *bm, unsigned long pfn, 451 451 void **addr, unsigned int *bit_nr) 452 452 { 453 453 struct zone_bitmap *zone_bm; ··· 461 461 while (pfn < zone_bm->start_pfn || pfn >= zone_bm->end_pfn) { 462 462 zone_bm = zone_bm->next; 463 463 464 - BUG_ON(!zone_bm); 464 + if (!zone_bm) 465 + return -EFAULT; 465 466 } 466 467 bm->cur.zone_bm = zone_bm; 467 468 } ··· 480 479 pfn -= bb->start_pfn; 481 480 *bit_nr = pfn % BM_BITS_PER_CHUNK; 482 481 *addr = bb->data + pfn / BM_BITS_PER_CHUNK; 482 + return 0; 483 483 } 484 484 485 485 static void memory_bm_set_bit(struct memory_bitmap *bm, unsigned long pfn) 486 486 { 487 487 void *addr; 488 488 unsigned int bit; 489 + int error; 489 490 490 - memory_bm_find_bit(bm, pfn, &addr, &bit); 491 + error = memory_bm_find_bit(bm, pfn, &addr, &bit); 492 + BUG_ON(error); 491 493 set_bit(bit, addr); 494 + } 495 + 496 + static int mem_bm_set_bit_check(struct memory_bitmap *bm, unsigned long pfn) 497 + { 498 + void *addr; 499 + unsigned int bit; 500 + int error; 501 + 502 + error = memory_bm_find_bit(bm, pfn, &addr, &bit); 503 + if (!error) 504 + set_bit(bit, addr); 505 + return error; 492 506 } 493 507 494 508 static void memory_bm_clear_bit(struct memory_bitmap *bm, unsigned long pfn) 495 509 { 496 510 void *addr; 497 511 unsigned int bit; 512 + int error; 498 513 499 - memory_bm_find_bit(bm, pfn, &addr, &bit); 514 + error = memory_bm_find_bit(bm, pfn, &addr, &bit); 515 + BUG_ON(error); 500 516 clear_bit(bit, addr); 501 517 } 502 518 ··· 521 503 { 522 504 void *addr; 523 505 unsigned int bit; 506 + int error; 524 507 525 - memory_bm_find_bit(bm, pfn, &addr, &bit); 508 + error = memory_bm_find_bit(bm, pfn, &addr, &bit); 509 + BUG_ON(error); 526 510 return test_bit(bit, addr); 527 511 } 528 512 ··· 729 709 region->end_pfn << PAGE_SHIFT); 730 710 731 711 for (pfn = region->start_pfn; pfn < region->end_pfn; pfn++) 732 - if (pfn_valid(pfn)) 733 - memory_bm_set_bit(bm, pfn); 712 + if (pfn_valid(pfn)) { 713 + /* 714 + * It is safe to ignore the result of 715 + * mem_bm_set_bit_check() here, since we won't 716 + * touch the PFNs for which the error is 717 + * returned anyway. 718 + */ 719 + mem_bm_set_bit_check(bm, pfn); 720 + } 734 721 } 735 722 } 736 723