Subject: kern/26502: IDE broken with SiS 496
To: None <>
From: Christian Biere <>
List: netbsd-bugs
Date: 08/01/2004 11:22:18
>Number:         26502
>Category:       kern
>Synopsis:       IDE broken with SiS 496
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 01 09:23:00 UTC 2004
>Originator:     Christian Biere
>Release:        NetBSD 2.0G
System: NetBSD cyclonus 2.0G NetBSD 2.0G (STARSCREAM) #0: Tue Jul 20 02:41:48 CEST 2004 bin@cyclonus:/usr/obj/sys/arch/i386/compile/STARSCREAM i386
Architecture: i386
Machine: i386
Some changes between the end of April and today broke support for the IDE
controller (or drive) in my machine. It fails pretty early in the boot
stage with timeouts. At first I thought the disk was damaged but the old
kernel boots just fine.

The kernel prints some message which I cannot repeat as-is because the
kernel doesn't seem to use XON/XOFF handshaking so that the output on the
serial console gets corrupted. However, it's the error message from
sys/dev/wdc/ata/ata_wdc.c in wdc_ata_bio_intr():
	"device timeout, c_bcount=%s, c_skip%d".

This repeats forever and kernel can't boot any further. I've tried to
revert a few of the changes WRT ata*, wdc* and pciiide* but didn't have
any success. Either the problem persisted or the harddisk wasn't detected
at all.

This is from the kernel and configuration which still works:

NetBSD shockwave 2.0E NetBSD 2.0E (SHOCKWAVE) #2: Fri Apr 30 01:29:53 CEST 2004  bin@cyclonus:/usr/obj/sys/arch/i386/compile/SHOCKWAVE i386

NetBSD 2.0E (SHOCKWAVE) #2: Fri Apr 30 01:29:53 CEST 2004
total memory = 32380 KB
avail memory = 29908 KB
BIOS32 rev. 0 found at 0xfbdb0
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: AMD Am5x86 W/B 133/160 (486-class), id 0x4f4
cpu0: features 1<FPU>
Warning: broken PCI-Host bridge detected; disabling memory-mapped access
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space enabled
pchb0 at pci0 dev 5 function 0
pchb0: vendor 0x1039 product 0x0496 (rev. 0x31)
rtk0 at pci0 dev 6 function 0: Realtek 8139 10/100BaseTX
rtk0: interrupting at irq 12
rtk0: Ethernet address 00:30:84:29:09:2a
ukphy0 at rtk0 phy 7: Generic IEEE 802.3u media interface
ukphy0: OUI 0x000000, model 0x0000, rev. 0
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
rtk1 at pci0 dev 8 function 0: Realtek 8139 10/100BaseTX
rtk1: interrupting at irq 11
rtk1: Ethernet address 00:4f:4e:0c:8f:ff
ukphy1 at rtk1 phy 7: Generic IEEE 802.3u media interface
ukphy1: OUI 0x000000, model 0x0000, rev. 0
ukphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
pciide0 at pci0 dev 10 function 0
pciide0: vendor 0x10ad product 0x0001 (rev. 0x02)
pciide0: hardware does not support DMA
pciide0: primary channel wired to compatibility mode
pciide0: primary channel interrupting at irq 14
atabus0 at pciide0 channel 0
pciide0: primary channel ignored (other hardware responding at addresses)
pciide0: secondary channel wired to compatibility mode
pciide0: secondary channel interrupting at irq 15
atabus1 at pciide0 channel 1
pciide0: secondary channel ignored (not responding; disabled or no drives?)
isa0 at mainbus0
lpt0 at isa0 port 0x378-0x37b irq 7
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
com1: console
wdc0 at isa0 port 0x1f0-0x1f7 irq 14
atabus2 at wdc0 channel 0
npx0 at isa0 port 0xf0-0xff: using exception 16
wd0 at atabus0 drive 0: <QUANTUM FIREBALLlct10 10>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 9787 MB, 19885 cyl, 16 head, 63 sec, 512 bytes/sect x 20044080 sectors
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
boot device: wd0
root on wd0a dumps on wd0b
warning: no /dev/console

Excerpt from ident /netbsd:
     $NetBSD: bus_space.c,v 1.2 2003/03/14 18:47:53 christos Exp $
     $NetBSD: pci_machdep.c,v 1.9 2003/10/30 21:19:54 fvdl Exp $
     $NetBSD: isa_machdep.c,v 1.10 2003/10/30 21:19:54 fvdl Exp $
     $NetBSD: pciide_machdep.c,v 1.3 2003/10/30 21:19:54 fvdl Exp $
     $NetBSD: subr_disk_mbr.c,v 1.4 2003/10/08 04:25:46 lukem Exp $
     $NetBSD: atapi_base.c,v 1.19 2004/03/10 21:57:31 bouyer Exp $
     $NetBSD: atapi_wdc.c,v 1.69 2004/02/03 20:55:02 bouyer Exp $
     $NetBSD: atapiconf.c,v 1.63 2003/10/17 00:19:46 mycroft Exp $
     $NetBSD: wd.c,v 1.274 2004/02/28 06:28:47 yamt Exp $
     $NetBSD: ata_wdc.c,v 1.53 2004/03/02 13:13:57 fvdl Exp $
     $NetBSD: ata.c,v 1.28 2004/04/13 19:51:06 bouyer Exp $
     $NetBSD: ata_raid.c,v 1.8 2004/01/25 18:06:48 hannken Exp $
     $NetBSD: ata_raid_promise.c,v 1.3 2003/12/14 05:37:25 thorpej Exp $
     $NetBSD: pci.c,v 1.83 2004/04/23 21:13:07 itojun Exp $
     $NetBSD: pci_map.c,v 1.12 2002/05/30 12:06:43 drochner Exp $
     $NetBSD: pci_quirks.c,v 1.3 2003/08/15 07:17:21 itojun Exp $
     $NetBSD: pci_subr.c,v 1.58 2004/04/23 21:13:07 itojun Exp $
     $NetBSD: pci_usrreq.c,v 1.8 2003/06/29 22:30:27 fvdl Exp $
     $NetBSD: pciide_common.c,v 1.9 2004/04/23 21:13:07 itojun Exp $
     $NetBSD: pciide.c,v 1.209 2003/10/08 11:51:59 bouyer Exp $
     $NetBSD: pchb.c,v 1.50 2004/04/23 21:13:05 itojun Exp $
     $NetBSD: wdc_isa.c,v 1.40 2004/01/03 22:56:53 thorpej Exp $

The complete kernel configuration:

include 	"arch/i386/conf/std.i386"
options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
maxusers	32		# estimated number of users
options 	I486_CPU
options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
options 	NTP		# NTP phase/frequency locked loop
options 	KTRACE		# system call tracing via ktrace(1)
options 	SYSTRACE	# system call vetting via systrace(1)
options 	SYSVMSG		# System V-like message queues
options 	SYSVSEM		# System V-like semaphores
options 	P1003_1B_SEMAPHORE	# p1003.1b semaphore support
options 	DDB		# in-kernel debugger
options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB
makeoptions	DEBUG="-march=i486 -g"	# compile full symbol table
options 	COMPAT_16	# NetBSD 1.6
options 	COMPAT_20	# NetBSD 2.0
file-system 	FFS		# UFS
file-system 	MFS		# memory file system
file-system 	FDESC		# /dev/fd
options 	GATEWAY		# packet forwarding
options 	INET		# IP + ICMP + TCP + UDP
options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
options 	PFIL_HOOKS	# pfil(9) packet filter hooks
options 	IPFILTER_LOG	# ipmon(8) log support
config		netbsd	root on wd0a type ffs
mainbus0 at root
cpu* at mainbus?
pci*	at mainbus? bus ?
pchb*	at pci? dev ? function ?	# PCI-Host bridges
isa0	at mainbus?
npx0	at isa? port 0xf0 irq 13	# x86 math coprocessor
com0	at isa? port 0x3f8 irq 4	# Standard PC serial ports
com1	at isa? port 0x2f8 irq 3
lpt0	at isa? port 0x378 irq 7	# standard PC parallel ports
pciide* 	at pci? dev ? function ? flags 0x0000	# GENERIC pciide driver
wdc0	at isa? port 0x1f0 irq 14 flags 0x00
wdc1	at isa? port 0x170 irq 15 flags 0x00
atabus* at ata?
wd*	at atabus? drive ? flags 0x0000
pseudo-device	ataraid
atapibus* at atapi?
rtk*	at pci? dev ? function ?	# Realtek 8129/8139
ukphy*	at mii? phy ?			# generic unknown PHYs
include	"arch/i386/conf/GENERIC.local"
pseudo-device	cgd		4	# cryptographic disk devices
pseudo-device	md		1	# memory disk device (ramdisk)
pseudo-device	vnd		4	# disk-like interface to files
pseudo-device	bpfilter	8	# Berkeley packet filter
pseudo-device	ipfilter		# IP filter (firewall) and NAT
pseudo-device	loop			# network loopback
pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)
pseudo-device	pty			# pseudo-terminals
pseudo-device	rnd			# /dev/random and in-kernel generator
pseudo-device	clockctl		# user control of clock subsystem