From owner-freebsd-i386@FreeBSD.ORG Wed Dec 15 22:31:46 2004 Return-Path: Delivered-To: freebsd-i386@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9ABA916A4CE; Wed, 15 Dec 2004 22:31:46 +0000 (GMT) Received: from soda.csua.berkeley.edu (soda.CSUA.Berkeley.EDU [128.32.112.233]) by mx1.FreeBSD.org (Postfix) with ESMTP id 484F143D45; Wed, 15 Dec 2004 22:31:46 +0000 (GMT) (envelope-from jon@CSUA.Berkeley.EDU) Received: from soda.csua.berkeley.edu (IDENT:lIXN535ZrXD6sqxHZVP8YWyYZfZTB9rS@localhost [127.0.0.1]) iBFMVjoH017819 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 15 Dec 2004 14:31:45 -0800 (PST) (envelope-from jon@soda.csua.berkeley.edu) Received: (from jon@localhost) by soda.csua.berkeley.edu (8.12.9/8.12.9/Submit) id iBFMVj3D017818; Wed, 15 Dec 2004 14:31:45 -0800 (PST) Date: Wed, 15 Dec 2004 14:31:45 -0800 From: Jon Kuroda To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-i386@FreeBSD.org Message-ID: <20041215223145.GA9638@soda.csua.berkeley.edu> References: <200412080106.iB8165GT030848@www.freebsd.org> <200412080110.iB81AUXc033809@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="LyciRD1jyfeSSjG0" Content-Disposition: inline In-Reply-To: <200412080110.iB81AUXc033809@freefall.freebsd.org> User-Agent: Mutt/1.5.4i Subject: Re: i386/74829: FreeBSD 5.3-RELEASE hangs during boot/install on Tyan Thunder i7520 (S5360) motherboard X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2004 22:31:46 -0000 --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--