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

David Gibson dgibson at redhat.com
Mon Sep 14 09:45:00 AEST 2015


On Fri, 11 Sep 2015 18:48:19 +0200
Laurent Vivier <lvivier at redhat.com> wrote:

> 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>

Actually, I think the safer fix is just for SLOF not to touch the
ibm,my-drc-index property if it's already present.  QEMU is already
setting it correctly, and SLOF is overwriting it  :(.

Adding Mike Roth to CC, since git blame says he wrote this bit of SLOF
code.

>  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
> 


-- 
David Gibson <dgibson at redhat.com>
Senior Software Engineer, Virtualization, Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ozlabs.org/pipermail/slof/attachments/20150914/7db69b04/attachment.sig>


More information about the SLOF mailing list