Re: page fault panic in device_get_softc/acpi_pcib_route_interrupt

From: Pawel Worach <pawel.worach_at_telia.com>
Date: Sat, 08 Jan 2005 10:08:15 +0100
Nate Lawson wrote:
> [...] Change that to "acpi_get_device(handle)" and post 
> the printout, just so I can make sure this part is working overall.
> 

Sure.
adding child \_PR_.CPU1, dev 0xc1f7a180
adding child \_PR_.CPU0, dev 0xc1f16e00
adding child \_SB_, dev 0xc1f16b80
adding child \_SB_.PCI0, dev 0xc1f16880
adding child \_SB_.PCI0.ISA_, dev 0xc1f16580
adding child \_SB_.PCI0.ISA_.SIOM, dev 0xc1f16380
adding child \_SB_.PCI0.ISA_.PS2K, dev 0xc1f7a100
adding child \_SB_.PCI0.ISA_.PS2M, dev 0xc1f16c80
adding child \_SB_.PCI0.ISA_.FDC0, dev 0xc1f16900
adding child \_SB_.PCI0.ISA_.COM1, dev 0xc1f16480
adding child \_SB_.PCI0.ISA_.COM2, dev 0xc1f16200
adding child \_SB_.PCI0.ISA_.PIC_, dev 0xc1f16680
adding child \_SB_.PCI0.ISA_.DMA0, dev 0xc1f16b00
adding child \_SB_.PCI0.ISA_.TMR_, dev 0xc1f7a200
adding child \_SB_.PCI0.ISA_.RTC_, dev 0xc1f7a080
adding child \_SB_.PCI0.ISA_.SPKR, dev 0xc1f16a00
adding child \_SB_.PCI0.ISA_.COPR, dev 0xc1f16500
adding child \_SB_.PCI0.ISA_.SBD1, dev 0xc1f16180
adding child \_SB_.PCI0.USB0, dev 0xc1f16600
adding child \_SB_.PCI0.CI10, dev 0xc1f16c00
adding child \_SB_.PCI0.CI12, dev 0xc1f7a300
adding child \_SB_.PCI0.CI20, dev 0xc1f16d80
adding child \_SB_.PCI0.CI22, dev 0xc1f16700
adding child \_SB_.PCI1, dev 0xc1f16400
adding child \_SB_.PCI2, dev 0xc1f7a380
adding child \_SB_.PCI3, dev 0xc1f16800
adding child \_SB_.PCI4, dev 0xc1f16d00
adding child \_TZ_, dev 0xc1f16780
adding child \LP00, dev 0xc1f16980
pci_link0: <ACPI PCI Link LP00> on acpi0
pci link attached: \LP00
adding child \LP01, dev 0xc1f16280
pci_link1: <ACPI PCI Link LP01> on acpi0
pci link attached: \LP01
adding child \LP02, dev 0xc1f7a000
pci_link2: <ACPI PCI Link LP02> on acpi0
pci link attached: \LP02
adding child \LP03, dev 0xc1f16300
pci_link3: <ACPI PCI Link LP03> on acpi0
pci link attached: \LP03
adding child \LP04, dev 0xc1f7a980
pci_link4: <ACPI PCI Link LP04> irq 10 on acpi0
pci link attached: \LP04
adding child \LP05, dev 0xc1f86480
pci_link5: <ACPI PCI Link LP05> on acpi0
pci link attached: \LP05
adding child \LP06, dev 0xc1f7ae80
pci_link6: <ACPI PCI Link LP06> on acpi0
pci link attached: \LP06
adding child \LP07, dev 0xc1f86180
pci_link7: <ACPI PCI Link LP07> on acpi0
pci link attached: \LP07
adding child \LP08, dev 0xc1f86080
pci_link8: <ACPI PCI Link LP08> on acpi0
pci link attached: \LP08
adding child \LP09, dev 0xc1f86300
pci_link9: <ACPI PCI Link LP09> on acpi0
pci link attached: \LP09
adding child \LP0A, dev 0xc1f7aa00
pci_link10: <ACPI PCI Link LP0A> irq 10 on acpi0
pci link attached: \LP0A
adding child \LP0B, dev 0xc1f86a80
pci_link11: <ACPI PCI Link LP0B> irq 9 on acpi0
pci link attached: \LP0B
adding child \LP0C, dev 0xc1f7ab00
pci_link12: <ACPI PCI Link LP0C> irq 9 on acpi0
pci link attached: \LP0C
adding child \LP0D, dev 0xc1f7a880
pci_link13: <ACPI PCI Link LP0D> irq 11 on acpi0
pci link attached: \LP0D
adding child \LP0E, dev 0xc1f86500
pci_link14: <ACPI PCI Link LP0E> irq 3 on acpi0
pci link attached: \LP0E
adding child \LP0F, dev 0xc1f86780
pci_link15: <ACPI PCI Link LP0F> on acpi0
pci link attached: \LP0F
adding child \LP10, dev 0xc1f86580
pci_link16: <ACPI PCI Link LP10> on acpi0
pci link attached: \LP10
adding child \LP11, dev 0xc1f7a900
pci_link17: <ACPI PCI Link LP11> on acpi0
pci link attached: \LP11
adding child \LP12, dev 0xc1f7ae00
pci_link18: <ACPI PCI Link LP12> on acpi0
pci link attached: \LP12
adding child \LP13, dev 0xc1f7a800
pci_link19: <ACPI PCI Link LP13> on acpi0
pci link attached: \LP13
adding child \LP14, dev 0xc1f86900
pci_link20: <ACPI PCI Link LP14> on acpi0
pci link attached: \LP14
adding child \LP15, dev 0xc1f86a00
pci_link21: <ACPI PCI Link LP15> on acpi0
pci link attached: \LP15
adding child \LP16, dev 0xc1f7ad80
pci_link22: <ACPI PCI Link LP16> on acpi0
pci link attached: \LP16
adding child \LP17, dev 0xc1f90d00
pci_link23: <ACPI PCI Link LP17> on acpi0
pci link attached: \LP17
adding child \LP18, dev 0xc1f86b80
pci_link24: <ACPI PCI Link LP18> on acpi0
pci link attached: \LP18
adding child \LP19, dev 0xc1f90d80
pci_link25: <ACPI PCI Link LP19> on acpi0
pci link attached: \LP19
adding child \LP1A, dev 0xc1f90100
pci_link26: <ACPI PCI Link LP1A> on acpi0
pci link attached: \LP1A
adding child \LP1B, dev 0xc1f90a80
pci_link27: <ACPI PCI Link LP1B> on acpi0
pci link attached: \LP1B
adding child \LP1C, dev 0xc1f90180
pci_link28: <ACPI PCI Link LP1C> on acpi0
pci link attached: \LP1C
adding child \LP1D, dev 0xc1f90e00
pci_link29: <ACPI PCI Link LP1D> on acpi0
pci link attached: \LP1D
adding child \LP1E, dev 0xc1f86b00
pci_link30: <ACPI PCI Link LP1E> on acpi0
pci link attached: \LP1E
adding child \LP1F, dev 0xc1f90b00
pci_link31: <ACPI PCI Link LP1F> on acpi0
pci link attached: \LP1F
adding child \LPUS, dev 0xc1f90880
pci_link32: <ACPI PCI Link LPUS> irq 11 on acpi0
pci link attached: \LPUS
adding child \ASF_, dev 0xc1f86c80

Here is a diff of all the changes I have now.
Index: sys/dev/acpica/acpi.c
===================================================================
RCS file: /export/ctm/cvs/src/sys/dev/acpica/acpi.c,v
retrieving revision 1.197
diff -u -r1.197 acpi.c
--- sys/dev/acpica/acpi.c	27 Dec 2004 05:36:47 -0000	1.197
+++ sys/dev/acpica/acpi.c	8 Jan 2005 09:05:57 -0000
_at__at_ -1403,7 +1403,7 _at__at_
      ACPI_HANDLE	parent;
      ACPI_STATUS	status;
      int		i;
-    static char	*scopes[] = {"\\_PR_", "\\_TZ_", "\\_SI", "\\_SB_", NULL};
+    static char	*scopes[] = {"\\", NULL};

      ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);

_at__at_ -1470,6 +1470,10 _at__at_
      } else if (acpi_MatchHid(handle, "PNP0C09")) {
  	*order = 2;
  	ret = 1;
+    /* attach pci links early */
+    } else if (acpi_MatchHid(handle, "PNP0C0F")) {
+	*order = 3;
+	ret = 1;
      }

      return (ret);
_at__at_ -1520,6 +1524,9 _at__at_
  	    acpi_set_handle(child, handle);
  	    AcpiAttachData(handle, acpi_fake_objhandler, child);

+	    printf("adding child %s, dev %p\n", acpi_name(handle),
+		   acpi_get_device(handle));
+
  	    /*
  	     * Check that the device is present.  If it's not present,
  	     * leave it disabled (so that we have a device_t attached to
Index: sys/dev/acpica/acpi_pci_link.c
===================================================================
RCS file: /export/ctm/cvs/src/sys/dev/acpica/acpi_pci_link.c,v
retrieving revision 1.43
diff -u -r1.43 acpi_pci_link.c
--- sys/dev/acpica/acpi_pci_link.c	27 Dec 2004 05:42:32 -0000	1.43
+++ sys/dev/acpica/acpi_pci_link.c	8 Jan 2005 09:05:57 -0000
_at__at_ -475,6 +475,7 _at__at_
  		acpi_pci_link_dump(sc);
  	}
  	ACPI_SERIAL_END(pci_link);
+	printf("pci link attached: %s\n", acpi_name(acpi_get_handle(dev)));
  	return (0);
  fail:
  	ACPI_SERIAL_END(pci_link);
Index: sys/dev/acpica/acpi_pcib.c
===================================================================
RCS file: /export/ctm/cvs/src/sys/dev/acpica/acpi_pcib.c,v
retrieving revision 1.53
diff -u -r1.53 acpi_pcib.c
--- sys/dev/acpica/acpi_pcib.c	27 Dec 2004 05:36:47 -0000	1.53
+++ sys/dev/acpica/acpi_pcib.c	8 Jan 2005 09:05:57 -0000
_at__at_ -249,11 +249,18 _at__at_
      /*
       * We have to find the source device (PCI interrupt link device).
       */
-    if (ACPI_FAILURE(AcpiGetHandle(ACPI_ROOT_OBJECT, prt->Source, &lnkdev))) {
+    if (ACPI_FAILURE(AcpiGetHandle(acpi_get_handle(pcib), prt->Source,
+	&lnkdev))) {
  	device_printf(pcib, "couldn't find PCI interrupt link device %s\n",
  	    prt->Source);
  	goto out;
      }
+
+    device_t foo = acpi_get_device(lnkdev);
+    printf("acpi handle %p, name %s\n", lnkdev, lnkdev? acpi_name(lnkdev) : 
"none");
+    printf("link device: %p index %d\n", foo, prt->SourceIndex);
+    printf("device parent %s, state %x\n", 
device_get_nameunit(device_get_parent(foo)), device_get_state(foo));
+
      interrupt = acpi_pci_link_route_interrupt(acpi_get_device(lnkdev),
  	prt->SourceIndex);


-- 
Pawel
Received on Sat Jan 08 2005 - 08:08:56 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:25 UTC