SMP boot errors
Hans van Leest
hvleest at signet.nl
Sun Aug 14 10:31:36 GMT 2005
Hello,
I've started with a new 6.0 source. Patched the source and did a make
buildworld, with no problems.
When I do a make buildkernel I get an error:
cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline
-Wcast-qual -fformat-extensions -std=c99 -g -nostdinc -I- -I.
-I/usr/src/sys -I/usr/src/sys/contrib/dev/acpica
-I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter
-I/usr/src/sys/contrib/pf -I/usr/src/sys/contrib/dev/ath
-I/usr/src/sys/contrib/dev/ath/freebsd -I/usr/src/sys/contrib/ngatm
-I/usr/src/sys/dev/twa -D_KERNEL -include opt_global.h -fno-common
-finline-limit=8000 --param inline-unit-growth=100 --param
large-function-growth=1000 -mno-align-long-strings
-mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2
-ffreestanding -Werror /usr/src/sys/dev/pci/pci.c
/usr/src/sys/dev/pci/pci.c:928: error: conflicting types for
'pci_assign_interrupt'
/usr/src/sys/dev/pci/pci.c:80: error: previous declaration of
'pci_assign_interrupt' was here
/usr/src/sys/dev/pci/pci.c:928: error: conflicting types for
'pci_assign_interrupt'
/usr/src/sys/dev/pci/pci.c:80: error: previous declaration of
'pci_assign_interrupt' was here
/usr/src/sys/dev/pci/pci.c: In function `pci_add_resources':
/usr/src/sys/dev/pci/pci.c:979: warning: unused variable `irq'
/usr/src/sys/dev/pci/pci.c: At top level:
/usr/src/sys/dev/pci/pci.c:80: warning: 'pci_assign_interrupt' declared
`static' but never defined
*** Error code 1
Stop in /usr/obj/usr/src/sys/KERNEL-6.0.
*** Error code 1
Stop in /usr/src.
*** Error code 1
Stop in /usr/src.
bsd#
How do I continue?
Hans
John Baldwin wrote:
> On Thursday 07 July 2005 04:31 pm, Hans van Leest wrote:
>
>>Hello,
>>
>>I've posted last week also my problems with a SMP kernel on a dual XEON
>>machine.
>>
>>Maybe this error message is better to debug, I hope
>>
>>I've upgraded the source to 6.0 current. Did not modify my GENERIC file
>>and compiled the source. This inclusus the options SMP and device APIC.
>>I've booted several times and had the same error:
>>
>>panic: multiple IRQs for PCI interrupt 0.31.INTA 18 AND 16
>>
>>
>>Where to start to fix this!
>
>
> Ok, I have a patch you can try to use to work around this. Apply this patch
> and then try setting 'hw.pci0.31.INTA.irq=16' from the loader to force that
> specific PCI interrupt to IRQ 16. If that results in interrupt storms, you
> can try setting it to 18 instead of 16.
>
> --- //depot/vendor/freebsd/src/sys/dev/pci/pci.c 2005/06/03 19:45:18
> +++ //depot/user/jhb/acpipci/dev/pci/pci.c 2005/07/29 14:35:47
> @@ -76,6 +76,8 @@
>
> static int pci_porten(device_t pcib, int b, int s, int f);
> static int pci_memen(device_t pcib, int b, int s, int f);
> +static int pci_assign_interrupt(device_t bus, device_t dev,
> + int force_route);
> static int pci_add_map(device_t pcib, device_t bus, device_t dev,
> int b, int s, int f, int reg,
> struct resource_list *rl);
> @@ -922,6 +924,52 @@
> }
>
> static void
> +pci_assign_interrupt(device_t bus, device_t dev, int force_route)
> +{
> + struct pci_devinfo *dinfo = device_get_ivars(dev);
> + pcicfgregs *cfg = &dinfo->cfg;
> + char tunable_name[64];
> + int irq;
> +
> + /* Has to have an intpin to have an interrupt. */
> + if (cfg->intpin == 0)
> + return;
> +
> + /* Let the user override the IRQ with a tunable. */
> + irq = PCI_INVALID_IRQ;
> + snprintf(tunable_name, sizeof(tunable_name), "hw.pci%d.%d.INT%c.irq",
> + cfg->bus, cfg->slot, cfg->intpin + 'A' - 1);
> + if (TUNABLE_INT_FETCH(tunable_name, &irq) && (irq >= 255 || irq <= 0))
> + irq = PCI_INVALID_IRQ;
> +
> + /*
> + * If we didn't get an IRQ via the tunable, then we either use the
> + * IRQ value in the intline register or we ask the bus to route an
> + * interrupt for us. If force_route is true, then we only use the
> + * value in the intline register if the bus was unable to assign an
> + * IRQ.
> + */
> + if (!PCI_INTERRUPT_VALID(irq)) {
> + irq = cfg->intline;
> + if (!PCI_INTERRUPT_VALID(irq) || force_route)
> + irq = PCI_ASSIGN_INTERRUPT(bus, dev);
> + }
> +
> + /* If after all that we don't have an IRQ, just bail. */
> + if (!PCI_INTERRUPT_VALID(irq))
> + return;
> +
> + /* Update the config register if it changed. */
> + if (irq != cfg->intline) {
> + cfg->intline = irq;
> + pci_write_config(dev, PCIR_INTLINE, irq, 1);
> + }
> +
> + /* Add this IRQ as rid 0 interrupt resource. */
> + resource_list_add(&dinfo->resources, SYS_RES_IRQ, 0, irq, irq, 1);
> +}
> +
> +static void
> pci_add_resources(device_t pcib, device_t bus, device_t dev)
> {
> struct pci_devinfo *dinfo = device_get_ivars(dev);
> @@ -959,14 +1007,10 @@
> * If the re-route fails, then just stick with what we
> * have.
> */
> - irq = PCI_ASSIGN_INTERRUPT(bus, dev);
> - if (PCI_INTERRUPT_VALID(irq)) {
> - pci_write_config(dev, PCIR_INTLINE, irq, 1);
> - cfg->intline = irq;
> - } else
> + pci_assign_interrupt(bus, dev, 1);
> +#else
> + pci_assign_interrupt(bus, dev, 0);
> #endif
> - irq = cfg->intline;
> - resource_list_add(rl, SYS_RES_IRQ, 0, irq, irq, 1);
> }
> }
>
> @@ -1705,15 +1749,8 @@
> * interrupt, try to assign it one.
> */
> if (!PCI_INTERRUPT_VALID(cfg->intline) &&
> - (cfg->intpin != 0)) {
> - cfg->intline = PCI_ASSIGN_INTERRUPT(dev, child);
> - if (PCI_INTERRUPT_VALID(cfg->intline)) {
> - pci_write_config(child, PCIR_INTLINE,
> - cfg->intline, 1);
> - resource_list_add(rl, SYS_RES_IRQ, 0,
> - cfg->intline, cfg->intline, 1);
> - }
> - }
> + (cfg->intpin != 0))
> + pci_assign_interrupt(dev, child, 0);
> break;
> case SYS_RES_IOPORT:
> case SYS_RES_MEMORY:
>
More information about the freebsd-smp
mailing list