[SLOF] [PATCH] Correctly set ibm,my-drc-index

Laurent Vivier lvivier at redhat.com
Sat Sep 12 02:48:19 AEST 2015


The current calculation of DRC index for PCI card doesn't take
into account the PHB bridge index, so with several bridges we
can have several devices with the same DRC index.

This is a problem when we want to unplug a PCI card with
drmgr which is based on the DRC index.

Signed-off-by: Laurent Vivier <lvivier at redhat.com>
---
 slof/fs/pci-properties.fs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/slof/fs/pci-properties.fs b/slof/fs/pci-properties.fs
index 4f13402..d132426 100644
--- a/slof/fs/pci-properties.fs
+++ b/slof/fs/pci-properties.fs
@@ -599,9 +599,10 @@
         pci-reg-props
         pci-hotplug-enabled IF
             \ QEMU uses static assignments for my-drc-index:
-            \ 40000000h + $bus << 8 + $slot << 3
+            \ 40000000h + $phbindex << 16 + $bus << 8 + $slot << 3
             dup dup pci-addr2bus 8 lshift
             swap pci-addr2dev 3 lshift or
+            puid ff and 10 lshift or
             40000000 + encode-int s" ibm,my-drc-index" property
             \ QEMU uses "Slot $bus*32$slotno" for loc-code
             dup dup pci-addr2bus 20 *
-- 
2.1.0



More information about the SLOF mailing list