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

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

* 'release-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-acpi-2.6:
ACPI: Fix thermal shutdowns
ACPI: bounds check IRQ to prevent memory corruption
ACPI: Avoid bogus EC timeout when EC is in Polling mode
ACPI : Add the EC dmi table to fix the incorrect ECDT table
ACPI: Properly clear flags on false-positives and send uevent on sudden unplug
acpi: trivial cleanups
acer-wmi: Fix wireless and bluetooth on early AMW0 v2 laptops
ACPI: WMI: Set instance for query block calls
ACPICA: Additional error checking for pathname utilities
ACPICA: Fix possible memory leak in Unload() operator
ACPICA: Fix memory leak when deleting thermal/processor objects

+127 -34
+8 -3
drivers/acpi/dock.c
··· 563 563 */ 564 564 static int handle_eject_request(struct dock_station *ds, u32 event) 565 565 { 566 - if (!dock_present(ds)) 567 - return -ENODEV; 568 - 569 566 if (dock_in_progress(ds)) 570 567 return -EBUSY; 571 568 ··· 570 573 * here we need to generate the undock 571 574 * event prior to actually doing the undock 572 575 * so that the device struct still exists. 576 + * Also, even send the dock event if the 577 + * device is not present anymore 573 578 */ 574 579 dock_event(ds, event, UNDOCK_EVENT); 580 + 581 + if (!dock_present(ds)) { 582 + complete_undock(ds); 583 + return -ENODEV; 584 + } 585 + 575 586 hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST); 576 587 undock(ds); 577 588 eject_dock(ds);
+36
drivers/acpi/ec.c
··· 110 110 u8 handlers_installed; 111 111 } *boot_ec, *first_ec; 112 112 113 + /* 114 + * Some Asus system have exchanged ECDT data/command IO addresses. 115 + */ 116 + static int print_ecdt_error(const struct dmi_system_id *id) 117 + { 118 + printk(KERN_NOTICE PREFIX "%s detected - " 119 + "ECDT has exchanged control/data I/O address\n", 120 + id->ident); 121 + return 0; 122 + } 123 + 124 + static struct dmi_system_id __cpuinitdata ec_dmi_table[] = { 125 + { 126 + print_ecdt_error, "Asus L4R", { 127 + DMI_MATCH(DMI_BIOS_VERSION, "1008.006"), 128 + DMI_MATCH(DMI_PRODUCT_NAME, "L4R"), 129 + DMI_MATCH(DMI_BOARD_NAME, "L4R") }, NULL}, 130 + { 131 + print_ecdt_error, "Asus M6R", { 132 + DMI_MATCH(DMI_BIOS_VERSION, "0207"), 133 + DMI_MATCH(DMI_PRODUCT_NAME, "M6R"), 134 + DMI_MATCH(DMI_BOARD_NAME, "M6R") }, NULL}, 135 + {}, 136 + }; 137 + 113 138 /* -------------------------------------------------------------------------- 114 139 Transaction Management 115 140 -------------------------------------------------------------------------- */ ··· 221 196 return 0; 222 197 msleep(1); 223 198 } 199 + if (acpi_ec_check_status(ec,event)) 200 + return 0; 224 201 } 225 202 pr_err(PREFIX "acpi_ec_wait timeout, status = 0x%2.2x, event = %s\n", 226 203 acpi_ec_read_status(ec), ··· 938 911 pr_info(PREFIX "EC description table is found, configuring boot EC\n"); 939 912 boot_ec->command_addr = ecdt_ptr->control.address; 940 913 boot_ec->data_addr = ecdt_ptr->data.address; 914 + if (dmi_check_system(ec_dmi_table)) { 915 + /* 916 + * If the board falls into ec_dmi_table, it means 917 + * that ECDT table gives the incorrect command/status 918 + * & data I/O address. Just fix it. 919 + */ 920 + boot_ec->data_addr = ecdt_ptr->control.address; 921 + boot_ec->command_addr = ecdt_ptr->data.address; 922 + } 941 923 boot_ec->gpe = ecdt_ptr->gpe; 942 924 boot_ec->handle = ACPI_ROOT_OBJECT; 943 925 acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle);
+3
drivers/acpi/executer/exconfig.c
··· 479 479 480 480 acpi_tb_set_table_loaded_flag(table_index, FALSE); 481 481 482 + /* Table unloaded, remove a reference to the ddb_handle object */ 483 + 484 + acpi_ut_remove_reference(ddb_handle); 482 485 return_ACPI_STATUS(AE_OK); 483 486 }
+22 -12
drivers/acpi/namespace/nsnames.c
··· 56 56 * Size - Size of the pathname 57 57 * *name_buffer - Where to return the pathname 58 58 * 59 - * RETURN: Places the pathname into the name_buffer, in external format 59 + * RETURN: Status 60 + * Places the pathname into the name_buffer, in external format 60 61 * (name segments separated by path separators) 61 62 * 62 63 * DESCRIPTION: Generate a full pathaname 63 64 * 64 65 ******************************************************************************/ 65 - void 66 + acpi_status 66 67 acpi_ns_build_external_path(struct acpi_namespace_node *node, 67 68 acpi_size size, char *name_buffer) 68 69 { ··· 78 77 if (index < ACPI_NAME_SIZE) { 79 78 name_buffer[0] = AML_ROOT_PREFIX; 80 79 name_buffer[1] = 0; 81 - return; 80 + return (AE_OK); 82 81 } 83 82 84 83 /* Store terminator byte, then build name backwards */ ··· 106 105 107 106 if (index != 0) { 108 107 ACPI_ERROR((AE_INFO, 109 - "Could not construct pathname; index=%X, size=%X, Path=%s", 108 + "Could not construct external pathname; index=%X, size=%X, Path=%s", 110 109 (u32) index, (u32) size, &name_buffer[size])); 110 + 111 + return (AE_BAD_PARAMETER); 111 112 } 112 113 113 - return; 114 + return (AE_OK); 114 115 } 115 116 116 117 #ifdef ACPI_DEBUG_OUTPUT ··· 132 129 133 130 char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node) 134 131 { 132 + acpi_status status; 135 133 char *name_buffer; 136 134 acpi_size size; 137 135 ··· 142 138 143 139 size = acpi_ns_get_pathname_length(node); 144 140 if (!size) { 145 - ACPI_ERROR((AE_INFO, "Invalid node failure")); 146 - return_PTR(NULL); 141 + return (NULL); 147 142 } 148 143 149 144 /* Allocate a buffer to be returned to caller */ ··· 155 152 156 153 /* Build the path in the allocated buffer */ 157 154 158 - acpi_ns_build_external_path(node, size, name_buffer); 155 + status = acpi_ns_build_external_path(node, size, name_buffer); 156 + if (ACPI_FAILURE(status)) { 157 + return (NULL); 158 + } 159 + 159 160 return_PTR(name_buffer); 160 161 } 161 162 #endif ··· 193 186 while (next_node && (next_node != acpi_gbl_root_node)) { 194 187 if (ACPI_GET_DESCRIPTOR_TYPE(next_node) != ACPI_DESC_TYPE_NAMED) { 195 188 ACPI_ERROR((AE_INFO, 196 - "Invalid NS Node (%p) while traversing path", 189 + "Invalid Namespace Node (%p) while traversing namespace", 197 190 next_node)); 198 191 return 0; 199 192 } ··· 241 234 242 235 required_size = acpi_ns_get_pathname_length(node); 243 236 if (!required_size) { 244 - ACPI_ERROR((AE_INFO, "Invalid node failure")); 245 - return_ACPI_STATUS(AE_ERROR); 237 + return_ACPI_STATUS(AE_BAD_PARAMETER); 246 238 } 247 239 248 240 /* Validate/Allocate/Clear caller buffer */ ··· 253 247 254 248 /* Build the path in the caller buffer */ 255 249 256 - acpi_ns_build_external_path(node, required_size, buffer->pointer); 250 + status = 251 + acpi_ns_build_external_path(node, required_size, buffer->pointer); 252 + if (ACPI_FAILURE(status)) { 253 + return_ACPI_STATUS(status); 254 + } 257 255 258 256 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X]\n", 259 257 (char *)buffer->pointer, (u32) required_size));
+7 -5
drivers/acpi/pci_link.c
··· 849 849 if (irq < 0) 850 850 continue; 851 851 852 - if (irq >= ACPI_MAX_IRQS) 852 + if (irq >= ARRAY_SIZE(acpi_irq_penalty)) 853 853 continue; 854 854 855 855 if (used) ··· 872 872 */ 873 873 void acpi_penalize_isa_irq(int irq, int active) 874 874 { 875 - if (active) 876 - acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED; 877 - else 878 - acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING; 875 + if (irq >= 0 && irq < ARRAY_SIZE(acpi_irq_penalty)) { 876 + if (active) 877 + acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED; 878 + else 879 + acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING; 880 + } 879 881 } 880 882 881 883 /*
+1 -1
drivers/acpi/processor_core.c
··· 123 123 static int set_no_mwait(const struct dmi_system_id *id) 124 124 { 125 125 printk(KERN_NOTICE PREFIX "%s detected - " 126 - "disable mwait for CPU C-stetes\n", id->ident); 126 + "disabling mwait for CPU C-states\n", id->ident); 127 127 idle_nomwait = 1; 128 128 return 0; 129 129 }
-1
drivers/acpi/processor_idle.c
··· 41 41 #include <linux/pm_qos_params.h> 42 42 #include <linux/clockchips.h> 43 43 #include <linux/cpuidle.h> 44 - #include <linux/cpuidle.h> 45 44 46 45 /* 47 46 * Include the apic definitions for x86 to have the APIC timer related defines
+1 -1
drivers/acpi/processor_perflib.c
··· 70 70 * 0 -> cpufreq low level drivers initialized -> consider _PPC values 71 71 * 1 -> ignore _PPC totally -> forced by user through boot param 72 72 */ 73 - static unsigned int ignore_ppc = -1; 73 + static int ignore_ppc = -1; 74 74 module_param(ignore_ppc, uint, 0644); 75 75 MODULE_PARM_DESC(ignore_ppc, "If the frequency of your machine gets wrongly" \ 76 76 "limited by BIOS, this should help");
+3
drivers/acpi/resources/rscalc.c
··· 587 587 } else { 588 588 temp_size_needed += 589 589 acpi_ns_get_pathname_length((*sub_object_list)->reference.node); 590 + if (!temp_size_needed) { 591 + return_ACPI_STATUS(AE_BAD_PARAMETER); 592 + } 590 593 } 591 594 } else { 592 595 /*
+5 -3
drivers/acpi/utilities/utalloc.c
··· 242 242 { 243 243 acpi_status status = AE_OK; 244 244 245 - if (!required_length) { 246 - WARN_ON(1); 247 - return AE_ERROR; 245 + /* Parameter validation */ 246 + 247 + if (!buffer || !required_length) { 248 + return (AE_BAD_PARAMETER); 248 249 } 250 + 249 251 switch (buffer->length) { 250 252 case ACPI_NO_BUFFER: 251 253
+11 -2
drivers/acpi/utilities/utdelete.c
··· 135 135 obj_pointer = object->package.elements; 136 136 break; 137 137 138 + /* 139 + * These objects have a possible list of notify handlers. 140 + * Device object also may have a GPE block. 141 + */ 138 142 case ACPI_TYPE_DEVICE: 139 143 140 144 if (object->device.gpe_block) { ··· 146 142 gpe_block); 147 143 } 148 144 149 - /* Walk the handler list for this device */ 145 + /*lint -fallthrough */ 150 146 151 - handler_desc = object->device.handler; 147 + case ACPI_TYPE_PROCESSOR: 148 + case ACPI_TYPE_THERMAL: 149 + 150 + /* Walk the notify handler list for this object */ 151 + 152 + handler_desc = object->common_notify.handler; 152 153 while (handler_desc) { 153 154 next_desc = handler_desc->address_space.next; 154 155 acpi_ut_remove_reference(handler_desc);
+9 -4
drivers/acpi/utilities/utobject.c
··· 425 425 acpi_size * obj_length) 426 426 { 427 427 acpi_size length; 428 + acpi_size size; 428 429 acpi_status status = AE_OK; 429 430 430 431 ACPI_FUNCTION_TRACE_PTR(ut_get_simple_object_size, internal_object); ··· 485 484 * Get the actual length of the full pathname to this object. 486 485 * The reference will be converted to the pathname to the object 487 486 */ 488 - length += 489 - ACPI_ROUND_UP_TO_NATIVE_WORD 490 - (acpi_ns_get_pathname_length 491 - (internal_object->reference.node)); 487 + size = 488 + acpi_ns_get_pathname_length(internal_object-> 489 + reference.node); 490 + if (!size) { 491 + return_ACPI_STATUS(AE_BAD_PARAMETER); 492 + } 493 + 494 + length += ACPI_ROUND_UP_TO_NATIVE_WORD(size); 492 495 break; 493 496 494 497 default:
+1 -1
drivers/acpi/wmi.c
··· 347 347 strcpy(method, "WQ"); 348 348 strncat(method, block->object_id, 2); 349 349 350 - status = acpi_evaluate_object(handle, method, NULL, out); 350 + status = acpi_evaluate_object(handle, method, &input, out); 351 351 352 352 /* 353 353 * If ACPI_WMI_EXPENSIVE, call the relevant WCxx method, even if
+19
drivers/misc/acer-wmi.c
··· 803 803 804 804 static acpi_status set_u32(u32 value, u32 cap) 805 805 { 806 + acpi_status status; 807 + 806 808 if (interface->capability & cap) { 807 809 switch (interface->type) { 808 810 case ACER_AMW0: 809 811 return AMW0_set_u32(value, cap, interface); 810 812 case ACER_AMW0_V2: 813 + if (cap == ACER_CAP_MAILLED) 814 + return AMW0_set_u32(value, cap, interface); 815 + 816 + /* 817 + * On some models, some WMID methods don't toggle 818 + * properly. For those cases, we want to run the AMW0 819 + * method afterwards to be certain we've really toggled 820 + * the device state. 821 + */ 822 + if (cap == ACER_CAP_WIRELESS || 823 + cap == ACER_CAP_BLUETOOTH) { 824 + status = WMID_set_u32(value, cap, interface); 825 + if (ACPI_FAILURE(status)) 826 + return status; 827 + 828 + return AMW0_set_u32(value, cap, interface); 829 + } 811 830 case ACER_WMID: 812 831 return WMID_set_u32(value, cap, interface); 813 832 default:
+1 -1
include/acpi/acnamesp.h
··· 182 182 */ 183 183 u32 acpi_ns_opens_scope(acpi_object_type type); 184 184 185 - void 185 + acpi_status 186 186 acpi_ns_build_external_path(struct acpi_namespace_node *node, 187 187 acpi_size size, char *name_buffer); 188 188