grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#594967: Bug #594967: [poulsbo] grub-pc Hangs After "Welcome to G


From: Colin Watson
Subject: Re: Bug#594967: Bug #594967: [poulsbo] grub-pc Hangs After "Welcome to GRUB!"
Date: Mon, 3 Jan 2011 00:13:01 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

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  <address@hidden>

        * 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                                       address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]