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

Configure Feed

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

Merge tag 'acpi-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
"These fix recent ACPICA regressions, an older PCI IRQ management
regression, and an incorrect return value of a function in the APEI
code.

Specifics:

- Fix three ACPICA issues related to the interpreter locking and
introduced by recent changes in that area (Lv Zheng).

- Fix a PCI IRQ management regression introduced during the 4.7 cycle
and related to the configuration of shared IRQs on systems with an
ISA bus (Sinan Kaya).

- Fix up a return value of one function in the APEI code (Punit
Agrawal)"

* tag 'acpi-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPICA: Dispatcher: Fix interpreter locking around acpi_ev_initialize_region()
ACPICA: Dispatcher: Fix an unbalanced lock exit path in acpi_ds_auto_serialize_method()
ACPICA: Dispatcher: Fix order issue of method termination
ACPI / APEI: Fix incorrect return value of ghes_proc()
ACPI/PCI: pci_link: Include PIRQ_PENALTY_PCI_USING for ISA IRQs
ACPI/PCI: pci_link: penalize SCI correctly
ACPI/PCI/IRQ: assign ISA IRQ directly during early boot stages

+54 -56
+1
arch/x86/kernel/acpi/boot.c
··· 454 454 polarity = acpi_sci_flags & ACPI_MADT_POLARITY_MASK; 455 455 456 456 mp_override_legacy_irq(bus_irq, polarity, trigger, gsi); 457 + acpi_penalize_sci_irq(bus_irq, trigger, polarity); 457 458 458 459 /* 459 460 * stash over-ride to indicate we've been here
+3 -8
drivers/acpi/acpica/dsinit.c
··· 46 46 #include "acdispat.h" 47 47 #include "acnamesp.h" 48 48 #include "actables.h" 49 + #include "acinterp.h" 49 50 50 51 #define _COMPONENT ACPI_DISPATCHER 51 52 ACPI_MODULE_NAME("dsinit") ··· 215 214 216 215 /* Walk entire namespace from the supplied root */ 217 216 218 - status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 219 - if (ACPI_FAILURE(status)) { 220 - return_ACPI_STATUS(status); 221 - } 222 - 223 217 /* 224 218 * We don't use acpi_walk_namespace since we do not want to acquire 225 219 * the namespace reader lock. 226 220 */ 227 221 status = 228 222 acpi_ns_walk_namespace(ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX, 229 - ACPI_NS_WALK_UNLOCK, acpi_ds_init_one_object, 230 - NULL, &info, NULL); 223 + 0, acpi_ds_init_one_object, NULL, &info, 224 + NULL); 231 225 if (ACPI_FAILURE(status)) { 232 226 ACPI_EXCEPTION((AE_INFO, status, "During WalkNamespace")); 233 227 } 234 - (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 235 228 236 229 status = acpi_get_table_by_index(table_index, &table); 237 230 if (ACPI_FAILURE(status)) {
+22 -28
drivers/acpi/acpica/dsmethod.c
··· 99 99 "Method auto-serialization parse [%4.4s] %p\n", 100 100 acpi_ut_get_node_name(node), node)); 101 101 102 - acpi_ex_enter_interpreter(); 103 - 104 102 /* Create/Init a root op for the method parse tree */ 105 103 106 104 op = acpi_ps_alloc_op(AML_METHOD_OP, obj_desc->method.aml_start); 107 105 if (!op) { 108 - status = AE_NO_MEMORY; 109 - goto unlock; 106 + return_ACPI_STATUS(AE_NO_MEMORY); 110 107 } 111 108 112 109 acpi_ps_set_name(op, node->name.integer); ··· 115 118 acpi_ds_create_walk_state(node->owner_id, NULL, NULL, NULL); 116 119 if (!walk_state) { 117 120 acpi_ps_free_op(op); 118 - status = AE_NO_MEMORY; 119 - goto unlock; 121 + return_ACPI_STATUS(AE_NO_MEMORY); 120 122 } 121 123 122 124 status = acpi_ds_init_aml_walk(walk_state, op, node, ··· 134 138 status = acpi_ps_parse_aml(walk_state); 135 139 136 140 acpi_ps_delete_parse_tree(op); 137 - unlock: 138 - acpi_ex_exit_interpreter(); 139 141 return_ACPI_STATUS(status); 140 142 } 141 143 ··· 725 731 acpi_ds_method_data_delete_all(walk_state); 726 732 727 733 /* 728 - * If method is serialized, release the mutex and restore the 729 - * current sync level for this thread 730 - */ 731 - if (method_desc->method.mutex) { 732 - 733 - /* Acquisition Depth handles recursive calls */ 734 - 735 - method_desc->method.mutex->mutex.acquisition_depth--; 736 - if (!method_desc->method.mutex->mutex.acquisition_depth) { 737 - walk_state->thread->current_sync_level = 738 - method_desc->method.mutex->mutex. 739 - original_sync_level; 740 - 741 - acpi_os_release_mutex(method_desc->method. 742 - mutex->mutex.os_mutex); 743 - method_desc->method.mutex->mutex.thread_id = 0; 744 - } 745 - } 746 - 747 - /* 748 734 * Delete any namespace objects created anywhere within the 749 735 * namespace by the execution of this method. Unless: 750 736 * 1) This method is a module-level executable code method, in which ··· 758 784 (void)acpi_ex_enter_interpreter(); 759 785 method_desc->method.info_flags &= 760 786 ~ACPI_METHOD_MODIFIED_NAMESPACE; 787 + } 788 + } 789 + 790 + /* 791 + * If method is serialized, release the mutex and restore the 792 + * current sync level for this thread 793 + */ 794 + if (method_desc->method.mutex) { 795 + 796 + /* Acquisition Depth handles recursive calls */ 797 + 798 + method_desc->method.mutex->mutex.acquisition_depth--; 799 + if (!method_desc->method.mutex->mutex.acquisition_depth) { 800 + walk_state->thread->current_sync_level = 801 + method_desc->method.mutex->mutex. 802 + original_sync_level; 803 + 804 + acpi_os_release_mutex(method_desc->method. 805 + mutex->mutex.os_mutex); 806 + method_desc->method.mutex->mutex.thread_id = 0; 761 807 } 762 808 } 763 809 }
-2
drivers/acpi/acpica/dswload2.c
··· 607 607 } 608 608 } 609 609 610 - acpi_ex_exit_interpreter(); 611 610 status = 612 611 acpi_ev_initialize_region 613 612 (acpi_ns_get_attached_object(node), FALSE); 614 - acpi_ex_enter_interpreter(); 615 613 616 614 if (ACPI_FAILURE(status)) { 617 615 /*
+3
drivers/acpi/acpica/evrgnini.c
··· 45 45 #include "accommon.h" 46 46 #include "acevents.h" 47 47 #include "acnamesp.h" 48 + #include "acinterp.h" 48 49 49 50 #define _COMPONENT ACPI_EVENTS 50 51 ACPI_MODULE_NAME("evrgnini") ··· 598 597 } 599 598 } 600 599 600 + acpi_ex_exit_interpreter(); 601 601 status = 602 602 acpi_ev_execute_reg_method(region_obj, 603 603 ACPI_REG_CONNECT); 604 + acpi_ex_enter_interpreter(); 604 605 605 606 if (acpi_ns_locked) { 606 607 status =
+2
drivers/acpi/acpica/nsload.c
··· 137 137 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 138 138 "**** Begin Table Object Initialization\n")); 139 139 140 + acpi_ex_enter_interpreter(); 140 141 status = acpi_ds_initialize_objects(table_index, node); 142 + acpi_ex_exit_interpreter(); 141 143 142 144 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 143 145 "**** Completed Table Object Initialization\n"));
+1 -1
drivers/acpi/apei/ghes.c
··· 662 662 ghes_do_proc(ghes, ghes->estatus); 663 663 out: 664 664 ghes_clear_estatus(ghes); 665 - return 0; 665 + return rc; 666 666 } 667 667 668 668 static void ghes_add_timer(struct ghes *ghes)
+21 -17
drivers/acpi/pci_link.c
··· 87 87 88 88 static LIST_HEAD(acpi_link_list); 89 89 static DEFINE_MUTEX(acpi_link_lock); 90 + static int sci_irq = -1, sci_penalty; 90 91 91 92 /* -------------------------------------------------------------------------- 92 93 PCI Link Device Management ··· 497 496 { 498 497 int penalty = 0; 499 498 500 - /* 501 - * Penalize IRQ used by ACPI SCI. If ACPI SCI pin attributes conflict 502 - * with PCI IRQ attributes, mark ACPI SCI as ISA_ALWAYS so it won't be 503 - * use for PCI IRQs. 504 - */ 505 - if (irq == acpi_gbl_FADT.sci_interrupt) { 506 - u32 type = irq_get_trigger_type(irq) & IRQ_TYPE_SENSE_MASK; 507 - 508 - if (type != IRQ_TYPE_LEVEL_LOW) 509 - penalty += PIRQ_PENALTY_ISA_ALWAYS; 510 - else 511 - penalty += PIRQ_PENALTY_PCI_USING; 512 - } 499 + if (irq == sci_irq) 500 + penalty += sci_penalty; 513 501 514 502 if (irq < ACPI_MAX_ISA_IRQS) 515 503 return penalty + acpi_isa_irq_penalty[irq]; 516 504 517 - penalty += acpi_irq_pci_sharing_penalty(irq); 518 - return penalty; 505 + return penalty + acpi_irq_pci_sharing_penalty(irq); 519 506 } 520 507 521 508 int __init acpi_irq_penalty_init(void) ··· 608 619 acpi_device_bid(link->device)); 609 620 return -ENODEV; 610 621 } else { 622 + if (link->irq.active < ACPI_MAX_ISA_IRQS) 623 + acpi_isa_irq_penalty[link->irq.active] += 624 + PIRQ_PENALTY_PCI_USING; 625 + 611 626 printk(KERN_WARNING PREFIX "%s [%s] enabled at IRQ %d\n", 612 627 acpi_device_name(link->device), 613 628 acpi_device_bid(link->device), link->irq.active); ··· 842 849 continue; 843 850 844 851 if (used) 845 - new_penalty = acpi_irq_get_penalty(irq) + 852 + new_penalty = acpi_isa_irq_penalty[irq] + 846 853 PIRQ_PENALTY_ISA_USED; 847 854 else 848 855 new_penalty = 0; ··· 864 871 void acpi_penalize_isa_irq(int irq, int active) 865 872 { 866 873 if ((irq >= 0) && (irq < ARRAY_SIZE(acpi_isa_irq_penalty))) 867 - acpi_isa_irq_penalty[irq] = acpi_irq_get_penalty(irq) + 874 + acpi_isa_irq_penalty[irq] += 868 875 (active ? PIRQ_PENALTY_ISA_USED : PIRQ_PENALTY_PCI_USING); 869 876 } 870 877 ··· 872 879 { 873 880 return irq >= 0 && (irq >= ARRAY_SIZE(acpi_isa_irq_penalty) || 874 881 acpi_irq_get_penalty(irq) < PIRQ_PENALTY_ISA_ALWAYS); 882 + } 883 + 884 + void acpi_penalize_sci_irq(int irq, int trigger, int polarity) 885 + { 886 + sci_irq = irq; 887 + 888 + if (trigger == ACPI_MADT_TRIGGER_LEVEL && 889 + polarity == ACPI_MADT_POLARITY_ACTIVE_LOW) 890 + sci_penalty = PIRQ_PENALTY_PCI_USING; 891 + else 892 + sci_penalty = PIRQ_PENALTY_ISA_ALWAYS; 875 893 } 876 894 877 895 /*
+1
include/linux/acpi.h
··· 326 326 int acpi_pci_irq_enable (struct pci_dev *dev); 327 327 void acpi_penalize_isa_irq(int irq, int active); 328 328 bool acpi_isa_irq_available(int irq); 329 + void acpi_penalize_sci_irq(int irq, int trigger, int polarity); 329 330 void acpi_pci_irq_disable (struct pci_dev *dev); 330 331 331 332 extern int ec_read(u8 addr, u8 *val);