Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Dec 2004 14:31:45 -0800
From:      Jon Kuroda <jon@CSUA.Berkeley.EDU>
To:        FreeBSD-gnats-submit@FreeBSD.org, freebsd-i386@FreeBSD.org
Subject:   Re: i386/74829: FreeBSD 5.3-RELEASE hangs during boot/install on Tyan Thunder i7520 (S5360) motherboard
Message-ID:  <20041215223145.GA9638@soda.csua.berkeley.edu>
In-Reply-To: <200412080110.iB81AUXc033809@freefall.freebsd.org>
References:  <200412080106.iB8165GT030848@www.freebsd.org> <200412080110.iB81AUXc033809@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--LyciRD1jyfeSSjG0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Attached are a patch and readme (written by Vadim Kogan).  Many thanks to
Vadim Kogan and Bill Paul for doing the bulk of the work on this.

This and other 5.3 patches can also be found here:
http://www.csua.berkeley.edu/~vadim/soda-diffs/

On Wed, Dec 08, 2004 at 01:10:30AM +0000, FreeBSD-gnats-submit@FreeBSD.org wrote:
> Thank you very much for your problem report.
> It has the internal identification `i386/74829'.
> The individual assigned to look at your
> report is: freebsd-i386. 
> 
> You can access the state of your problem report at any time
> via this link:
> 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=74829
> 
> >Category:       i386
> >Responsible:    freebsd-i386
> >Synopsis:       FreeBSD 5.3-RELEASE hangs during boot/install on Tyan Thunder i7520 (S5360) motherboard
> >Arrival-Date:   Wed Dec 08 01:10:30 GMT 2004

--LyciRD1jyfeSSjG0
Content-Type: text/plain; charset=us-ascii
Content-Description: README
Content-Disposition: attachment; filename=README

This is a fix for a bug in FreeBSD 5.3, which prevents it from
booting on soda without special flags.

The bug is triggered by a PCI EXPRESS DMA Controller on soda's
motherboard. It has a bad resource, which is (properly) disabled.
However, FreeBSD (improperly) enables it without checking that the
resource is a happy one, causing physical page 0 to go to lala land,
vm86 mode to screw up, keyboard not be initialized and a complete
hang on boot right in the middle of keyboard initialization.

You can also prevent any resource from being enabled by means of
setting hw.pci.enable_io_modes to 0 before booting the kernel.

Note that due to an unrelated bug (discussed elsewhere), an UP
kernel will not boot on soda.

	- Vadim


--LyciRD1jyfeSSjG0
Content-Type: text/plain; charset=us-ascii
Content-Description: pci.c.diff
Content-Disposition: attachment; filename="pci.c.diff"

--- /usr/src/sys/dev/pci/pci.c.vsave	Tue Dec 14 21:39:20 2004
+++ /usr/src/sys/dev/pci/pci.c	Tue Dec 14 18:56:00 2004
@@ -688,6 +688,7 @@
 		    cfg->mfdev);
 		printf("\tcmdreg=0x%04x, statreg=0x%04x, cachelnsz=%d (dwords)\n", 
 		    cfg->cmdreg, cfg->statreg, cfg->cachelnsz);
+
 		printf("\tlattimer=0x%02x (%d ns), mingnt=0x%02x (%d ns), maxlat=0x%02x (%d ns)\n",
 		    cfg->lattimer, cfg->lattimer * 30, cfg->mingnt,
 		    cfg->mingnt * 250, cfg->maxlat, cfg->maxlat * 250);
@@ -792,6 +793,16 @@
 	}
 
 	/*
+	 * If base is 0 or is all 1s, then we have problems.  It is best to ignore
+	 * such entires for the moment.  These will be allocated later if
+	 * the driver specifically requests them.
+	 */
+	if( base == 0ull || base == ~( ~0ull << ln2range ) ) {
+		printf( "\tVadim: bogus map - ignoring..\n" );
+		return 1;
+	}
+
+	/*
 	 * This code theoretically does the right thing, but has
 	 * undesirable side effects in some cases where peripherals
 	 * respond oddly to having these bits enabled.  Let the user
@@ -816,13 +827,6 @@
 		if (type == SYS_RES_MEMORY && !pci_memen(pcib, b, s, f))
 			return (1);
 	}
-	/*
-	 * If base is 0, then we have problems.  It is best to ignore
-	 * such entires for the moment.  These will be allocated later if
-	 * the driver specifically requests them.
-	 */
-	if (base == 0)
-		return 1;
 
 	start = base;
 	end = base + (1 << ln2size) - 1;
@@ -960,9 +964,8 @@
 			pcifunchigh = PCI_FUNCMAX;
 		for (f = 0; f <= pcifunchigh; f++) {
 			dinfo = pci_read_device(pcib, busno, s, f, dinfo_size);
-			if (dinfo != NULL) {
-				pci_add_child(dev, dinfo);
-			}
+			if (dinfo != NULL)
+				 pci_add_child(dev, dinfo);
 		}
 	}
 #undef REG

--LyciRD1jyfeSSjG0--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041215223145.GA9638>