| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: acpi_pci_link.c,v 1.18 2010/04/23 15:52:26 jruoho Exp $ */ | | 1 | /* $NetBSD: acpi_pci_link.c,v 1.19 2012/09/23 00:26:25 chs Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2002 Mitsuru IWASAKI <iwasaki@jp.freebsd.org> | | 4 | * Copyright (c) 2002 Mitsuru IWASAKI <iwasaki@jp.freebsd.org> |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -17,27 +17,27 @@ | | | @@ -17,27 +17,27 @@ |
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | | 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
26 | * SUCH DAMAGE. | | 26 | * SUCH DAMAGE. |
27 | */ | | 27 | */ |
28 | | | 28 | |
29 | #include <sys/cdefs.h> | | 29 | #include <sys/cdefs.h> |
30 | __KERNEL_RCSID(0, "$NetBSD: acpi_pci_link.c,v 1.18 2010/04/23 15:52:26 jruoho Exp $"); | | 30 | __KERNEL_RCSID(0, "$NetBSD: acpi_pci_link.c,v 1.19 2012/09/23 00:26:25 chs Exp $"); |
31 | | | 31 | |
32 | #include <sys/param.h> | | 32 | #include <sys/param.h> |
33 | #include <sys/malloc.h> | | 33 | #include <sys/malloc.h> |
34 | #include <sys/queue.h> | | 34 | #include <sys/queue.h> |
35 | #include <sys/reboot.h> | | 35 | #include <sys/reboot.h> |
36 | #include <sys/systm.h> | | 36 | #include <sys/systm.h> |
37 | | | 37 | |
38 | #include <dev/acpi/acpireg.h> | | 38 | #include <dev/acpi/acpireg.h> |
39 | #include <dev/acpi/acpivar.h> | | 39 | #include <dev/acpi/acpivar.h> |
40 | | | 40 | |
41 | #include <dev/pci/pcireg.h> | | 41 | #include <dev/pci/pcireg.h> |
42 | | | 42 | |
43 | #include "opt_acpi.h" | | 43 | #include "opt_acpi.h" |
| @@ -523,33 +523,31 @@ acpi_pci_link_attach(struct acpi_pci_lin | | | @@ -523,33 +523,31 @@ acpi_pci_link_attach(struct acpi_pci_lin |
523 | acpi_pci_link_dump(sc); | | 523 | acpi_pci_link_dump(sc); |
524 | } | | 524 | } |
525 | | | 525 | |
526 | /* Save initial IRQs. */ | | 526 | /* Save initial IRQs. */ |
527 | for (i = 0; i < sc->pl_num_links; i++) | | 527 | for (i = 0; i < sc->pl_num_links; i++) |
528 | sc->pl_links[i].l_initial_irq = sc->pl_links[i].l_irq; | | 528 | sc->pl_links[i].l_initial_irq = sc->pl_links[i].l_irq; |
529 | | | 529 | |
530 | /* | | 530 | /* |
531 | * Try to disable this link. If successful, set the current IRQ to | | 531 | * Try to disable this link. If successful, set the current IRQ to |
532 | * zero and flags to indicate this link is not routed. If we can't | | 532 | * zero and flags to indicate this link is not routed. If we can't |
533 | * run _DIS (i.e., the method doesn't exist), assume the initial | | 533 | * run _DIS (i.e., the method doesn't exist), assume the initial |
534 | * IRQ was routed by the BIOS. | | 534 | * IRQ was routed by the BIOS. |
535 | */ | | 535 | */ |
536 | #if 0 /* XXX causes spontaneaous resets on some systems. Disabled for now. */ | | | |
537 | if (ACPI_SUCCESS(AcpiEvaluateObject(sc->pl_handle, "_DIS", NULL, | | 536 | if (ACPI_SUCCESS(AcpiEvaluateObject(sc->pl_handle, "_DIS", NULL, |
538 | NULL))) | | 537 | NULL))) |
539 | for (i = 0; i < sc->pl_num_links; i++) | | 538 | for (i = 0; i < sc->pl_num_links; i++) |
540 | sc->pl_links[i].l_irq = PCI_INVALID_IRQ; | | 539 | sc->pl_links[i].l_irq = PCI_INVALID_IRQ; |
541 | else | | 540 | else |
542 | #endif | | | |
543 | for (i = 0; i < sc->pl_num_links; i++) | | 541 | for (i = 0; i < sc->pl_num_links; i++) |
544 | if (PCI_INTERRUPT_VALID(sc->pl_links[i].l_irq)) | | 542 | if (PCI_INTERRUPT_VALID(sc->pl_links[i].l_irq)) |
545 | sc->pl_links[i].l_routed = TRUE; | | 543 | sc->pl_links[i].l_routed = TRUE; |
546 | if (boothowto & AB_VERBOSE) { | | 544 | if (boothowto & AB_VERBOSE) { |
547 | printf("%s: Links after disable:\n", sc->pl_name); | | 545 | printf("%s: Links after disable:\n", sc->pl_name); |
548 | acpi_pci_link_dump(sc); | | 546 | acpi_pci_link_dump(sc); |
549 | } | | 547 | } |
550 | ACPI_SERIAL_END(pci_link); | | 548 | ACPI_SERIAL_END(pci_link); |
551 | return (0); | | 549 | return (0); |
552 | fail: | | 550 | fail: |
553 | ACPI_SERIAL_END(pci_link); | | 551 | ACPI_SERIAL_END(pci_link); |
554 | for (i = 0; i < sc->pl_num_links; i++) { | | 552 | for (i = 0; i < sc->pl_num_links; i++) { |
555 | if (sc->pl_links[i].l_irqs != NULL) | | 553 | if (sc->pl_links[i].l_irqs != NULL) |