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:
ACPICA: fix acpi-cpufreq boot crash due to _PSD return-by-reference
ACPI: Delete the IRQ operation in throttling controll via PTC

+112 -13
+84 -5
drivers/acpi/dispatcher/dsobject.c
··· 137 137 return_ACPI_STATUS(status); 138 138 } 139 139 } 140 + 141 + /* Special object resolution for elements of a package */ 142 + 143 + if ((op->common.parent->common.aml_opcode == AML_PACKAGE_OP) || 144 + (op->common.parent->common.aml_opcode == 145 + AML_VAR_PACKAGE_OP)) { 146 + /* 147 + * Attempt to resolve the node to a value before we insert it into 148 + * the package. If this is a reference to a common data type, 149 + * resolve it immediately. According to the ACPI spec, package 150 + * elements can only be "data objects" or method references. 151 + * Attempt to resolve to an Integer, Buffer, String or Package. 152 + * If cannot, return the named reference (for things like Devices, 153 + * Methods, etc.) Buffer Fields and Fields will resolve to simple 154 + * objects (int/buf/str/pkg). 155 + * 156 + * NOTE: References to things like Devices, Methods, Mutexes, etc. 157 + * will remain as named references. This behavior is not described 158 + * in the ACPI spec, but it appears to be an oversight. 159 + */ 160 + obj_desc = (union acpi_operand_object *)op->common.node; 161 + 162 + status = 163 + acpi_ex_resolve_node_to_value(ACPI_CAST_INDIRECT_PTR 164 + (struct 165 + acpi_namespace_node, 166 + &obj_desc), 167 + walk_state); 168 + if (ACPI_FAILURE(status)) { 169 + return_ACPI_STATUS(status); 170 + } 171 + 172 + switch (op->common.node->type) { 173 + /* 174 + * For these types, we need the actual node, not the subobject. 175 + * However, the subobject got an extra reference count above. 176 + */ 177 + case ACPI_TYPE_MUTEX: 178 + case ACPI_TYPE_METHOD: 179 + case ACPI_TYPE_POWER: 180 + case ACPI_TYPE_PROCESSOR: 181 + case ACPI_TYPE_EVENT: 182 + case ACPI_TYPE_REGION: 183 + case ACPI_TYPE_DEVICE: 184 + case ACPI_TYPE_THERMAL: 185 + 186 + obj_desc = 187 + (union acpi_operand_object *)op->common. 188 + node; 189 + break; 190 + 191 + default: 192 + break; 193 + } 194 + 195 + /* 196 + * If above resolved to an operand object, we are done. Otherwise, 197 + * we have a NS node, we must create the package entry as a named 198 + * reference. 199 + */ 200 + if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != 201 + ACPI_DESC_TYPE_NAMED) { 202 + goto exit; 203 + } 204 + } 140 205 } 141 206 142 207 /* Create and init a new internal ACPI object */ ··· 221 156 return_ACPI_STATUS(status); 222 157 } 223 158 159 + exit: 224 160 *obj_desc_ptr = obj_desc; 225 161 return_ACPI_STATUS(AE_OK); 226 162 } ··· 422 356 arg = arg->common.next; 423 357 for (i = 0; arg && (i < element_count); i++) { 424 358 if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) { 359 + if (arg->common.node->type == ACPI_TYPE_METHOD) { 360 + /* 361 + * A method reference "looks" to the parser to be a method 362 + * invocation, so we special case it here 363 + */ 364 + arg->common.aml_opcode = AML_INT_NAMEPATH_OP; 365 + status = 366 + acpi_ds_build_internal_object(walk_state, 367 + arg, 368 + &obj_desc-> 369 + package. 370 + elements[i]); 371 + } else { 372 + /* This package element is already built, just get it */ 425 373 426 - /* This package element is already built, just get it */ 427 - 428 - obj_desc->package.elements[i] = 429 - ACPI_CAST_PTR(union acpi_operand_object, 430 - arg->common.node); 374 + obj_desc->package.elements[i] = 375 + ACPI_CAST_PTR(union acpi_operand_object, 376 + arg->common.node); 377 + } 431 378 } else { 432 379 status = acpi_ds_build_internal_object(walk_state, arg, 433 380 &obj_desc->
+28 -8
drivers/acpi/processor_throttling.c
··· 29 29 #include <linux/kernel.h> 30 30 #include <linux/module.h> 31 31 #include <linux/init.h> 32 + #include <linux/sched.h> 32 33 #include <linux/cpufreq.h> 33 34 #include <linux/proc_fs.h> 34 35 #include <linux/seq_file.h> ··· 414 413 } else { 415 414 msr_low = 0; 416 415 msr_high = 0; 417 - rdmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, 416 + rdmsr_safe(MSR_IA32_THERM_CONTROL, 418 417 (u32 *)&msr_low , (u32 *) &msr_high); 419 418 msr = (msr_high << 32) | msr_low; 420 419 *value = (acpi_integer) msr; ··· 439 438 "HARDWARE addr space,NOT supported yet\n"); 440 439 } else { 441 440 msr = value; 442 - wrmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, 441 + wrmsr_safe(MSR_IA32_THERM_CONTROL, 443 442 msr & 0xffffffff, msr >> 32); 444 443 ret = 0; 445 444 } ··· 573 572 return -ENODEV; 574 573 575 574 pr->throttling.state = 0; 576 - local_irq_disable(); 575 + 577 576 value = 0; 578 577 ret = acpi_read_throttling_status(pr, &value); 579 578 if (ret >= 0) { 580 579 state = acpi_get_throttling_state(pr, value); 581 580 pr->throttling.state = state; 582 581 } 583 - local_irq_enable(); 584 582 585 583 return 0; 586 584 } 587 585 588 586 static int acpi_processor_get_throttling(struct acpi_processor *pr) 589 587 { 590 - return pr->throttling.acpi_processor_get_throttling(pr); 588 + cpumask_t saved_mask; 589 + int ret; 590 + 591 + /* 592 + * Migrate task to the cpu pointed by pr. 593 + */ 594 + saved_mask = current->cpus_allowed; 595 + set_cpus_allowed(current, cpumask_of_cpu(pr->id)); 596 + ret = pr->throttling.acpi_processor_get_throttling(pr); 597 + /* restore the previous state */ 598 + set_cpus_allowed(current, saved_mask); 599 + 600 + return ret; 591 601 } 592 602 593 603 static int acpi_processor_get_fadt_info(struct acpi_processor *pr) ··· 729 717 if (state < pr->throttling_platform_limit) 730 718 return -EPERM; 731 719 732 - local_irq_disable(); 733 720 value = 0; 734 721 ret = acpi_get_throttling_value(pr, state, &value); 735 722 if (ret >= 0) { 736 723 acpi_write_throttling_state(pr, value); 737 724 pr->throttling.state = state; 738 725 } 739 - local_irq_enable(); 740 726 741 727 return 0; 742 728 } 743 729 744 730 int acpi_processor_set_throttling(struct acpi_processor *pr, int state) 745 731 { 746 - return pr->throttling.acpi_processor_set_throttling(pr, state); 732 + cpumask_t saved_mask; 733 + int ret; 734 + /* 735 + * Migrate task to the cpu pointed by pr. 736 + */ 737 + saved_mask = current->cpus_allowed; 738 + set_cpus_allowed(current, cpumask_of_cpu(pr->id)); 739 + ret = pr->throttling.acpi_processor_set_throttling(pr, state); 740 + /* restore the previous state */ 741 + set_cpus_allowed(current, saved_mask); 742 + return ret; 747 743 } 748 744 749 745 int acpi_processor_get_throttling_info(struct acpi_processor *pr)