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 tag 'acpi-4.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
"All of these fix recent regressions in ACPICA, in the ACPI PCI IRQ
management code and in the ACPI AML debugger.

Specifics:

- Fix a lock ordering issue in ACPICA introduced by a recent commit
that attempted to fix a deadlock in the dynamic table loading code
which in turn appeared after changes related to the handling of
module-level AML also made in this cycle (Lv Zheng).

- Fix a recent regression in the ACPI IRQ management code that may
cause PCI drivers to be unable to register an IRQ if that IRQ
happens to be shared with a device on the ISA bus, like the
parallel port, by reverting one commit entirely and restoring the
previous behavior in two other places (Sinan Kaya).

- Fix a recent regression in the ACPI AML debugger introduced by the
commit that removed incorrect usage of IS_ERR_VALUE() from multiple
places (Lv Zheng)"

* tag 'acpi-4.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / debugger: Fix regression introduced by IS_ERR_VALUE() removal
ACPICA: Namespace: Fix namespace/interpreter lock ordering
ACPI,PCI,IRQ: separate ISA penalty calculation
Revert "ACPI, PCI, IRQ: remove redundant code in acpi_irq_penalty_init()"
ACPI,PCI,IRQ: factor in PCI possible

+59 -24
+1
arch/x86/pci/acpi.c
··· 396 396 return -ENODEV; 397 397 398 398 printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n"); 399 + acpi_irq_penalty_init(); 399 400 pcibios_enable_irq = acpi_pci_irq_enable; 400 401 pcibios_disable_irq = acpi_pci_irq_disable; 401 402 x86_init.pci.init_irq = x86_init_noop;
+2 -2
drivers/acpi/acpi_dbg.c
··· 602 602 crc->tail = (crc->tail + n) & (ACPI_AML_BUF_SIZE - 1); 603 603 ret = n; 604 604 out: 605 - acpi_aml_unlock_fifo(ACPI_AML_OUT_USER, !ret); 605 + acpi_aml_unlock_fifo(ACPI_AML_OUT_USER, ret >= 0); 606 606 return ret; 607 607 } 608 608 ··· 672 672 crc->head = (crc->head + n) & (ACPI_AML_BUF_SIZE - 1); 673 673 ret = n; 674 674 out: 675 - acpi_aml_unlock_fifo(ACPI_AML_IN_USER, !ret); 675 + acpi_aml_unlock_fifo(ACPI_AML_IN_USER, ret >= 0); 676 676 return n; 677 677 } 678 678
+6 -1
drivers/acpi/acpica/nsload.c
··· 46 46 #include "acnamesp.h" 47 47 #include "acdispat.h" 48 48 #include "actables.h" 49 + #include "acinterp.h" 49 50 50 51 #define _COMPONENT ACPI_NAMESPACE 51 52 ACPI_MODULE_NAME("nsload") ··· 79 78 80 79 ACPI_FUNCTION_TRACE(ns_load_table); 81 80 81 + acpi_ex_enter_interpreter(); 82 + 82 83 /* 83 84 * Parse the table and load the namespace with all named 84 85 * objects found within. Control methods are NOT parsed ··· 92 89 */ 93 90 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 94 91 if (ACPI_FAILURE(status)) { 95 - return_ACPI_STATUS(status); 92 + goto unlock_interp; 96 93 } 97 94 98 95 /* If table already loaded into namespace, just return */ ··· 133 130 134 131 unlock: 135 132 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 133 + unlock_interp: 134 + (void)acpi_ex_exit_interpreter(); 136 135 137 136 if (ACPI_FAILURE(status)) { 138 137 return_ACPI_STATUS(status);
+2 -7
drivers/acpi/acpica/nsparse.c
··· 47 47 #include "acparser.h" 48 48 #include "acdispat.h" 49 49 #include "actables.h" 50 - #include "acinterp.h" 51 50 52 51 #define _COMPONENT ACPI_NAMESPACE 53 52 ACPI_MODULE_NAME("nsparse") ··· 170 171 171 172 ACPI_FUNCTION_TRACE(ns_parse_table); 172 173 173 - acpi_ex_enter_interpreter(); 174 - 175 174 /* 176 175 * AML Parse, pass 1 177 176 * ··· 185 188 status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, 186 189 table_index, start_node); 187 190 if (ACPI_FAILURE(status)) { 188 - goto error_exit; 191 + return_ACPI_STATUS(status); 189 192 } 190 193 191 194 /* ··· 201 204 status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, 202 205 table_index, start_node); 203 206 if (ACPI_FAILURE(status)) { 204 - goto error_exit; 207 + return_ACPI_STATUS(status); 205 208 } 206 209 207 - error_exit: 208 - acpi_ex_exit_interpreter(); 209 210 return_ACPI_STATUS(status); 210 211 }
+47 -14
drivers/acpi/pci_link.c
··· 470 470 { 471 471 struct acpi_pci_link *link; 472 472 int penalty = 0; 473 + int i; 473 474 474 475 list_for_each_entry(link, &acpi_link_list, list) { 475 476 /* ··· 479 478 */ 480 479 if (link->irq.active && link->irq.active == irq) 481 480 penalty += PIRQ_PENALTY_PCI_USING; 482 - else { 483 - int i; 484 481 485 - /* 486 - * If a link is inactive, penalize the IRQs it 487 - * might use, but not as severely. 488 - */ 489 - for (i = 0; i < link->irq.possible_count; i++) 490 - if (link->irq.possible[i] == irq) 491 - penalty += PIRQ_PENALTY_PCI_POSSIBLE / 492 - link->irq.possible_count; 493 - } 482 + /* 483 + * penalize the IRQs PCI might use, but not as severely. 484 + */ 485 + for (i = 0; i < link->irq.possible_count; i++) 486 + if (link->irq.possible[i] == irq) 487 + penalty += PIRQ_PENALTY_PCI_POSSIBLE / 488 + link->irq.possible_count; 494 489 } 495 490 496 491 return penalty; ··· 495 498 static int acpi_irq_get_penalty(int irq) 496 499 { 497 500 int penalty = 0; 498 - 499 - if (irq < ACPI_MAX_ISA_IRQS) 500 - penalty += acpi_isa_irq_penalty[irq]; 501 501 502 502 /* 503 503 * Penalize IRQ used by ACPI SCI. If ACPI SCI pin attributes conflict ··· 510 516 penalty += PIRQ_PENALTY_PCI_USING; 511 517 } 512 518 519 + if (irq < ACPI_MAX_ISA_IRQS) 520 + return penalty + acpi_isa_irq_penalty[irq]; 521 + 513 522 penalty += acpi_irq_pci_sharing_penalty(irq); 514 523 return penalty; 524 + } 525 + 526 + int __init acpi_irq_penalty_init(void) 527 + { 528 + struct acpi_pci_link *link; 529 + int i; 530 + 531 + /* 532 + * Update penalties to facilitate IRQ balancing. 533 + */ 534 + list_for_each_entry(link, &acpi_link_list, list) { 535 + 536 + /* 537 + * reflect the possible and active irqs in the penalty table -- 538 + * useful for breaking ties. 539 + */ 540 + if (link->irq.possible_count) { 541 + int penalty = 542 + PIRQ_PENALTY_PCI_POSSIBLE / 543 + link->irq.possible_count; 544 + 545 + for (i = 0; i < link->irq.possible_count; i++) { 546 + if (link->irq.possible[i] < ACPI_MAX_ISA_IRQS) 547 + acpi_isa_irq_penalty[link->irq. 548 + possible[i]] += 549 + penalty; 550 + } 551 + 552 + } else if (link->irq.active && 553 + (link->irq.active < ACPI_MAX_ISA_IRQS)) { 554 + acpi_isa_irq_penalty[link->irq.active] += 555 + PIRQ_PENALTY_PCI_POSSIBLE; 556 + } 557 + } 558 + 559 + return 0; 515 560 } 516 561 517 562 static int acpi_irq_balance = -1; /* 0: static, 1: balance */
+1
include/acpi/acpi_drivers.h
··· 78 78 79 79 /* ACPI PCI Interrupt Link (pci_link.c) */ 80 80 81 + int acpi_irq_penalty_init(void); 81 82 int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering, 82 83 int *polarity, char **name); 83 84 int acpi_pci_link_free_irq(acpi_handle handle);