diff options
author | Pierre Morel <pmorel@linux.ibm.com> | 2020-03-26 17:07:03 +0100 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2020-04-28 13:49:47 +0200 |
commit | 53dd462ac4dc3fc61ee90ad03d96202e17589156 (patch) | |
tree | b040b53cb1f28c85ec3561ba928a2848d9a76695 /drivers/pci | |
parent | s390/pci: Handling multifunctions (diff) | |
download | linux-53dd462ac4dc3fc61ee90ad03d96202e17589156.tar.xz linux-53dd462ac4dc3fc61ee90ad03d96202e17589156.zip |
s390/pci: Do not disable PF when VFs exist
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>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/s390_pci_hpc.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; + pci_stop_and_remove_bus_device_locked(pdev); pci_dev_put(pdev); } |