[SLOF] [PATCH] pci-phb: Set correct pci-bus-number while walking PCI bridges

Thomas Huth thuth at redhat.com
Mon Jun 12 19:50:59 AEST 2017

Commit e44b7f07 ("Fix secondary and subordinate PCI bus enumeration")
created a board-qemu specific version of the pci-bridge-probe function
to fix problems with the secondary and  subordinate bus number
registers. Unfortunately, this function missed to update the
pci-bus-number variable like the original pci-bridge-probe function
did it, so that new bridges currently end up with a bad "my-bus"
setting (which is initialized from the pci-bus-number variable)
and thus things that depend on this setting, like the "decode-unit"
function currently don't work as expected on these PCI bridges.
Fix it by initializing the pci-bus-number from the PCI config
space settings that is provided by QEMU.

Fixes: e44b7f074f549f78303ad4d67d39b18db93d11bf
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1459755
Signed-off-by: Thomas Huth <thuth at redhat.com>
 board-qemu/slof/pci-phb.fs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board-qemu/slof/pci-phb.fs b/board-qemu/slof/pci-phb.fs
index 6dfb2e6..b7bf9cf 100644
--- a/board-qemu/slof/pci-phb.fs
+++ b/board-qemu/slof/pci-phb.fs
@@ -309,6 +309,7 @@ setup-puid
 : phb-pci-bridge-probe ( addr -- )
     dup pci-bridge-set-bases                      \ Set up all Base Registers
     dup func-pci-bridge-range-props               \ Set up temporary "range"
+    my-space pci-bus-scnd@ TO pci-bus-number      \ Set correct current bus number
     pci-device-vec-len 1+ TO pci-device-vec-len   \ increase the device-slot vector depth
     pci-enable                                    \ enable mem/IO transactions
     phb-pci-walk-bridge                           \ and walk the secondary bus

More information about the SLOF mailing list