• Niklas Schnelle's avatar
    s390/pci: fix zpci_bus_link_virtfn() · 3cddb79a
    Niklas Schnelle authored
    We were missing the pci_dev_put() for candidate PFs.  Furhtermore in
    discussion with upstream it turns out that somewhat counterintuitively
    some common code, in particular the vfio-pci driver, assumes that
    pdev->is_virtfn always implies that pdev->physfn is set, i.e. that VFs
    are always linked.
    While POWER does seem to set pdev->is_virtfn even for unlinked functions
    (see comments in arch/powerpc/kernel/eeh.c:eeh_debugfs_break_device())
    for now just be safe and only set pdev->is_virtfn on linking.
    Also make sure that we only search for parent PFs if the zbus is
    multifunction and we thus know the devfn values supplied by firmware
    come from the RID.
    
    Fixes: e5794cf1 ("s390/pci: create links between PFs and VFs")
    Cc: <stable@vger.kernel.org> # 5.8
    Reviewed-by: default avatarPierre Morel <pmorel@linux.ibm.com>
    Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    3cddb79a
pci_bus.c 7.18 KB