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

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: (28 commits)
ACPI: delete stale reference in kernel-parameters.txt
ACPI: add missing _OSI strings
ACPI: remove NID_INVAL
thermal: make THERMAL_HWMON implementation fully internal
thermal: split hwmon lookup to a separate function
thermal: hide CONFIG_THERMAL_HWMON
ACPI print OSI(Linux) warning only once
ACPI: DMI workaround for Asus A8N-SLI Premium and Asus A8N-SLI DELUX
ACPI / Battery: propagate sysfs error in acpi_battery_add()
ACPI / Battery: avoid acpi_battery_add() use-after-free
ACPI: introduce "acpi_rsdp=" parameter for kdump
ACPI: constify ops structs
ACPI: fix CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS
ACPI: fix 80 char overflow
ACPI / Battery: Resolve the race condition in the sysfs_remove_battery()
ACPI / Battery: Add the check before refresh sysfs in the battery_notify()
ACPI / Battery: Add the hibernation process in the battery_notify()
ACPI / Battery: Rename acpi_battery_quirks2 with acpi_battery_quirks
ACPI / Battery: Change 16-bit signed negative battery current into correct value
ACPI / Battery: Add the power unit macro
...

+352 -132
-9
Documentation/feature-removal-schedule.txt
··· 296 296 297 297 --------------------------- 298 298 299 - What: CONFIG_THERMAL_HWMON 300 - When: January 2009 301 - Why: This option was introduced just to allow older lm-sensors userspace 302 - to keep working over the upgrade to 2.6.26. At the scheduled time of 303 - removal fixed lm-sensors (2.x or 3.x) should be readily available. 304 - Who: Rene Herman <rene.herman@gmail.com> 305 - 306 - --------------------------- 307 - 308 299 What: Code that is now under CONFIG_WIRELESS_EXT_SYSFS 309 300 (in net/core/net-sysfs.c) 310 301 When: After the only user (hal) has seen a release with the patches
+5
Documentation/kernel-parameters.txt
··· 163 163 164 164 See also Documentation/power/pm.txt, pci=noacpi 165 165 166 + acpi_rsdp= [ACPI,EFI,KEXEC] 167 + Pass the RSDP address to the kernel, mostly used 168 + on machines running EFI runtime service to boot the 169 + second kernel for kdump. 170 + 166 171 acpi_apic_instance= [ACPI, IOAPIC] 167 172 Format: <int> 168 173 2: use 2nd APIC table, if available
+6
drivers/acpi/acpica/acglobal.h
··· 126 126 */ 127 127 u8 ACPI_INIT_GLOBAL(acpi_gbl_truncate_io_addresses, FALSE); 128 128 129 + /* 130 + * Disable runtime checking and repair of values returned by control methods. 131 + * Use only if the repair is causing a problem on a particular machine. 132 + */ 133 + u8 ACPI_INIT_GLOBAL(acpi_gbl_disable_auto_repair, FALSE); 134 + 129 135 /* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */ 130 136 131 137 struct acpi_table_fadt acpi_gbl_FADT;
+1
drivers/acpi/acpica/aclocal.h
··· 357 357 char *pathname; 358 358 const union acpi_predefined_info *predefined; 359 359 union acpi_operand_object *parent_package; 360 + struct acpi_namespace_node *node; 360 361 u32 flags; 361 362 u8 node_flags; 362 363 };
+1
drivers/acpi/acpica/acpredef.h
··· 468 468 {{"_SWS", 0, ACPI_RTYPE_INTEGER}}, 469 469 {{"_TC1", 0, ACPI_RTYPE_INTEGER}}, 470 470 {{"_TC2", 0, ACPI_RTYPE_INTEGER}}, 471 + {{"_TDL", 0, ACPI_RTYPE_INTEGER}}, 471 472 {{"_TIP", 1, ACPI_RTYPE_INTEGER}}, 472 473 {{"_TIV", 1, ACPI_RTYPE_INTEGER}}, 473 474 {{"_TMP", 0, ACPI_RTYPE_INTEGER}},
+13 -6
drivers/acpi/acpica/nspredef.c
··· 193 193 } 194 194 195 195 /* 196 - * 1) We have a return value, but if one wasn't expected, just exit, this is 197 - * not a problem. For example, if the "Implicit Return" feature is 198 - * enabled, methods will always return a value. 196 + * Return value validation and possible repair. 199 197 * 200 - * 2) If the return value can be of any type, then we cannot perform any 201 - * validation, exit. 198 + * 1) Don't perform return value validation/repair if this feature 199 + * has been disabled via a global option. 200 + * 201 + * 2) We have a return value, but if one wasn't expected, just exit, 202 + * this is not a problem. For example, if the "Implicit Return" 203 + * feature is enabled, methods will always return a value. 204 + * 205 + * 3) If the return value can be of any type, then we cannot perform 206 + * any validation, just exit. 202 207 */ 203 - if ((!predefined->info.expected_btypes) || 208 + if (acpi_gbl_disable_auto_repair || 209 + (!predefined->info.expected_btypes) || 204 210 (predefined->info.expected_btypes == ACPI_RTYPE_ALL)) { 205 211 goto cleanup; 206 212 } ··· 218 212 goto cleanup; 219 213 } 220 214 data->predefined = predefined; 215 + data->node = node; 221 216 data->node_flags = node->flags; 222 217 data->pathname = pathname; 223 218
+15
drivers/acpi/acpica/nsrepair2.c
··· 503 503 { 504 504 union acpi_operand_object *return_object = *return_object_ptr; 505 505 acpi_status status; 506 + struct acpi_namespace_node *node; 507 + 508 + /* 509 + * We can only sort the _TSS return package if there is no _PSS in the 510 + * same scope. This is because if _PSS is present, the ACPI specification 511 + * dictates that the _TSS Power Dissipation field is to be ignored, and 512 + * therefore some BIOSs leave garbage values in the _TSS Power field(s). 513 + * In this case, it is best to just return the _TSS package as-is. 514 + * (May, 2011) 515 + */ 516 + status = 517 + acpi_ns_get_node(data->node, "^_PSS", ACPI_NS_NO_UPSEARCH, &node); 518 + if (ACPI_SUCCESS(status)) { 519 + return (AE_OK); 520 + } 506 521 507 522 status = acpi_ns_check_sorted_list(data, return_object, 5, 1, 508 523 ACPI_SORT_DESCENDING,
+22 -5
drivers/acpi/acpica/tbinstal.c
··· 126 126 } 127 127 128 128 /* 129 - * Originally, we checked the table signature for "SSDT" or "PSDT" here. 130 - * Next, we added support for OEMx tables, signature "OEM". 131 - * Valid tables were encountered with a null signature, so we've just 132 - * given up on validating the signature, since it seems to be a waste 133 - * of code. The original code was removed (05/2008). 129 + * Validate the incoming table signature. 130 + * 131 + * 1) Originally, we checked the table signature for "SSDT" or "PSDT". 132 + * 2) We added support for OEMx tables, signature "OEM". 133 + * 3) Valid tables were encountered with a null signature, so we just 134 + * gave up on validating the signature, (05/2008). 135 + * 4) We encountered non-AML tables such as the MADT, which caused 136 + * interpreter errors and kernel faults. So now, we once again allow 137 + * only "SSDT", "OEMx", and now, also a null signature. (05/2011). 134 138 */ 139 + if ((table_desc->pointer->signature[0] != 0x00) && 140 + (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)) 141 + && (ACPI_STRNCMP(table_desc->pointer->signature, "OEM", 3))) { 142 + ACPI_ERROR((AE_INFO, 143 + "Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx", 144 + acpi_ut_valid_acpi_name(*(u32 *)table_desc-> 145 + pointer-> 146 + signature) ? table_desc-> 147 + pointer->signature : "????", 148 + *(u32 *)table_desc->pointer->signature)); 149 + 150 + return_ACPI_STATUS(AE_BAD_SIGNATURE); 151 + } 135 152 136 153 (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); 137 154
+50 -32
drivers/acpi/battery.c
··· 55 55 #define ACPI_BATTERY_NOTIFY_INFO 0x81 56 56 #define ACPI_BATTERY_NOTIFY_THRESHOLD 0x82 57 57 58 + /* Battery power unit: 0 means mW, 1 means mA */ 59 + #define ACPI_BATTERY_POWER_UNIT_MA 1 60 + 58 61 #define _COMPONENT ACPI_BATTERY_COMPONENT 59 62 60 63 ACPI_MODULE_NAME("battery"); ··· 94 91 enum { 95 92 ACPI_BATTERY_ALARM_PRESENT, 96 93 ACPI_BATTERY_XINFO_PRESENT, 97 - /* For buggy DSDTs that report negative 16-bit values for either 98 - * charging or discharging current and/or report 0 as 65536 99 - * due to bad math. 100 - */ 101 - ACPI_BATTERY_QUIRK_SIGNED16_CURRENT, 102 94 ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, 103 95 }; 104 96 ··· 299 301 #ifdef CONFIG_ACPI_PROCFS_POWER 300 302 inline char *acpi_battery_units(struct acpi_battery *battery) 301 303 { 302 - return (battery->power_unit)?"mA":"mW"; 304 + return (battery->power_unit == ACPI_BATTERY_POWER_UNIT_MA) ? 305 + "mA" : "mW"; 303 306 } 304 307 #endif 305 308 ··· 460 461 battery->update_time = jiffies; 461 462 kfree(buffer.pointer); 462 463 463 - if (test_bit(ACPI_BATTERY_QUIRK_SIGNED16_CURRENT, &battery->flags) && 464 - battery->rate_now != -1) 464 + /* For buggy DSDTs that report negative 16-bit values for either 465 + * charging or discharging current and/or report 0 as 65536 466 + * due to bad math. 467 + */ 468 + if (battery->power_unit == ACPI_BATTERY_POWER_UNIT_MA && 469 + battery->rate_now != ACPI_BATTERY_VALUE_UNKNOWN && 470 + (s16)(battery->rate_now) < 0) { 465 471 battery->rate_now = abs((s16)battery->rate_now); 472 + printk_once(KERN_WARNING FW_BUG "battery: (dis)charge rate" 473 + " invalid.\n"); 474 + } 466 475 467 476 if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags) 468 477 && battery->capacity_now >= 0 && battery->capacity_now <= 100) ··· 551 544 { 552 545 int result; 553 546 554 - if (battery->power_unit) { 547 + if (battery->power_unit == ACPI_BATTERY_POWER_UNIT_MA) { 555 548 battery->bat.properties = charge_battery_props; 556 549 battery->bat.num_properties = 557 550 ARRAY_SIZE(charge_battery_props); ··· 573 566 574 567 static void sysfs_remove_battery(struct acpi_battery *battery) 575 568 { 576 - if (!battery->bat.dev) 569 + mutex_lock(&battery->lock); 570 + if (!battery->bat.dev) { 571 + mutex_unlock(&battery->lock); 577 572 return; 573 + } 574 + 578 575 device_remove_file(battery->bat.dev, &alarm_attr); 579 576 power_supply_unregister(&battery->bat); 580 577 battery->bat.dev = NULL; 581 - } 582 - 583 - static void acpi_battery_quirks(struct acpi_battery *battery) 584 - { 585 - if (dmi_name_in_vendors("Acer") && battery->power_unit) { 586 - set_bit(ACPI_BATTERY_QUIRK_SIGNED16_CURRENT, &battery->flags); 587 - } 578 + mutex_unlock(&battery->lock); 588 579 } 589 580 590 581 /* ··· 597 592 * 598 593 * Handle this correctly so that they won't break userspace. 599 594 */ 600 - static void acpi_battery_quirks2(struct acpi_battery *battery) 595 + static void acpi_battery_quirks(struct acpi_battery *battery) 601 596 { 602 597 if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags)) 603 598 return ; ··· 628 623 result = acpi_battery_get_info(battery); 629 624 if (result) 630 625 return result; 631 - acpi_battery_quirks(battery); 632 626 acpi_battery_init_alarm(battery); 633 627 } 634 - if (!battery->bat.dev) 635 - sysfs_add_battery(battery); 628 + if (!battery->bat.dev) { 629 + result = sysfs_add_battery(battery); 630 + if (result) 631 + return result; 632 + } 636 633 result = acpi_battery_get_state(battery); 637 - acpi_battery_quirks2(battery); 634 + acpi_battery_quirks(battery); 638 635 return result; 639 636 } 640 637 ··· 870 863 }, \ 871 864 } 872 865 873 - static struct battery_file { 866 + static const struct battery_file { 874 867 struct file_operations ops; 875 868 mode_t mode; 876 869 const char *name; ··· 955 948 struct acpi_battery *battery = container_of(nb, struct acpi_battery, 956 949 pm_nb); 957 950 switch (mode) { 951 + case PM_POST_HIBERNATION: 958 952 case PM_POST_SUSPEND: 959 - sysfs_remove_battery(battery); 960 - sysfs_add_battery(battery); 953 + if (battery->bat.dev) { 954 + sysfs_remove_battery(battery); 955 + sysfs_add_battery(battery); 956 + } 961 957 break; 962 958 } 963 959 ··· 985 975 if (ACPI_SUCCESS(acpi_get_handle(battery->device->handle, 986 976 "_BIX", &handle))) 987 977 set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags); 988 - acpi_battery_update(battery); 978 + result = acpi_battery_update(battery); 979 + if (result) 980 + goto fail; 989 981 #ifdef CONFIG_ACPI_PROCFS_POWER 990 982 result = acpi_battery_add_fs(device); 991 983 #endif 992 - if (!result) { 993 - printk(KERN_INFO PREFIX "%s Slot [%s] (battery %s)\n", 994 - ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device), 995 - device->status.battery_present ? "present" : "absent"); 996 - } else { 984 + if (result) { 997 985 #ifdef CONFIG_ACPI_PROCFS_POWER 998 986 acpi_battery_remove_fs(device); 999 987 #endif 1000 - kfree(battery); 988 + goto fail; 1001 989 } 990 + 991 + printk(KERN_INFO PREFIX "%s Slot [%s] (battery %s)\n", 992 + ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device), 993 + device->status.battery_present ? "present" : "absent"); 1002 994 1003 995 battery->pm_nb.notifier_call = battery_notify; 1004 996 register_pm_notifier(&battery->pm_nb); 1005 997 998 + return result; 999 + 1000 + fail: 1001 + sysfs_remove_battery(battery); 1002 + mutex_destroy(&battery->lock); 1003 + kfree(battery); 1006 1004 return result; 1007 1005 } 1008 1006
+2 -2
drivers/acpi/dock.c
··· 77 77 struct list_head list; 78 78 struct list_head hotplug_list; 79 79 acpi_handle handle; 80 - struct acpi_dock_ops *ops; 80 + const struct acpi_dock_ops *ops; 81 81 void *context; 82 82 }; 83 83 ··· 589 589 * the dock driver after _DCK is executed. 590 590 */ 591 591 int 592 - register_hotplug_dock_device(acpi_handle handle, struct acpi_dock_ops *ops, 592 + register_hotplug_dock_device(acpi_handle handle, const struct acpi_dock_ops *ops, 593 593 void *context) 594 594 { 595 595 struct dock_dependent_device *dd;
+1 -1
drivers/acpi/ec_sys.c
··· 92 92 return count; 93 93 } 94 94 95 - static struct file_operations acpi_ec_io_ops = { 95 + static const struct file_operations acpi_ec_io_ops = { 96 96 .owner = THIS_MODULE, 97 97 .open = acpi_ec_open_io, 98 98 .read = acpi_ec_read_io,
+1 -1
drivers/acpi/fan.c
··· 110 110 return result; 111 111 } 112 112 113 - static struct thermal_cooling_device_ops fan_cooling_ops = { 113 + static const struct thermal_cooling_device_ops fan_cooling_ops = { 114 114 .get_max_state = fan_get_max_state, 115 115 .get_cur_state = fan_get_cur_state, 116 116 .set_cur_state = fan_set_cur_state,
+23 -2
drivers/acpi/osl.c
··· 155 155 { 156 156 if (!strcmp("Linux", interface)) { 157 157 158 - printk(KERN_NOTICE FW_BUG PREFIX 158 + printk_once(KERN_NOTICE FW_BUG PREFIX 159 159 "BIOS _OSI(Linux) query %s%s\n", 160 160 osi_linux.enable ? "honored" : "ignored", 161 161 osi_linux.cmdline ? " via cmdline" : ··· 237 237 #endif 238 238 } 239 239 240 + #ifdef CONFIG_KEXEC 241 + static unsigned long acpi_rsdp; 242 + static int __init setup_acpi_rsdp(char *arg) 243 + { 244 + acpi_rsdp = simple_strtoul(arg, NULL, 16); 245 + return 0; 246 + } 247 + early_param("acpi_rsdp", setup_acpi_rsdp); 248 + #endif 249 + 240 250 acpi_physical_address __init acpi_os_get_root_pointer(void) 241 251 { 252 + #ifdef CONFIG_KEXEC 253 + if (acpi_rsdp) 254 + return acpi_rsdp; 255 + #endif 256 + 242 257 if (efi_enabled) { 243 258 if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) 244 259 return efi.acpi20; ··· 1098 1083 bool enable; 1099 1084 }; 1100 1085 1101 - static struct osi_setup_entry __initdata osi_setup_entries[OSI_STRING_ENTRIES_MAX]; 1086 + static struct osi_setup_entry __initdata 1087 + osi_setup_entries[OSI_STRING_ENTRIES_MAX] = { 1088 + {"Module Device", true}, 1089 + {"Processor Device", true}, 1090 + {"3.0 _SCP Extensions", true}, 1091 + {"Processor Aggregator Device", true}, 1092 + }; 1102 1093 1103 1094 void __init acpi_osi_setup(char *str) 1104 1095 {
+58
drivers/acpi/pci_irq.c
··· 303 303 /* -------------------------------------------------------------------------- 304 304 PCI Interrupt Routing Support 305 305 -------------------------------------------------------------------------- */ 306 + #ifdef CONFIG_X86_IO_APIC 307 + extern int noioapicquirk; 308 + extern int noioapicreroute; 309 + 310 + static int bridge_has_boot_interrupt_variant(struct pci_bus *bus) 311 + { 312 + struct pci_bus *bus_it; 313 + 314 + for (bus_it = bus ; bus_it ; bus_it = bus_it->parent) { 315 + if (!bus_it->self) 316 + return 0; 317 + if (bus_it->self->irq_reroute_variant) 318 + return bus_it->self->irq_reroute_variant; 319 + } 320 + return 0; 321 + } 322 + 323 + /* 324 + * Some chipsets (e.g. Intel 6700PXH) generate a legacy INTx when the IRQ 325 + * entry in the chipset's IO-APIC is masked (as, e.g. the RT kernel does 326 + * during interrupt handling). When this INTx generation cannot be disabled, 327 + * we reroute these interrupts to their legacy equivalent to get rid of 328 + * spurious interrupts. 329 + */ 330 + static int acpi_reroute_boot_interrupt(struct pci_dev *dev, 331 + struct acpi_prt_entry *entry) 332 + { 333 + if (noioapicquirk || noioapicreroute) { 334 + return 0; 335 + } else { 336 + switch (bridge_has_boot_interrupt_variant(dev->bus)) { 337 + case 0: 338 + /* no rerouting necessary */ 339 + return 0; 340 + case INTEL_IRQ_REROUTE_VARIANT: 341 + /* 342 + * Remap according to INTx routing table in 6700PXH 343 + * specs, intel order number 302628-002, section 344 + * 2.15.2. Other chipsets (80332, ...) have the same 345 + * mapping and are handled here as well. 346 + */ 347 + dev_info(&dev->dev, "PCI IRQ %d -> rerouted to legacy " 348 + "IRQ %d\n", entry->index, 349 + (entry->index % 4) + 16); 350 + entry->index = (entry->index % 4) + 16; 351 + return 1; 352 + default: 353 + dev_warn(&dev->dev, "Cannot reroute IRQ %d to legacy " 354 + "IRQ: unknown mapping\n", entry->index); 355 + return -1; 356 + } 357 + } 358 + } 359 + #endif /* CONFIG_X86_IO_APIC */ 360 + 306 361 static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin) 307 362 { 308 363 struct acpi_prt_entry *entry; ··· 366 311 367 312 entry = acpi_pci_irq_find_prt_entry(dev, pin); 368 313 if (entry) { 314 + #ifdef CONFIG_X86_IO_APIC 315 + acpi_reroute_boot_interrupt(dev, entry); 316 + #endif /* CONFIG_X86_IO_APIC */ 369 317 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %s[%c] _PRT entry\n", 370 318 pci_name(dev), pin_name(pin))); 371 319 return entry;
+2 -1
drivers/acpi/pci_root.c
··· 485 485 root->secondary.end = 0xFF; 486 486 printk(KERN_WARNING FW_BUG PREFIX 487 487 "no secondary bus range in _CRS\n"); 488 - status = acpi_evaluate_integer(device->handle, METHOD_NAME__BBN, NULL, &bus); 488 + status = acpi_evaluate_integer(device->handle, METHOD_NAME__BBN, 489 + NULL, &bus); 489 490 if (ACPI_SUCCESS(status)) 490 491 root->secondary.start = bus; 491 492 else if (status == AE_NOT_FOUND)
+1 -1
drivers/acpi/processor_thermal.c
··· 244 244 return result; 245 245 } 246 246 247 - struct thermal_cooling_device_ops processor_cooling_ops = { 247 + const struct thermal_cooling_device_ops processor_cooling_ops = { 248 248 .get_max_state = processor_get_max_state, 249 249 .get_cur_state = processor_get_cur_state, 250 250 .set_cur_state = processor_set_cur_state,
+11 -2
drivers/acpi/sbs.c
··· 130 130 131 131 #define to_acpi_sbs(x) container_of(x, struct acpi_sbs, charger) 132 132 133 + static int acpi_sbs_remove(struct acpi_device *device, int type); 134 + static int acpi_battery_get_state(struct acpi_battery *battery); 135 + 133 136 static inline int battery_scale(int log) 134 137 { 135 138 int scale = 1; ··· 198 195 199 196 if ((!battery->present) && psp != POWER_SUPPLY_PROP_PRESENT) 200 197 return -ENODEV; 198 + 199 + acpi_battery_get_state(battery); 201 200 switch (psp) { 202 201 case POWER_SUPPLY_PROP_STATUS: 203 202 if (battery->rate_now < 0) ··· 230 225 case POWER_SUPPLY_PROP_POWER_NOW: 231 226 val->intval = abs(battery->rate_now) * 232 227 acpi_battery_ipscale(battery) * 1000; 228 + val->intval *= (acpi_battery_mode(battery)) ? 229 + (battery->voltage_now * 230 + acpi_battery_vscale(battery) / 1000) : 1; 233 231 break; 234 232 case POWER_SUPPLY_PROP_CURRENT_AVG: 235 233 case POWER_SUPPLY_PROP_POWER_AVG: 236 234 val->intval = abs(battery->rate_avg) * 237 235 acpi_battery_ipscale(battery) * 1000; 236 + val->intval *= (acpi_battery_mode(battery)) ? 237 + (battery->voltage_now * 238 + acpi_battery_vscale(battery) / 1000) : 1; 238 239 break; 239 240 case POWER_SUPPLY_PROP_CAPACITY: 240 241 val->intval = battery->state_of_charge; ··· 913 902 } 914 903 } 915 904 } 916 - 917 - static int acpi_sbs_remove(struct acpi_device *device, int type); 918 905 919 906 static int acpi_sbs_add(struct acpi_device *device) 920 907 {
+16
drivers/acpi/sleep.c
··· 428 428 DMI_MATCH(DMI_PRODUCT_NAME, "1000 Series"), 429 429 }, 430 430 }, 431 + { 432 + .callback = init_old_suspend_ordering, 433 + .ident = "Asus A8N-SLI DELUXE", 434 + .matches = { 435 + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), 436 + DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI DELUXE"), 437 + }, 438 + }, 439 + { 440 + .callback = init_old_suspend_ordering, 441 + .ident = "Asus A8N-SLI Premium", 442 + .matches = { 443 + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), 444 + DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI Premium"), 445 + }, 446 + }, 431 447 {}, 432 448 }; 433 449 #endif /* CONFIG_SUSPEND */
+2 -2
drivers/acpi/sysfs.c
··· 149 149 return result; 150 150 } 151 151 152 - static struct kernel_param_ops param_ops_debug_layer = { 152 + static const struct kernel_param_ops param_ops_debug_layer = { 153 153 .set = param_set_uint, 154 154 .get = param_get_debug_layer, 155 155 }; 156 156 157 - static struct kernel_param_ops param_ops_debug_level = { 157 + static const struct kernel_param_ops param_ops_debug_level = { 158 158 .set = param_set_uint, 159 159 .get = param_get_debug_level, 160 160 };
+1 -1
drivers/acpi/thermal.c
··· 812 812 thermal_zone_unbind_cooling_device); 813 813 } 814 814 815 - static struct thermal_zone_device_ops acpi_thermal_zone_ops = { 815 + static const struct thermal_zone_device_ops acpi_thermal_zone_ops = { 816 816 .bind = acpi_thermal_bind_cooling_device, 817 817 .unbind = acpi_thermal_unbind_cooling_device, 818 818 .get_temp = thermal_get_temp,
+1 -1
drivers/acpi/video.c
··· 307 307 return acpi_video_device_lcd_set_level(video, level); 308 308 } 309 309 310 - static struct thermal_cooling_device_ops video_cooling_ops = { 310 + static const struct thermal_cooling_device_ops video_cooling_ops = { 311 311 .get_max_state = video_get_max_state, 312 312 .get_cur_state = video_get_cur_state, 313 313 .set_cur_state = video_set_cur_state,
+2 -2
drivers/ata/libata-acpi.c
··· 218 218 ata_acpi_uevent(dev->link->ap, dev, event); 219 219 } 220 220 221 - static struct acpi_dock_ops ata_acpi_dev_dock_ops = { 221 + static const struct acpi_dock_ops ata_acpi_dev_dock_ops = { 222 222 .handler = ata_acpi_dev_notify_dock, 223 223 .uevent = ata_acpi_dev_uevent, 224 224 }; 225 225 226 - static struct acpi_dock_ops ata_acpi_ap_dock_ops = { 226 + static const struct acpi_dock_ops ata_acpi_ap_dock_ops = { 227 227 .handler = ata_acpi_ap_notify_dock, 228 228 .uevent = ata_acpi_ap_uevent, 229 229 };
+1 -1
drivers/pci/hotplug/acpiphp_glue.c
··· 110 110 } 111 111 112 112 113 - static struct acpi_dock_ops acpiphp_dock_ops = { 113 + static const struct acpi_dock_ops acpiphp_dock_ops = { 114 114 .handler = handle_hotplug_event_func, 115 115 }; 116 116
+2 -6
drivers/thermal/Kconfig
··· 14 14 If you want this support, you should say Y or M here. 15 15 16 16 config THERMAL_HWMON 17 - bool "Hardware monitoring support" 17 + bool 18 18 depends on THERMAL 19 19 depends on HWMON=y || HWMON=THERMAL 20 - help 21 - The generic thermal sysfs driver's hardware monitoring support 22 - requires a 2.10.7/3.0.2 or later lm-sensors userspace. 23 - 24 - Say Y if your user-space is new enough. 20 + default y
+111 -31
drivers/thermal/thermal_sys.c
··· 420 420 421 421 /* hwmon sys I/F */ 422 422 #include <linux/hwmon.h> 423 + 424 + /* thermal zone devices with the same type share one hwmon device */ 425 + struct thermal_hwmon_device { 426 + char type[THERMAL_NAME_LENGTH]; 427 + struct device *device; 428 + int count; 429 + struct list_head tz_list; 430 + struct list_head node; 431 + }; 432 + 433 + struct thermal_hwmon_attr { 434 + struct device_attribute attr; 435 + char name[16]; 436 + }; 437 + 438 + /* one temperature input for each thermal zone */ 439 + struct thermal_hwmon_temp { 440 + struct list_head hwmon_node; 441 + struct thermal_zone_device *tz; 442 + struct thermal_hwmon_attr temp_input; /* hwmon sys attr */ 443 + struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */ 444 + }; 445 + 423 446 static LIST_HEAD(thermal_hwmon_list); 424 447 425 448 static ssize_t ··· 460 437 int ret; 461 438 struct thermal_hwmon_attr *hwmon_attr 462 439 = container_of(attr, struct thermal_hwmon_attr, attr); 463 - struct thermal_zone_device *tz 464 - = container_of(hwmon_attr, struct thermal_zone_device, 440 + struct thermal_hwmon_temp *temp 441 + = container_of(hwmon_attr, struct thermal_hwmon_temp, 465 442 temp_input); 443 + struct thermal_zone_device *tz = temp->tz; 466 444 467 445 ret = tz->ops->get_temp(tz, &temperature); 468 446 ··· 479 455 { 480 456 struct thermal_hwmon_attr *hwmon_attr 481 457 = container_of(attr, struct thermal_hwmon_attr, attr); 482 - struct thermal_zone_device *tz 483 - = container_of(hwmon_attr, struct thermal_zone_device, 458 + struct thermal_hwmon_temp *temp 459 + = container_of(hwmon_attr, struct thermal_hwmon_temp, 484 460 temp_crit); 461 + struct thermal_zone_device *tz = temp->tz; 485 462 long temperature; 486 463 int ret; 487 464 ··· 494 469 } 495 470 496 471 497 - static int 498 - thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) 472 + static struct thermal_hwmon_device * 473 + thermal_hwmon_lookup_by_type(const struct thermal_zone_device *tz) 499 474 { 500 475 struct thermal_hwmon_device *hwmon; 501 - int new_hwmon_device = 1; 502 - int result; 503 476 504 477 mutex_lock(&thermal_list_lock); 505 478 list_for_each_entry(hwmon, &thermal_hwmon_list, node) 506 479 if (!strcmp(hwmon->type, tz->type)) { 507 - new_hwmon_device = 0; 508 480 mutex_unlock(&thermal_list_lock); 509 - goto register_sys_interface; 481 + return hwmon; 510 482 } 511 483 mutex_unlock(&thermal_list_lock); 484 + 485 + return NULL; 486 + } 487 + 488 + /* Find the temperature input matching a given thermal zone */ 489 + static struct thermal_hwmon_temp * 490 + thermal_hwmon_lookup_temp(const struct thermal_hwmon_device *hwmon, 491 + const struct thermal_zone_device *tz) 492 + { 493 + struct thermal_hwmon_temp *temp; 494 + 495 + mutex_lock(&thermal_list_lock); 496 + list_for_each_entry(temp, &hwmon->tz_list, hwmon_node) 497 + if (temp->tz == tz) { 498 + mutex_unlock(&thermal_list_lock); 499 + return temp; 500 + } 501 + mutex_unlock(&thermal_list_lock); 502 + 503 + return NULL; 504 + } 505 + 506 + static int 507 + thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) 508 + { 509 + struct thermal_hwmon_device *hwmon; 510 + struct thermal_hwmon_temp *temp; 511 + int new_hwmon_device = 1; 512 + int result; 513 + 514 + hwmon = thermal_hwmon_lookup_by_type(tz); 515 + if (hwmon) { 516 + new_hwmon_device = 0; 517 + goto register_sys_interface; 518 + } 512 519 513 520 hwmon = kzalloc(sizeof(struct thermal_hwmon_device), GFP_KERNEL); 514 521 if (!hwmon) ··· 559 502 goto free_mem; 560 503 561 504 register_sys_interface: 562 - tz->hwmon = hwmon; 505 + temp = kzalloc(sizeof(struct thermal_hwmon_temp), GFP_KERNEL); 506 + if (!temp) { 507 + result = -ENOMEM; 508 + goto unregister_name; 509 + } 510 + 511 + temp->tz = tz; 563 512 hwmon->count++; 564 513 565 - snprintf(tz->temp_input.name, THERMAL_NAME_LENGTH, 514 + snprintf(temp->temp_input.name, THERMAL_NAME_LENGTH, 566 515 "temp%d_input", hwmon->count); 567 - tz->temp_input.attr.attr.name = tz->temp_input.name; 568 - tz->temp_input.attr.attr.mode = 0444; 569 - tz->temp_input.attr.show = temp_input_show; 570 - sysfs_attr_init(&tz->temp_input.attr.attr); 571 - result = device_create_file(hwmon->device, &tz->temp_input.attr); 516 + temp->temp_input.attr.attr.name = temp->temp_input.name; 517 + temp->temp_input.attr.attr.mode = 0444; 518 + temp->temp_input.attr.show = temp_input_show; 519 + sysfs_attr_init(&temp->temp_input.attr.attr); 520 + result = device_create_file(hwmon->device, &temp->temp_input.attr); 572 521 if (result) 573 - goto unregister_name; 522 + goto free_temp_mem; 574 523 575 524 if (tz->ops->get_crit_temp) { 576 525 unsigned long temperature; 577 526 if (!tz->ops->get_crit_temp(tz, &temperature)) { 578 - snprintf(tz->temp_crit.name, THERMAL_NAME_LENGTH, 527 + snprintf(temp->temp_crit.name, THERMAL_NAME_LENGTH, 579 528 "temp%d_crit", hwmon->count); 580 - tz->temp_crit.attr.attr.name = tz->temp_crit.name; 581 - tz->temp_crit.attr.attr.mode = 0444; 582 - tz->temp_crit.attr.show = temp_crit_show; 583 - sysfs_attr_init(&tz->temp_crit.attr.attr); 529 + temp->temp_crit.attr.attr.name = temp->temp_crit.name; 530 + temp->temp_crit.attr.attr.mode = 0444; 531 + temp->temp_crit.attr.show = temp_crit_show; 532 + sysfs_attr_init(&temp->temp_crit.attr.attr); 584 533 result = device_create_file(hwmon->device, 585 - &tz->temp_crit.attr); 534 + &temp->temp_crit.attr); 586 535 if (result) 587 536 goto unregister_input; 588 537 } ··· 597 534 mutex_lock(&thermal_list_lock); 598 535 if (new_hwmon_device) 599 536 list_add_tail(&hwmon->node, &thermal_hwmon_list); 600 - list_add_tail(&tz->hwmon_node, &hwmon->tz_list); 537 + list_add_tail(&temp->hwmon_node, &hwmon->tz_list); 601 538 mutex_unlock(&thermal_list_lock); 602 539 603 540 return 0; 604 541 605 542 unregister_input: 606 - device_remove_file(hwmon->device, &tz->temp_input.attr); 543 + device_remove_file(hwmon->device, &temp->temp_input.attr); 544 + free_temp_mem: 545 + kfree(temp); 607 546 unregister_name: 608 547 if (new_hwmon_device) { 609 548 device_remove_file(hwmon->device, &dev_attr_name); ··· 621 556 static void 622 557 thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz) 623 558 { 624 - struct thermal_hwmon_device *hwmon = tz->hwmon; 559 + struct thermal_hwmon_device *hwmon; 560 + struct thermal_hwmon_temp *temp; 625 561 626 - tz->hwmon = NULL; 627 - device_remove_file(hwmon->device, &tz->temp_input.attr); 562 + hwmon = thermal_hwmon_lookup_by_type(tz); 563 + if (unlikely(!hwmon)) { 564 + /* Should never happen... */ 565 + dev_dbg(&tz->device, "hwmon device lookup failed!\n"); 566 + return; 567 + } 568 + 569 + temp = thermal_hwmon_lookup_temp(hwmon, tz); 570 + if (unlikely(!temp)) { 571 + /* Should never happen... */ 572 + dev_dbg(&tz->device, "temperature input lookup failed!\n"); 573 + return; 574 + } 575 + 576 + device_remove_file(hwmon->device, &temp->temp_input.attr); 628 577 if (tz->ops->get_crit_temp) 629 - device_remove_file(hwmon->device, &tz->temp_crit.attr); 578 + device_remove_file(hwmon->device, &temp->temp_crit.attr); 630 579 631 580 mutex_lock(&thermal_list_lock); 632 - list_del(&tz->hwmon_node); 581 + list_del(&temp->hwmon_node); 582 + kfree(temp); 633 583 if (!list_empty(&hwmon->tz_list)) { 634 584 mutex_unlock(&thermal_list_lock); 635 585 return;
+1 -1
include/acpi/acpi_drivers.h
··· 128 128 extern int register_dock_notifier(struct notifier_block *nb); 129 129 extern void unregister_dock_notifier(struct notifier_block *nb); 130 130 extern int register_hotplug_dock_device(acpi_handle handle, 131 - struct acpi_dock_ops *ops, 131 + const struct acpi_dock_ops *ops, 132 132 void *context); 133 133 extern void unregister_hotplug_dock_device(acpi_handle handle); 134 134 #else
+2 -1
include/acpi/acpixf.h
··· 47 47 48 48 /* Current ACPICA subsystem version in YYYYMMDD format */ 49 49 50 - #define ACPI_CA_VERSION 0x20110413 50 + #define ACPI_CA_VERSION 0x20110623 51 51 52 52 #include "actypes.h" 53 53 #include "actbl.h" ··· 69 69 extern u32 acpi_gbl_enable_aml_debug_object; 70 70 extern u8 acpi_gbl_copy_dsdt_locally; 71 71 extern u8 acpi_gbl_truncate_io_addresses; 72 + extern u8 acpi_gbl_disable_auto_repair; 72 73 73 74 extern u32 acpi_current_gpe_count; 74 75 extern struct acpi_table_fadt acpi_gbl_FADT;
+1 -1
include/acpi/processor.h
··· 337 337 338 338 /* in processor_thermal.c */ 339 339 int acpi_processor_get_limit_info(struct acpi_processor *pr); 340 - extern struct thermal_cooling_device_ops processor_cooling_ops; 340 + extern const struct thermal_cooling_device_ops processor_cooling_ops; 341 341 #ifdef CONFIG_CPU_FREQ 342 342 void acpi_thermal_cpufreq_init(void); 343 343 void acpi_thermal_cpufreq_exit(void);
-1
include/linux/acpi.h
··· 238 238 extern int pnpacpi_disabled; 239 239 240 240 #define PXM_INVAL (-1) 241 - #define NID_INVAL (-1) 242 241 243 242 int acpi_check_resource_conflict(const struct resource *res); 244 243
-22
include/linux/thermal.h
··· 85 85 ((long)t-2732+5)/10 : ((long)t-2732-5)/10) 86 86 #define CELSIUS_TO_KELVIN(t) ((t)*10+2732) 87 87 88 - #if defined(CONFIG_THERMAL_HWMON) 89 - /* thermal zone devices with the same type share one hwmon device */ 90 - struct thermal_hwmon_device { 91 - char type[THERMAL_NAME_LENGTH]; 92 - struct device *device; 93 - int count; 94 - struct list_head tz_list; 95 - struct list_head node; 96 - }; 97 - 98 - struct thermal_hwmon_attr { 99 - struct device_attribute attr; 100 - char name[16]; 101 - }; 102 - #endif 103 - 104 88 struct thermal_zone_device { 105 89 int id; 106 90 char type[THERMAL_NAME_LENGTH]; ··· 104 120 struct mutex lock; /* protect cooling devices list */ 105 121 struct list_head node; 106 122 struct delayed_work poll_queue; 107 - #if defined(CONFIG_THERMAL_HWMON) 108 - struct list_head hwmon_node; 109 - struct thermal_hwmon_device *hwmon; 110 - struct thermal_hwmon_attr temp_input; /* hwmon sys attr */ 111 - struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */ 112 - #endif 113 123 }; 114 124 /* Adding event notification support elements */ 115 125 #define THERMAL_GENL_FAMILY_NAME "thermal_event"