diff options
| -rw-r--r-- | arch/x86/kernel/acpi/boot.c | 1 | ||||
| -rw-r--r-- | drivers/acpi/acpica/dsinit.c | 11 | ||||
| -rw-r--r-- | drivers/acpi/acpica/dsmethod.c | 50 | ||||
| -rw-r--r-- | drivers/acpi/acpica/dswload2.c | 2 | ||||
| -rw-r--r-- | drivers/acpi/acpica/evrgnini.c | 3 | ||||
| -rw-r--r-- | drivers/acpi/acpica/nsload.c | 2 | ||||
| -rw-r--r-- | drivers/acpi/apei/ghes.c | 2 | ||||
| -rw-r--r-- | drivers/acpi/pci_link.c | 38 | ||||
| -rw-r--r-- | include/linux/acpi.h | 1 |
9 files changed, 54 insertions, 56 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 8a5abaa7d453..931ced8ca345 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
| @@ -454,6 +454,7 @@ static void __init acpi_sci_ioapic_setup(u8 bus_irq, u16 polarity, u16 trigger, | |||
| 454 | polarity = acpi_sci_flags & ACPI_MADT_POLARITY_MASK; | 454 | polarity = acpi_sci_flags & ACPI_MADT_POLARITY_MASK; |
| 455 | 455 | ||
| 456 | mp_override_legacy_irq(bus_irq, polarity, trigger, gsi); | 456 | mp_override_legacy_irq(bus_irq, polarity, trigger, gsi); |
| 457 | acpi_penalize_sci_irq(bus_irq, trigger, polarity); | ||
| 457 | 458 | ||
| 458 | /* | 459 | /* |
| 459 | * stash over-ride to indicate we've been here | 460 | * stash over-ride to indicate we've been here |
diff --git a/drivers/acpi/acpica/dsinit.c b/drivers/acpi/acpica/dsinit.c index f1e6dcc7a827..54d48b90de2c 100644 --- a/drivers/acpi/acpica/dsinit.c +++ b/drivers/acpi/acpica/dsinit.c | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | #include "acdispat.h" | 46 | #include "acdispat.h" |
| 47 | #include "acnamesp.h" | 47 | #include "acnamesp.h" |
| 48 | #include "actables.h" | 48 | #include "actables.h" |
| 49 | #include "acinterp.h" | ||
| 49 | 50 | ||
| 50 | #define _COMPONENT ACPI_DISPATCHER | 51 | #define _COMPONENT ACPI_DISPATCHER |
| 51 | ACPI_MODULE_NAME("dsinit") | 52 | ACPI_MODULE_NAME("dsinit") |
| @@ -214,23 +215,17 @@ acpi_ds_initialize_objects(u32 table_index, | |||
| 214 | 215 | ||
| 215 | /* Walk entire namespace from the supplied root */ | 216 | /* Walk entire namespace from the supplied root */ |
| 216 | 217 | ||
| 217 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); | ||
| 218 | if (ACPI_FAILURE(status)) { | ||
| 219 | return_ACPI_STATUS(status); | ||
| 220 | } | ||
| 221 | |||
| 222 | /* | 218 | /* |
| 223 | * We don't use acpi_walk_namespace since we do not want to acquire | 219 | * We don't use acpi_walk_namespace since we do not want to acquire |
| 224 | * the namespace reader lock. | 220 | * the namespace reader lock. |
| 225 | */ | 221 | */ |
| 226 | status = | 222 | status = |
| 227 | acpi_ns_walk_namespace(ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX, | 223 | acpi_ns_walk_namespace(ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX, |
| 228 | ACPI_NS_WALK_UNLOCK, acpi_ds_init_one_object, | 224 | 0, acpi_ds_init_one_object, NULL, &info, |
| 229 | NULL, &info, NULL); | 225 | NULL); |
| 230 | if (ACPI_FAILURE(status)) { | 226 | if (ACPI_FAILURE(status)) { |
| 231 | ACPI_EXCEPTION((AE_INFO, status, "During WalkNamespace")); | 227 | ACPI_EXCEPTION((AE_INFO, status, "During WalkNamespace")); |
| 232 | } | 228 | } |
| 233 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); | ||
| 234 | 229 | ||
| 235 | status = acpi_get_table_by_index(table_index, &table); | 230 | status = acpi_get_table_by_index(table_index, &table); |
| 236 | if (ACPI_FAILURE(status)) { | 231 | if (ACPI_FAILURE(status)) { |
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c index 32e9ddc0cf2b..2b3210f42a46 100644 --- a/drivers/acpi/acpica/dsmethod.c +++ b/drivers/acpi/acpica/dsmethod.c | |||
| @@ -99,14 +99,11 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node, | |||
| 99 | "Method auto-serialization parse [%4.4s] %p\n", | 99 | "Method auto-serialization parse [%4.4s] %p\n", |
| 100 | acpi_ut_get_node_name(node), node)); | 100 | acpi_ut_get_node_name(node), node)); |
| 101 | 101 | ||
| 102 | acpi_ex_enter_interpreter(); | ||
| 103 | |||
| 104 | /* Create/Init a root op for the method parse tree */ | 102 | /* Create/Init a root op for the method parse tree */ |
| 105 | 103 | ||
| 106 | op = acpi_ps_alloc_op(AML_METHOD_OP, obj_desc->method.aml_start); | 104 | op = acpi_ps_alloc_op(AML_METHOD_OP, obj_desc->method.aml_start); |
| 107 | if (!op) { | 105 | if (!op) { |
| 108 | status = AE_NO_MEMORY; | 106 | return_ACPI_STATUS(AE_NO_MEMORY); |
| 109 | goto unlock; | ||
| 110 | } | 107 | } |
| 111 | 108 | ||
| 112 | acpi_ps_set_name(op, node->name.integer); | 109 | acpi_ps_set_name(op, node->name.integer); |
| @@ -118,8 +115,7 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node, | |||
| 118 | acpi_ds_create_walk_state(node->owner_id, NULL, NULL, NULL); | 115 | acpi_ds_create_walk_state(node->owner_id, NULL, NULL, NULL); |
| 119 | if (!walk_state) { | 116 | if (!walk_state) { |
| 120 | acpi_ps_free_op(op); | 117 | acpi_ps_free_op(op); |
| 121 | status = AE_NO_MEMORY; | 118 | return_ACPI_STATUS(AE_NO_MEMORY); |
| 122 | goto unlock; | ||
| 123 | } | 119 | } |
| 124 | 120 | ||
| 125 | status = acpi_ds_init_aml_walk(walk_state, op, node, | 121 | status = acpi_ds_init_aml_walk(walk_state, op, node, |
| @@ -138,8 +134,6 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node, | |||
| 138 | status = acpi_ps_parse_aml(walk_state); | 134 | status = acpi_ps_parse_aml(walk_state); |
| 139 | 135 | ||
| 140 | acpi_ps_delete_parse_tree(op); | 136 | acpi_ps_delete_parse_tree(op); |
| 141 | unlock: | ||
| 142 | acpi_ex_exit_interpreter(); | ||
| 143 | return_ACPI_STATUS(status); | 137 | return_ACPI_STATUS(status); |
| 144 | } | 138 | } |
| 145 | 139 | ||
| @@ -731,26 +725,6 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, | |||
| 731 | acpi_ds_method_data_delete_all(walk_state); | 725 | acpi_ds_method_data_delete_all(walk_state); |
| 732 | 726 | ||
| 733 | /* | 727 | /* |
| 734 | * If method is serialized, release the mutex and restore the | ||
| 735 | * current sync level for this thread | ||
| 736 | */ | ||
| 737 | if (method_desc->method.mutex) { | ||
| 738 | |||
| 739 | /* Acquisition Depth handles recursive calls */ | ||
| 740 | |||
| 741 | method_desc->method.mutex->mutex.acquisition_depth--; | ||
| 742 | if (!method_desc->method.mutex->mutex.acquisition_depth) { | ||
| 743 | walk_state->thread->current_sync_level = | ||
| 744 | method_desc->method.mutex->mutex. | ||
| 745 | original_sync_level; | ||
| 746 | |||
| 747 | acpi_os_release_mutex(method_desc->method. | ||
| 748 | mutex->mutex.os_mutex); | ||
| 749 | method_desc->method.mutex->mutex.thread_id = 0; | ||
| 750 | } | ||
| 751 | } | ||
| 752 | |||
| 753 | /* | ||
| 754 | * Delete any namespace objects created anywhere within the | 728 | * Delete any namespace objects created anywhere within the |
| 755 | * namespace by the execution of this method. Unless: | 729 | * namespace by the execution of this method. Unless: |
| 756 | * 1) This method is a module-level executable code method, in which | 730 | * 1) This method is a module-level executable code method, in which |
| @@ -786,6 +760,26 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, | |||
| 786 | ~ACPI_METHOD_MODIFIED_NAMESPACE; | 760 | ~ACPI_METHOD_MODIFIED_NAMESPACE; |
| 787 | } | 761 | } |
| 788 | } | 762 | } |
| 763 | |||
| 764 | /* | ||
| 765 | * If method is serialized, release the mutex and restore the | ||
| 766 | * current sync level for this thread | ||
| 767 | */ | ||
| 768 | if (method_desc->method.mutex) { | ||
| 769 | |||
| 770 | /* Acquisition Depth handles recursive calls */ | ||
| 771 | |||
| 772 | method_desc->method.mutex->mutex.acquisition_depth--; | ||
| 773 | if (!method_desc->method.mutex->mutex.acquisition_depth) { | ||
| 774 | walk_state->thread->current_sync_level = | ||
| 775 | method_desc->method.mutex->mutex. | ||
| 776 | original_sync_level; | ||
| 777 | |||
| 778 | acpi_os_release_mutex(method_desc->method. | ||
| 779 | mutex->mutex.os_mutex); | ||
| 780 | method_desc->method.mutex->mutex.thread_id = 0; | ||
| 781 | } | ||
| 782 | } | ||
| 789 | } | 783 | } |
| 790 | 784 | ||
| 791 | /* Decrement the thread count on the method */ | 785 | /* Decrement the thread count on the method */ |
diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c index 028b22a3154e..e36218206bb0 100644 --- a/drivers/acpi/acpica/dswload2.c +++ b/drivers/acpi/acpica/dswload2.c | |||
| @@ -607,11 +607,9 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) | |||
| 607 | } | 607 | } |
| 608 | } | 608 | } |
| 609 | 609 | ||
| 610 | acpi_ex_exit_interpreter(); | ||
| 611 | status = | 610 | status = |
| 612 | acpi_ev_initialize_region | 611 | acpi_ev_initialize_region |
| 613 | (acpi_ns_get_attached_object(node), FALSE); | 612 | (acpi_ns_get_attached_object(node), FALSE); |
| 614 | acpi_ex_enter_interpreter(); | ||
| 615 | 613 | ||
| 616 | if (ACPI_FAILURE(status)) { | 614 | if (ACPI_FAILURE(status)) { |
| 617 | /* | 615 | /* |
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c index 3843f1fc5dbb..75ddd160a716 100644 --- a/drivers/acpi/acpica/evrgnini.c +++ b/drivers/acpi/acpica/evrgnini.c | |||
| @@ -45,6 +45,7 @@ | |||
| 45 | #include "accommon.h" | 45 | #include "accommon.h" |
| 46 | #include "acevents.h" | 46 | #include "acevents.h" |
| 47 | #include "acnamesp.h" | 47 | #include "acnamesp.h" |
| 48 | #include "acinterp.h" | ||
| 48 | 49 | ||
| 49 | #define _COMPONENT ACPI_EVENTS | 50 | #define _COMPONENT ACPI_EVENTS |
| 50 | ACPI_MODULE_NAME("evrgnini") | 51 | ACPI_MODULE_NAME("evrgnini") |
| @@ -597,9 +598,11 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj, | |||
| 597 | } | 598 | } |
| 598 | } | 599 | } |
| 599 | 600 | ||
| 601 | acpi_ex_exit_interpreter(); | ||
| 600 | status = | 602 | status = |
| 601 | acpi_ev_execute_reg_method(region_obj, | 603 | acpi_ev_execute_reg_method(region_obj, |
| 602 | ACPI_REG_CONNECT); | 604 | ACPI_REG_CONNECT); |
| 605 | acpi_ex_enter_interpreter(); | ||
| 603 | 606 | ||
| 604 | if (acpi_ns_locked) { | 607 | if (acpi_ns_locked) { |
| 605 | status = | 608 | status = |
diff --git a/drivers/acpi/acpica/nsload.c b/drivers/acpi/acpica/nsload.c index 334d3c5ba617..d1f20143bb11 100644 --- a/drivers/acpi/acpica/nsload.c +++ b/drivers/acpi/acpica/nsload.c | |||
| @@ -137,7 +137,9 @@ unlock: | |||
| 137 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 137 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
| 138 | "**** Begin Table Object Initialization\n")); | 138 | "**** Begin Table Object Initialization\n")); |
| 139 | 139 | ||
| 140 | acpi_ex_enter_interpreter(); | ||
| 140 | status = acpi_ds_initialize_objects(table_index, node); | 141 | status = acpi_ds_initialize_objects(table_index, node); |
| 142 | acpi_ex_exit_interpreter(); | ||
| 141 | 143 | ||
| 142 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 144 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
| 143 | "**** Completed Table Object Initialization\n")); | 145 | "**** Completed Table Object Initialization\n")); |
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index f0a029e68d3e..0d099a24f776 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c | |||
| @@ -662,7 +662,7 @@ static int ghes_proc(struct ghes *ghes) | |||
| 662 | ghes_do_proc(ghes, ghes->estatus); | 662 | ghes_do_proc(ghes, ghes->estatus); |
| 663 | out: | 663 | out: |
| 664 | ghes_clear_estatus(ghes); | 664 | ghes_clear_estatus(ghes); |
| 665 | return 0; | 665 | return rc; |
| 666 | } | 666 | } |
| 667 | 667 | ||
| 668 | static void ghes_add_timer(struct ghes *ghes) | 668 | static void ghes_add_timer(struct ghes *ghes) |
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index c983bf733ad3..bc3d914dfc3e 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c | |||
| @@ -87,6 +87,7 @@ struct acpi_pci_link { | |||
| 87 | 87 | ||
| 88 | static LIST_HEAD(acpi_link_list); | 88 | static LIST_HEAD(acpi_link_list); |
| 89 | static DEFINE_MUTEX(acpi_link_lock); | 89 | static DEFINE_MUTEX(acpi_link_lock); |
| 90 | static int sci_irq = -1, sci_penalty; | ||
| 90 | 91 | ||
| 91 | /* -------------------------------------------------------------------------- | 92 | /* -------------------------------------------------------------------------- |
| 92 | PCI Link Device Management | 93 | PCI Link Device Management |
| @@ -496,25 +497,13 @@ static int acpi_irq_get_penalty(int irq) | |||
| 496 | { | 497 | { |
| 497 | int penalty = 0; | 498 | int penalty = 0; |
| 498 | 499 | ||
| 499 | /* | 500 | if (irq == sci_irq) |
| 500 | * Penalize IRQ used by ACPI SCI. If ACPI SCI pin attributes conflict | 501 | penalty += sci_penalty; |
| 501 | * with PCI IRQ attributes, mark ACPI SCI as ISA_ALWAYS so it won't be | ||
| 502 | * use for PCI IRQs. | ||
| 503 | */ | ||
| 504 | if (irq == acpi_gbl_FADT.sci_interrupt) { | ||
| 505 | u32 type = irq_get_trigger_type(irq) & IRQ_TYPE_SENSE_MASK; | ||
| 506 | |||
| 507 | if (type != IRQ_TYPE_LEVEL_LOW) | ||
| 508 | penalty += PIRQ_PENALTY_ISA_ALWAYS; | ||
| 509 | else | ||
| 510 | penalty += PIRQ_PENALTY_PCI_USING; | ||
| 511 | } | ||
| 512 | 502 | ||
| 513 | if (irq < ACPI_MAX_ISA_IRQS) | 503 | if (irq < ACPI_MAX_ISA_IRQS) |
| 514 | return penalty + acpi_isa_irq_penalty[irq]; | 504 | return penalty + acpi_isa_irq_penalty[irq]; |
| 515 | 505 | ||
| 516 | penalty += acpi_irq_pci_sharing_penalty(irq); | 506 | return penalty + acpi_irq_pci_sharing_penalty(irq); |
| 517 | return penalty; | ||
| 518 | } | 507 | } |
| 519 | 508 | ||
| 520 | int __init acpi_irq_penalty_init(void) | 509 | int __init acpi_irq_penalty_init(void) |
| @@ -619,6 +608,10 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link) | |||
| 619 | acpi_device_bid(link->device)); | 608 | acpi_device_bid(link->device)); |
| 620 | return -ENODEV; | 609 | return -ENODEV; |
| 621 | } else { | 610 | } else { |
| 611 | if (link->irq.active < ACPI_MAX_ISA_IRQS) | ||
| 612 | acpi_isa_irq_penalty[link->irq.active] += | ||
| 613 | PIRQ_PENALTY_PCI_USING; | ||
| 614 | |||
| 622 | printk(KERN_WARNING PREFIX "%s [%s] enabled at IRQ %d\n", | 615 | printk(KERN_WARNING PREFIX "%s [%s] enabled at IRQ %d\n", |
| 623 | acpi_device_name(link->device), | 616 | acpi_device_name(link->device), |
| 624 | acpi_device_bid(link->device), link->irq.active); | 617 | acpi_device_bid(link->device), link->irq.active); |
| @@ -849,7 +842,7 @@ static int __init acpi_irq_penalty_update(char *str, int used) | |||
| 849 | continue; | 842 | continue; |
| 850 | 843 | ||
| 851 | if (used) | 844 | if (used) |
| 852 | new_penalty = acpi_irq_get_penalty(irq) + | 845 | new_penalty = acpi_isa_irq_penalty[irq] + |
| 853 | PIRQ_PENALTY_ISA_USED; | 846 | PIRQ_PENALTY_ISA_USED; |
| 854 | else | 847 | else |
| 855 | new_penalty = 0; | 848 | new_penalty = 0; |
| @@ -871,7 +864,7 @@ static int __init acpi_irq_penalty_update(char *str, int used) | |||
| 871 | void acpi_penalize_isa_irq(int irq, int active) | 864 | void acpi_penalize_isa_irq(int irq, int active) |
| 872 | { | 865 | { |
| 873 | if ((irq >= 0) && (irq < ARRAY_SIZE(acpi_isa_irq_penalty))) | 866 | if ((irq >= 0) && (irq < ARRAY_SIZE(acpi_isa_irq_penalty))) |
| 874 | acpi_isa_irq_penalty[irq] = acpi_irq_get_penalty(irq) + | 867 | acpi_isa_irq_penalty[irq] += |
| 875 | (active ? PIRQ_PENALTY_ISA_USED : PIRQ_PENALTY_PCI_USING); | 868 | (active ? PIRQ_PENALTY_ISA_USED : PIRQ_PENALTY_PCI_USING); |
| 876 | } | 869 | } |
| 877 | 870 | ||
| @@ -881,6 +874,17 @@ bool acpi_isa_irq_available(int irq) | |||
| 881 | acpi_irq_get_penalty(irq) < PIRQ_PENALTY_ISA_ALWAYS); | 874 | acpi_irq_get_penalty(irq) < PIRQ_PENALTY_ISA_ALWAYS); |
| 882 | } | 875 | } |
| 883 | 876 | ||
| 877 | void acpi_penalize_sci_irq(int irq, int trigger, int polarity) | ||
| 878 | { | ||
| 879 | sci_irq = irq; | ||
| 880 | |||
| 881 | if (trigger == ACPI_MADT_TRIGGER_LEVEL && | ||
| 882 | polarity == ACPI_MADT_POLARITY_ACTIVE_LOW) | ||
| 883 | sci_penalty = PIRQ_PENALTY_PCI_USING; | ||
| 884 | else | ||
| 885 | sci_penalty = PIRQ_PENALTY_ISA_ALWAYS; | ||
| 886 | } | ||
| 887 | |||
| 884 | /* | 888 | /* |
| 885 | * Over-ride default table to reserve additional IRQs for use by ISA | 889 | * Over-ride default table to reserve additional IRQs for use by ISA |
| 886 | * e.g. acpi_irq_isa=5 | 890 | * e.g. acpi_irq_isa=5 |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index ddbeda6dbdc8..689a8b9b9c8f 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -326,6 +326,7 @@ struct pci_dev; | |||
| 326 | int acpi_pci_irq_enable (struct pci_dev *dev); | 326 | int acpi_pci_irq_enable (struct pci_dev *dev); |
| 327 | void acpi_penalize_isa_irq(int irq, int active); | 327 | void acpi_penalize_isa_irq(int irq, int active); |
| 328 | bool acpi_isa_irq_available(int irq); | 328 | bool acpi_isa_irq_available(int irq); |
| 329 | void acpi_penalize_sci_irq(int irq, int trigger, int polarity); | ||
| 329 | void acpi_pci_irq_disable (struct pci_dev *dev); | 330 | void acpi_pci_irq_disable (struct pci_dev *dev); |
| 330 | 331 | ||
| 331 | extern int ec_read(u8 addr, u8 *val); | 332 | extern int ec_read(u8 addr, u8 *val); |
