Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1PZY3T-0004ZU-IT for mharc-grub-devel@gnu.org; Sun, 02 Jan 2011 19:13:43 -0500 Received: from [140.186.70.92] (port=50762 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZY3R-0004ZP-Ii for grub-devel@gnu.org; Sun, 02 Jan 2011 19:13:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZY3M-0003pA-Ex for grub-devel@gnu.org; Sun, 02 Jan 2011 19:13:41 -0500 Received: from smarthost01.mail.zen.net.uk ([212.23.3.140]:39422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZY3M-0003oy-7L for grub-devel@gnu.org; Sun, 02 Jan 2011 19:13:36 -0500 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost01.mail.zen.net.uk with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1PZY33-0008Qz-K5; Mon, 03 Jan 2011 00:13:17 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 4.69) (envelope-from ) id 1PZY2o-0004zX-1J; Mon, 03 Jan 2011 00:13:02 +0000 Date: Mon, 3 Jan 2011 00:13:01 +0000 From: Colin Watson To: Steve McIntyre Message-ID: <20110103001300.GF15590@riva.ucam.org> References: <4D1FBA58.7040408@nac.net> <20110101235739.GA15590@riva.ucam.org> <20110102001459.GD9915@einval.com> <20110102181808.GD15590@riva.ucam.org> <20110102224150.GH9915@einval.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110102224150.GH9915@einval.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost01-IP: [82.69.40.219] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: grub-devel@gnu.org, "P. J. McDermott" , Nuutti Kotivuori , 594967@bugs.debian.org, "David A. Greene" , Matt Zagrabelny Subject: Re: Bug#594967: Bug #594967: [poulsbo] grub-pc Hangs After "Welcome to GRUB!" X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 00:13:42 -0000 On Sun, Jan 02, 2011 at 10:41:50PM +0000, Steve McIntyre wrote: > 1.iso: > > last bus number printed is b0 > > 2.iso: > > goes all the way through to bus ff and returns to a grub prompt This is interesting and suggests a measure of coincidence. What that patch did was skip remaining functions on a device that doesn't implement function 0, taking that as an indication that it doesn't exist. This was based on: http://en.wikipedia.org/wiki/PCI_configuration_space#Bus_enumeration Vladimir, are you OK with this change to trunk? 2011-01-02 Colin Watson * grub-core/bus/pci.c (grub_pci_iterate): Skip remaining functions on devices that do not implement function 0. === modified file 'grub-core/bus/pci.c' --- grub-core/bus/pci.c 2010-06-30 00:30:05 +0000 +++ grub-core/bus/pci.c 2011-01-02 17:31:32 +0000 @@ -90,7 +90,14 @@ grub_pci_iterate (grub_pci_iteratefunc_t /* Check if there is a device present. */ if (id >> 16 == 0xFFFF) - continue; + { + if (dev.function == 0) + /* Devices are required to implement function 0, so if + it's missing then there is no device here. */ + break; + else + continue; + } #ifdef GRUB_MACHINE_MIPS_YEELOONG /* Skip ghosts. */ Nevertheless, I'm not confident that this will fix the problem on all machines, so I would like to sort out the bridge handling as well. > 3.iso: > > grub> set debug=pci > grub> lspci > bus/pci.c:92: bus 0 > 00:00.0 8086:8100 [0600] Host Bridge > 00:02.0 8086:8108 [0300] VGA Controller > 00:1b.0 8086:811b [0403] Multimedia device > 00:1c.0 8086:8110 [0604] PCI-PCI Bridge > 00:1c.1 8086:8112 [0604] PCI-PCI Bridge > 00:1d.0 8086:8114 [0c03] USB Controller > 00:1d.1 8086:8115 [0c03] USB Controller > 00:1d.2 8086:8116 [0c03] USB Controller > 00:1d.7 8086:8117 [0c03] USB Controller [PI 20] > 00:1f.0 8086:8119 [0601] ISA Bridge > 00:1f.1 8086:811a [0101] IDE Controller [PI 80] > grub> Whoops, I forgot to right-shift the header word. Can you try 4.iso instead, at the same location? I also made it handle PCI-to-CardBus bridges the same way as PCI-to-PCI bridges since that's what pciutils does. (In addition to 'set debug=pci', I'd recommend also doing 'set pager=1' so that lspci's output will be paged.) Thanks, -- Colin Watson [cjwatson@debian.org]