Subject: Re: Soekris Net4801: panic on
To: Jaromir Dolecek <jdolecek@NetBSD.org>
From: Jun-ichiro itojun Hagino <itojun@iijlab.net>
List: port-i386
Date: 08/15/2003 00:29:29
>Seems following might be the required change - can you try it out?

	your patch does not seem to change the situation, unfortunately.

	if i "break" instead of "continue" on the 2nd if statement,
	most of the pci devices (ethernet chips) are skipped but i can go to
	multiuser.  so there has to be something to do with the 2nd loop.

itojun


Index: pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pci.c,v
retrieving revision 1.80
diff -u -r1.80 pci.c
--- pci.c	2003/06/15 23:09:09	1.80
+++ pci.c	2003/08/14 15:21:02
@@ -262,11 +262,14 @@
 
 	pci_decompose_tag(pc, tag, &bus, &device, &function);
 
+	bhlcr = pci_conf_read(pc, tag, PCI_BHLC_REG);
+	if (PCI_HDRTYPE_TYPE(bhlcr) > 2)
+		return (0);
+
 	id = pci_conf_read(pc, tag, PCI_ID_REG);
 	csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
 	class = pci_conf_read(pc, tag, PCI_CLASS_REG);
 	intr = pci_conf_read(pc, tag, PCI_INTERRUPT_REG);
-	bhlcr = pci_conf_read(pc, tag, PCI_BHLC_REG);
 
 	/* Invalid vendor ID value? */
 	if (PCI_VENDOR(id) == PCI_VENDOR_INVALID)
@@ -431,6 +434,11 @@
 #endif
 	{
 		tag = pci_make_tag(pc, sc->sc_bus, device, 0);
+
+		bhlcr = pci_conf_read(pc, tag, PCI_BHLC_REG);
+		if (PCI_HDRTYPE_TYPE(bhlcr) > 2)
+			continue;			<--- change to break
+
 		id = pci_conf_read(pc, tag, PCI_ID_REG);
 
 		/* Invalid vendor ID value? */
@@ -442,7 +450,6 @@
 
 		qd = pci_lookup_quirkdata(PCI_VENDOR(id), PCI_PRODUCT(id));
 
-		bhlcr = pci_conf_read(pc, tag, PCI_BHLC_REG);
 		if (PCI_HDRTYPE_MULTIFN(bhlcr) ||
 		    (qd != NULL &&
 		      (qd->quirks & PCI_QUIRK_MULTIFUNCTION) != 0))


>> Memory: 639/130048 k
Press return to boot now, any other key for boot menu
booting hd0e:netbsd - starting in 543210
6384368+133800+438404 [322272+294306]=0x73a0c4
BIOS CFG: Model-SubM-Rev: fc-00-00, 0x7c<EBDA,WAITEV,KBDINT,RTC,IC2>
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 1.6W (NET4801) #12: Fri Aug 15 00:24:15 JST 2003
	itojun@starfruit.itojun.org:/home/itojun/NetBSD/src/sys/arch/i386/compile/NET4801
total memory = 127 MB
avail memory = 110 MB
using 1659 buffers containing 6636 KB of memory
BIOS32 rev. 0 found at 0xf7840
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: National Semiconductor Geode GX1 (586-class), 266.65 MHz, id 0x540
cpu0: features 808131<FPU,TSC,MSR,CX8>
cpu0: features 808131<CMOV,MMX>
cpu0: I-cache 12K uOp cache 8-way
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: Cyrix Corporation MediaGX Built-in PCI Host Controller (rev. 0x00)
isa0 at mainbus0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com0: console
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
wdc0 at isa0 port 0x1f0-0x1f7 irq 14
wd0 at wdc0 channel 0 drive 0: <SanDisk SDCFB-1024>
wd0: drive supports 1-sector PIO transfers, LBA addressing
wd0: 977 MB, 1986 cyl, 16 head, 63 sec, 512 bytes/sect x 2001888 sectors
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
Kernelized RAIDframe activated
IPsec: Initialized Security Association Processing.
boot device: wd0
root on wd0e dumps on wd0b
WARNING: clock time much less than file system time
WARNING: using file system time
WARNING: CHECK AND RESET THE DATE!
root file system type: ffs