Patchwork [seabios,1/5] pci: init all devices

login
register
mail settings
Submitter Gerd Hoffmann
Date May 4, 2012, 8:21 a.m.
Message ID <1336119687-6295-2-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/156812/
State New
Headers show

Comments

Gerd Hoffmann - May 4, 2012, 8:21 a.m.
seabios used to initialize root bus devices only, with this patch
devices behind pci bridges are initialized too.  This allows to boot
from virtio devices behind pci bridges.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 src/pciinit.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
Kevin O'Connor - May 4, 2012, 1:15 p.m.
On Fri, May 04, 2012 at 10:21:23AM +0200, Gerd Hoffmann wrote:
> seabios used to initialize root bus devices only, with this patch
> devices behind pci bridges are initialized too.  This allows to boot
> from virtio devices behind pci bridges.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  src/pciinit.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/src/pciinit.c b/src/pciinit.c
> index 25b04ac..6a7a0d2 100644
> --- a/src/pciinit.c
> +++ b/src/pciinit.c
> @@ -213,9 +213,6 @@ static void pci_bios_init_devices(void)
>  {
>      struct pci_device *pci;
>      foreachpci(pci) {
> -        if (pci_bdf_to_bus(pci->bdf) != 0)
> -            // Only init devices on host bus.
> -            break;

I think this will then assign an incorrect PCI_INTERRUPT_LINE value to
non root bus devices.

-Kevin

Patch

diff --git a/src/pciinit.c b/src/pciinit.c
index 25b04ac..6a7a0d2 100644
--- a/src/pciinit.c
+++ b/src/pciinit.c
@@ -213,9 +213,6 @@  static void pci_bios_init_devices(void)
 {
     struct pci_device *pci;
     foreachpci(pci) {
-        if (pci_bdf_to_bus(pci->bdf) != 0)
-            // Only init devices on host bus.
-            break;
         pci_bios_init_device(pci);
     }