]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/pci: Fix zpci_bus_is_isolated_vf() for non-VFs
authorNiklas Schnelle <schnelle@linux.ibm.com>
Thu, 20 Mar 2025 16:26:12 +0000 (17:26 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 31 Mar 2025 10:20:39 +0000 (12:20 +0200)
For non-VFs, zpci_bus_is_isolated_vf() should return false because they
aren't VFs. While zpci_iov_find_parent_pf() specifically checks if
a function is a VF, it then simply returns that there is no parent. The
simplistic check for a parent then leads to these functions being
confused with isolated VFs and isolating them on their own domain even
if sibling PFs should share the domain.

Fix this by explicitly checking if a function is not a VF. Note also
that at this point the case where RIDs are ignored is already handled
and in this case all PCI functions get isolated by being detected in
zpci_bus_is_multifunction_root().

Cc: stable@vger.kernel.org
Fixes: 2844ddbd540f ("s390/pci: Fix handling of isolated VFs")
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/pci/pci_bus.c

index 0e725039861f92925a38f7ff7cb6de6b0d965ac3..4d45edb026f2c8ccfb2c330f4ca36fbe03d1f181 100644 (file)
@@ -360,6 +360,9 @@ static bool zpci_bus_is_isolated_vf(struct zpci_bus *zbus, struct zpci_dev *zdev
 {
        struct pci_dev *pdev;
 
+       if (!zdev->vfn)
+               return false;
+
        pdev = zpci_iov_find_parent_pf(zbus, zdev);
        if (!pdev)
                return true;