Subject: port-i386/26910: 2.0_BETA hangs after a UDMA failure/downgrade
To: None <gnats-bugs@gnats.netbsd.org>
From: Tyler M Mitchell <fission@styrophone.net>
List: netbsd-bugs
Date: 09/11/2004 02:33:00
>Number:         26910
>Category:       port-i386
>Synopsis:       2.0_BETA hangs after a UDMA failure/downgrade
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 11 10:08:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Tyler Mitchell
>Release:        NetBSD 2.0_BETA
>Organization:
>Environment:
	
	
NetBSD 2.0_BETA (GENERIC.DEBUG) #0: Sat Sep 11 01:16:06 PDT 2004
	fission@monopole:/usr/obj/sys/arch/i386/compile.i386/GENERIC.DEBUG
Architecture: i386
Machine: i386
>Description:
I recently tried to compile and boot a GENERIC 2.0_BETA kernel, but it 
seemed to lock up on me immediately after doing a UDMA downgrade.
Because I don't have a serial console, I can only provide the dmesg from
1.6.2; I've indicated at what point 2.0_BETA would freeze.

I have built a GENERIC.DEBUG kernel (w/ DIAGNOSTIC, DEBUG, and LOCKDEBUG) 
for testing purposes.  I would be more than happy to perform any 
additional testing required.  A trace from ddb (which I typed by hand...):

-- interrupt --
cpu_switch(...) at netbsd:cpu_switch+0xd5
ltsleep(...) at netbsd:ltsleep+0x4a3
biowait(...) at netbsd:biowait+0xdf
read_sector(...) at netbsd:read_sector+0xd8
scan_mbr(...) at netbsd:scan_mbr+0x2e
readdisklabel(...) at netbsd:readdisklabel+0xc8
wdgetdisklabel(...) at netbsd:wdgetdisklabel+0x90
wdopen(...) at netbsd:wdopen+0x207
spec_open(...) at netbsd:spec_open+0x20d
VOP_OPEN(...) at netbsd:VOP_OPEN+0x34
rf_find_raid_components(...) at netbsd:rf_find_raid_components+0x102
rf_autoconfig(...) at netbsd:rf_autoconfig+0x30
config_finalize(...) at netbsd:config_finalize+0x1d
main(...) at netbsd:main+0x3cf

For some reason, this hard drive advertises that it works at UDMA5, but it 
always seems to fail and reverts back to UDMA2.  (Well, in 1.6.2 it does.)

* * *

NetBSD 1.6.2 (GENERIC) #0: Tue Feb 10 21:53:10 UTC 2004
    autobuild@tgm.netbsd.org:/autobuild/netbsd-1-6-PATCH002/i386/OBJ/autobuild/netbsd-1-6-PATCH002/src/sys/arch/i386/compile/GENERIC
cpu0: AMD Athlon Model 4 (Thunderbird) (686-class), 1195.27 MHz
cpu0: I-cache 64 KB 64b/line 2-way, D-cache 64 KB 64b/line 2-way
cpu0: L2 cache 256 KB 64b/line 16-way
cpu0: features 183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR>
cpu0: features 183f9ff<PGE,MCA,CMOV,FGPAT,PSE36,MMX>
cpu0: features 183f9ff<FXSR>
total memory = 255 MB
avail memory = 230 MB
using 3296 buffers containing 13184 KB of memory
BIOS32 rev. 0 found at 0xfb130
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: VIA Technologies VT8363 KT133 System Controller (rev. 0x03)
agp0 at pchb0: aperture at 0xd0000000, size 0x10000000
ppb0 at pci0 dev 1 function 0: VIA Technologies VT8363 KT133 PCI to AGP Bridge (rev. 0x00)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: 3Dfx Interactive Voodoo3 (rev. 0x01)
pci_mem_find: void region
pci_mem_find: void region
pci_mem_find: void region
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
pcib0 at pci0 dev 7 function 0
pcib0: VIA Technologies VT82C686A (Apollo KX133) PCI-ISA Bridge (rev. 0x40)
pciide0 at pci0 dev 7 function 1: VIA Technologies VT82C686A (Apollo KX133) ATA100 controller
pciide0: bus-master DMA support present
pciide0: primary channel configured to compatibility mode
atapibus0 at pciide0 channel 0: 2 targets
cd0 at atapibus0 drive 1: <CREATIVEDVD-ROM DVD2240E    10/13/97, , 1.5A> type 5 cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2
wd0 at pciide0 channel 0 drive 0: <Maxtor 93073H4>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 29311 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 60030432 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
pciide0: primary channel interrupting at irq 14
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA data transfers)
cd0(pciide0:0:1): using PIO mode 4, DMA mode 2 (using DMA data transfers)
pciide0: secondary channel configured to compatibility mode
pciide0: disabling secondary channel (no drives)
uhci0 at pci0 dev 7 function 2: VIA Technologies VT83C572 USB Controller (rev. 0x16)
uhci0: interrupting at irq 10
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: VIA Technologie UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 7 function 3: VIA Technologies VT83C572 USB Controller (rev. 0x16)
uhci1: interrupting at irq 10
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: VIA Technologie UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
pchb1 at pci0 dev 7 function 4
pchb1: VIA Technologies VT82C686A SMBus Controller (rev. 0x40)
auvia0 at pci0 dev 7 function 5: VIA VT82C686A AC'97 Audio (rev 0x50)
auvia0: interrupting at irq 5
auvia0: ICE17 codec; headphone, 18 bit DAC, 18 bit ADC, Unknown 3D
audio0 at auvia0: full duplex, mmap, independent
fxp0 at pci0 dev 9 function 0: i82559 Ethernet, rev 8
fxp0: interrupting at irq 11
fxp0: Ethernet address 00:90:27:8c:8a:b3
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
bktr0 at pci0 dev 10 function 0
bktr0: interrupting at irq 5
bktr0: Warning - card vendor 0x107d (model 0x6606) unknown.
bktr0: Pinnacle/Miro TV, <no> tuner.
Brooktree product 0x0878 (miscellaneous multimedia, revision 0x11) at pci0 dev 10 function 1 not configured
emuxki0 at pci0 dev 12 function 0: Creative Labs SBLive! EMU 10000 (audio multimedia, revision 0x08)
emuxki0: interrupting at irq 9
emuxki0: Crystal CS4297A codec; headphone, 20 bit DAC, 18 bit ADC, Crystal Semi 3D
audio1 at emuxki0: full duplex, mmap, independent
Creative Labs PCI Gameport Joystick (miscellaneous input, revision 0x08) at pci0 dev 12 function 1 not configured
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
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
lpt0 at isa0 port 0x378-0x37b irq 7
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
isapnp0: no ISA Plug 'n Play devices found
biomask e565 netmask ed65 ttymask fde7
Kernelized RAIDframe activated
wd0: transfer error, downgrading to Ultra-DMA mode 2
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
cd0(pciide0:0:1): using PIO mode 4, DMA mode 2 (using DMA data transfers)
wd0d: error reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
wd0: (aborted command, interface CRC error)

	===> At this point, it would freeze in 2.0_BETA.
	===> In 1.6.2 it continues after downgrading.

wd0: soft error (corrected)
ugen0 at uhub1 port 2
ugen0: Genesys Logic USB Host To Host Bridge, rev 1.00/1.80, addr 2
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)
>How-To-Repeat:
	Boot with an ATA hard drive that incorrectly advertises its
	capabilities.  It downgrades to a lower setting, then the kernel hangs.
>Fix:
	Hardcoding the correct UDMA mode allows the kernel to boot.
	For example, on my system I used:

		wd*	at atabus? drive ? flags 0x0a00
>Release-Note:
>Audit-Trail:
>Unformatted: