Gabriel Linder wrote:
> On 01/27/11 09:13, Gabriel Linder wrote:
> > When booting 4.9-beta/amd64 without a network cable plugged, I get a
> > lot of splassert failures.
> >
> > After changing kern.splassert to 3 I was able to get the following
> > trace (get with dmesg after a reboot) :
> >
> > OpenBSD 4.9-beta (GENERIC.MP) #786: Tue Jan 25 17:46:34 MST 2011
> > [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> > real mem = 1062797312 (1013MB)
> > avail mem = 1020477440 (973MB)
> > mainbus0 at root
> > bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xf0760 (31 entries)
> > bios0: vendor American Megatrends Inc. version "0904" date 08/12/2010
> > bios0: ASUSTeK Computer INC. 1005PX
> > acpi0 at bios0: rev 2
> > acpi0: sleep states S0 S3 S4 S5
> > acpi0: tables DSDT FACP APIC MCFG ECDT OEMB HPET GSCI SSDT SLIC
> > acpi0: wakeup devices P0P1(S4) P0P4(S4) P0P5(S4) P0P6(S4) P0P7(S4)
> > acpitimer0 at acpi0: 3579545 Hz, 24 bits
> > acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
> > cpu0 at mainbus0: apid 0 (boot processor)
> > cpu0: Intel(R) Atom(TM) CPU N450 @ 1.66GHz, 1666.71 MHz
> > cpu0:
> > FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,MOVBE,NXE,LONG
> > cpu0: 512KB 64b/line 8-way L2 cache
> > cpu0: apic clock running at 166MHz
> > cpu1 at mainbus0: apid 1 (application processor)
> > cpu1: Intel(R) Atom(TM) CPU N450 @ 1.66GHz, 1666.48 MHz
> > cpu1:
> > FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,MOVBE,NXE,LONG
> > cpu1: 512KB 64b/line 8-way L2 cache
> > ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
> > ioapic0: misconfigured as apic 1, remapped to apid 2
> > acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
> > acpiec0 at acpi0acpiec _REG failed, broken BIOS
> >
> > acpihpet0 at acpi0: 14318179 Hz
> > acpiprt0 at acpi0: bus 0 (PCI0)
> > acpiprt1 at acpi0: bus 4 (P0P4)
> > acpiprt2 at acpi0: bus 2 (P0P5)
> > acpiprt3 at acpi0: bus -1 (P0P6)
> > acpiprt4 at acpi0: bus 1 (P0P7)
> > acpiec at acpi0 not configured
> > acpicpu0 at acpi0: C3, C2, C1, PSS
> > acpicpu1 at acpi0: C3, C2, C1, PSS
> > acpitz at acpi0 not configured
> > acpibat at acpi0 not configured
> > acpiac at acpi0 not configured
> > acpiasus0 at acpi0
> > acpibtn0 at acpi0: LID_
> > acpibtn1 at acpi0: SLPB
> > acpibtn2 at acpi0: PWRB
> > acpivideo0 at acpi0: VGA_
> > acpivout0 at acpivideo0: CRTD
> > acpivout1 at acpivideo0: TVOD
> > acpivout2 at acpivideo0: LCDD
> > cpu0: Enhanced SpeedStep 1666 MHz: speeds: 1667, 1333, 1000 MHz
> > pci0 at mainbus0 bus 0
> > pchb0 at pci0 dev 0 function 0 "Intel Pineview DMI" rev 0x00
> > vga1 at pci0 dev 2 function 0 "Intel Pineview Video" rev 0x00
> > wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
> > wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
> > intagp0 at vga1
> > agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
> > inteldrm0 at vga1: apic 2 int 16 (irq 15)
> > drm0 at inteldrm0
> > "Intel Pineview Video" rev 0x00 at pci0 dev 2 function 1 not configured
> > azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x02:
> > apic 2 int 22 (irq 4)
> > azalia0: codecs: Realtek ALC269
> > audio0 at azalia0
> > ppb0 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x02: apic 2
> > int 16 (irq 15)
> > pci1 at ppb0 bus 4
> > ppb1 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x02: apic 2
> > int 17 (irq 10)
> > pci2 at ppb1 bus 2
> > athn0 at pci2 dev 0 function 0 "Atheros AR2427" rev 0x01: apic 2 int
> > 17 (irq 10)
> > athn0: AR9285 rev 2 (1T1R), ROM rev 13, address 48:5d:60:24:0f:2b
> > ppb2 at pci0 dev 28 function 3 "Intel 82801GB PCIE" rev 0x02: apic 2
> > int 19 (irq 11)
> > pci3 at ppb2 bus 1
> > alc0 at pci3 dev 0 function 0 "Attansic Technology L2C" rev 0xc0: apic
> > 2 int 19 (irq 11), address 20:cf:30:70:8f:31
> > atphy0 at alc0 phy 0: F1 10/100/1000 PHY, rev. 11
> > uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x02: apic 2
> > int 23 (irq 3)
> > uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x02: apic 2
> > int 19 (irq 11)
> > uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x02: apic 2
> > int 18 (irq 7)
> > uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x02: apic 2
> > int 16 (irq 15)
> > ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x02: apic 2
> > int 23 (irq 3)
> > usb0 at ehci0: USB revision 2.0
> > uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
> > ppb3 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe2
> > pci4 at ppb3 bus 5
> > pcib0 at pci0 dev 31 function 0 "Intel Tigerpoint LPC" rev 0x02
> > ahci0 at pci0 dev 31 function 2 "Intel 82801GR AHCI" rev 0x02: apic 2
> > int 21 (irq 5), AHCI 1.1
> > scsibus0 at ahci0: 32 targets
> > sd0 at scsibus0 targ 0 lun 0:<ATA, WDC WD2500BEVT-8, 01.0> SCSI3
> > 0/direct fixed
> > sd0: 238475MB, 512 bytes/sec, 488397168 sec total
> > ichiic0 at pci0 dev 31 function 3 "Intel 82801GB SMBus" rev 0x02: apic
> > 2 int 21 (irq 11)
> > iic0 at ichiic0
> > spdmem0 at iic0 addr 0x50: 1GB DDR2 SDRAM non-parity PC2-6400CL5 SO-DIMM
> > usb1 at uhci0: USB revision 1.0
> > uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
> > usb2 at uhci1: USB revision 1.0
> > uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
> > usb3 at uhci2: USB revision 1.0
> > uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
> > usb4 at uhci3: USB revision 1.0
> > uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
> > isa0 at pcib0
> > isadma0 at isa0
> > pckbc0 at isa0 port 0x60/5
> > pckbd0 at pckbc0 (kbd slot)
> > pckbc0: using irq 1 for kbd slot
> > wskbd0 at pckbd0: console keyboard, using wsdisplay0
> > pms0 at pckbc0 (aux slot)
> > pckbc0: using irq 12 for aux slot
> > wsmouse0 at pms0 mux 0
> > pcppi0 at isa0 port 0x61
> > spkr0 at pcppi0
> > mtrr: Pentium Pro MTRR support
> > uvideo0 at uhub0 port 6 configuration 1 interface 0 "Azurewave USB2.0
> > UVC VGA WebCam" rev 2.00/3.22 addr 2
> > video0 at uvideo0
> > vscsi0 at root
> > scsibus1 at vscsi0: 256 targets
> > softraid0 at root
> > root on sd0a swap on sd0b dump on sd0b
> > WARNING: / was not properly unmounted
> > alc0: watchdog timeout (missed link)
> > splassert: assertwaitok: want -1 have 1
> > Starting stack trace...
> > splassert_fail() at splassert_fail+0x55
> > assertwaitok() at assertwaitok+0x1c
> > pool_get() at pool_get+0x95
> > m_gethdr() at m_gethdr+0x3e
> > alc_newbuf() at alc_newbuf+0x39
> > alc_init_rx_ring() at alc_init_rx_ring+0x80
> > alc_init() at alc_init+0x2d
> > if_slowtimo() at if_slowtimo+0x5c
> > softclock() at softclock+0x291
> > softintr_dispatch() at softintr_dispatch+0x5d
> > Xsoftclock() at Xsoftclock+0x2d
> > --- interrupt ---
> > end trace frame: 0x0, count: 246
> > 0x8:
> > End of stack trace.
> > Stopped at Debugger+0x5: leave
> > ddb{0}> Debugger() at Debugger+0x5
> > assertwaitok() at assertwaitok+0x1c
> > pool_get() at pool_get+0x95
> > m_gethdr() at m_gethdr+0x3e
> > alc_newbuf() at alc_newbuf+0x39
> > alc_init_rx_ring() at alc_init_rx_ring+0x80
> > alc_init() at alc_init+0x2d
> > if_slowtimo() at if_slowtimo+0x5c
> > softclock() at softclock+0x291
> > softintr_dispatch() at softintr_dispatch+0x5d
> > Xsoftclock() at Xsoftclock+0
> >
> >
> > Moreover, the system reboot immediately when I unplug the network
> > cable. I am unable to drop into ddb or get a more precise message than
> > following (truncated) dmesg :
> >
> > OpenBSD 4.9-beta (GENERIC.MP) #786: Tue Jan 25 17:46:34 MST 2011
> > [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> > real mem = 1062797312 (1013MB)
> > avail mem = 1020477440 (973MB)
> > mainbus0 at root
> > bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xf0760 (31 entries)
> > bios0: vendor American Megatrends Inc. version "0904" date 08/12/2010
> > bios0: ASUSTeK Computer INC. 1005PX
> > acpi0 at bios0: rev 2
> > acpi0: sleep states S0 S3 S4 S5
> > acpi0: tables DSDT FACP APIC MCFG ECDT OEMB HPET GSCI SSDT SLIC
> > acpi0: wakeup devices P0P1(S4) P0P4(S4) P0P5(S4) P0P6(S4) P0P7(S4)
> > acpitimer0 at acpi0: 3579545 Hz, 24 bits
> > acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
> > cpu0 at mainbus0: apid 0 (boot processor)
> > cpu0: Intel(R) Atom(TM) CPU N450 @ 1.66GHz, 1666.73 MHz
> > cpu0:
> > FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,MOVBE,NXE,LONG
> > cpu0: 512KB 64b/line 8-way L2 cache
> > cpu0: apic clock running at 166MHz
> > cpu1 at mainbus0: apid 1 (application processor)
> > cpu1: Intel(R) Atom(TM) CPU N450 @ 1.66GHz, 1666.48 MHz
> > cpu1:
> > FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,MOVBE,NXE,LONG
> > cpu1: 512KB 64b/line 8-way L2 cache
> > ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
> > ioapic0: misconfigured as apic 1, remapped to apid 2
> > acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
> > acpiec0 at acpi0acpiec _REG failed, broken BIOS
> >
> > acpihpet0 at acpi0: 14318179 Hz
> > acpiprt0 at acpi0: bus 0 (PCI0)
> > acpiprt1 at acpi0: bus 4 (P0P4)
> > acpiprt2 at acpi0: bus 2 (P0P5)
> > acpiprt3 at acpi0: bus -1 (P0P6)
> > acpiprt4 at acpi0: bus 1 (P0P7)
> > acpiec at acpi0 not configured
> > acpicpu0 at acpi0: C3, C2, C1, PSS
> > acpicpu1 at acpi0: C3, C2, C1, PSS
> > acpitz at acpi0 not configured
> > acpibat at acpi0 not configured
> > acpiac at acpi0 not configured
> > acpiasus0 at acpi0
> > acpibtn0 at acpi0: LID_
> > acpibtn1 at acpi0: SLPB
> > acpibtn2 at acpi0: PWRB
> > acpivideo0 at acpi0: VGA_
> > acpivout0 at acpivideo0: CRTD
> > acpivout1 at acpivideo0: TVOD
> > acpivout2 at acpivideo0: LCDD
> > cpu0: Enhanced SpeedStep 1666 MHz: speeds: 1667, 1333, 1000 MHz
> > pci0 at mainbus0 bus 0
> > pchb0 at pci0 dev 0 function 0 "Intel Pineview DMI" rev 0x00
> > vga1 at pci0 dev 2 function 0 "Intel Pineview Video" rev 0x00
> > wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
> > wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
> > intagp0 at vga1
> > agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
> > inteldrm0 at vga1: apic 2 int 16 (irq 15)
> > drm0 at inteldrm0
> > "Intel Pineview Video" rev 0x00 at pci0 dev 2 function 1 not configured
> > azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x02:
> > apic 2 int 22 (irq 4)
> > azalia0: codecs: Realtek ALC269
> > audio0 at azalia0
> > ppb0 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x02: apic 2
> > int 16 (irq 15)
> > pci1 at ppb0 bus 4
> > ppb1 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x02: apic 2
> > int 17 (irq 10)
> > pci2 at ppb1 bus 2
> > athn0 at pci2 dev 0 function 0 "Atheros AR2427" rev 0x01: apic 2 int
> > 17 (irq 10)
> > athn0: AR9285 rev 2 (1T1R), ROM rev 13, address 48:5d:60:24:0f:2b
> > ppb2 at pci0 dev 28 function 3 "Intel 82801GB PCIE" rev 0x02: apic 2
> > int 19 (irq 11)
> > pci3 at ppb2 bus 1
> > alc0 at pci3 dev 0 function 0 "Attansic Technology L2C" rev 0xc0: apic
> > 2 int 19 (irq 11), address 20:cf:30:70:8f:31
> > atphy0 at alc0 phy 0: F1 10/100/1000 PHY, rev. 11
> > uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x02: apic 2
> > int 23 (irq 3)
> > uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x02: apic 2
> > int 19 (irq 11)
> > uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x02: apic 2
> > int 18 (irq 7)
> > uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x02: apic 2
> > int 16 (irq 15)
> > ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x02: apic 2
> > int 23 (irq 3)
> > usb0 at ehci0: USB revision 2.0
> > uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
> > ppb3 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe2
> > pci4 at ppb3 bus 5
> > pcib0 at pci0 dev 31 function 0 "Intel Tigerpoint LPC" rev 0x02
> > ahci0 at pci0 dev 31 function 2 "Intel 82801GR AHCI" rev 0x02: apic 2
> > int 21 (irq 5), AHCI 1.1
> > scsibus0 at ahci0: 32 targets
> > sd0 at scsibus0 targ 0 lun 0:<ATA, WDC WD2500BEVT-8, 01.0> SCSI3
> > 0/direct fixed
> > sd0: 238475MB, 512 bytes/sec, 488397168 sec total
> > ichiic0 at pci0 dev 31 function 3 "Intel 82801GB SMBus" rev 0x02: apic
> > 2 int 21 (irq 11)
> > iic0 at ichiic0
> > spdmem0 at iic0 addr 0x50: 1GB DDR2 SDRAM non-parity PC2-6400CL5 SO-DIMM
> > usb1 at uhci0: USB revision 1.0
> > uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
> > usb2 at uhci1: USB revision 1.0
> > uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
> > usb3 at uhci2: USB revision 1.0
> > uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
> > usb4 at uhci3: USB revision 1.0
> > uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
> > isa0 at pcib0
> > isadma0 at isa0
> > pckbc0 at isa0 port 0x60/5
> > pckbd0 at pckbc0 (kbd slot)
> > pckbc0: using irq 1 for kbd slot
> > wskbd0 at pckbd0: console keyboard, using wsdisplay0
> > pms0 at pckbc0 (aux slot)
> > pckbc0: using irq 12 for aux slot
> > wsmouse0 at pms0 mux 0
> > pcppi0 at isa0 port 0x61
> > spkr0 at pcppi0
> > mtrr: Pentium Pro MTRR support
> > uvideo0 at uhub0 port 6 configuration 1 interface 0 "Azurewave USB2.0
> > UVC VGA WebCam" rev 2.00/3.22 addr 2
> > video0 at uvideo0
> > vscsi0 at root
> > scsibus1 at vscsi0: 256 targets
> > softraid0 at root
> > root on sd0a swap on sd0b dump on sd0b
> > alc0: could not disable RxQ/TxQ (0x00000008)!
> > alc0: could not disable Rx/Tx MAC(0x00000008)!
> > alc0: DMA read error! -- resetting
> > kernel: protection fault trap, code=0
> > Stopped at
> >
>
> While investigating this I found two logic errors in the code, following
> diff fix the "could not disable RxQ/TxQ" and "could not disable Rx/Tx
> MAC" things.
>
> Index: if_alc.c
> ===================================================================
> RCS file: /cvs/openbsd/src/sys/dev/pci/if_alc.c,v
> retrieving revision 1.8
> diff -u -r1.8 if_alc.c
> --- if_alc.c 31 Aug 2010 17:13:44 -0000 1.8
> +++ if_alc.c 28 Jan 2011 08:00:37 -0000
> @@ -2191,7 +2191,7 @@
> /* Disable Rx/Tx MAC. */
> reg = CSR_READ_4(sc, ALC_MAC_CFG);
> if ((reg & (MAC_CFG_TX_ENB | MAC_CFG_RX_ENB)) != 0) {
> - reg &= ~MAC_CFG_TX_ENB | MAC_CFG_RX_ENB;
> + reg &= ~(MAC_CFG_TX_ENB | MAC_CFG_RX_ENB);
> CSR_WRITE_4(sc, ALC_MAC_CFG, reg);
> }
> for (i = ALC_TIMEOUT; i > 0; i--) {
> @@ -2242,7 +2242,7 @@
> }
> /* Disable TxQ. */
> reg = CSR_READ_4(sc, ALC_TXQ_CFG);
> - if ((reg & TXQ_CFG_ENB) == 0) {
> + if ((reg & TXQ_CFG_ENB) != 0) {
> reg &= ~TXQ_CFG_ENB;
> CSR_WRITE_4(sc, ALC_TXQ_CFG, reg);
> }
Thanks, I committed your diff.
Kevin