diff mbox series

[SRU,F,10/12] s390/pci: Do not disable PF when VFs exist

Message ID 20200518182438.392269-11-frank.heimes@canonical.com
State New
Headers show
Series s390x/pci: enumerate pci functions per physical adapter (LP: 1874056) | expand

Commit Message

Frank Heimes May 18, 2020, 6:24 p.m. UTC
From: Pierre Morel <pmorel@linux.ibm.com>

BugLink: https://bugs.launchpad.net/bugs/1874056

The Physical function should not be disabled until no virtual
functions depends on it.
Let's force the user to first use echo 0 > sriov_numfs before
allowing to disable the PF with echo 0 > power.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
(backported from commit 53dd462ac4dc3fc61ee90ad03d96202e17589156)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
 drivers/pci/hotplug/s390_pci_hpc.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series


diff --git a/drivers/pci/hotplug/s390_pci_hpc.c b/drivers/pci/hotplug/s390_pci_hpc.c
index 1579ba895edf..b59f84918fe0 100644
--- a/drivers/pci/hotplug/s390_pci_hpc.c
+++ b/drivers/pci/hotplug/s390_pci_hpc.c
@@ -91,6 +91,9 @@  static int disable_slot(struct hotplug_slot *hotplug_slot)
 	pdev = pci_get_slot(zbus->bus, zdev->devfn);
 	if (pdev) {
+		if (pci_num_vf(pdev))
+			return -EBUSY;