aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci_dn.c
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2019-08-21 16:26:55 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2020-01-23 21:31:19 +1100
commita4af49f34f76f1e6125b22b50d18580426d935e0 (patch)
treef6cd29095f06bbe30da02b49132ff0dbf444e11a /arch/powerpc/kernel/pci_dn.c
parentpowerpc/pcidn: Make VF pci_dn management CONFIG_PCI_IOV specific (diff)
downloadlinux-dev-a4af49f34f76f1e6125b22b50d18580426d935e0.tar.xz
linux-dev-a4af49f34f76f1e6125b22b50d18580426d935e0.zip
powerpc/pcidn: Warn when sriov pci_dn management is used incorrectly
These functions can only be used on a SR-IOV capable physical function and they're only called in pcibios_sriov_enable / disable. Make them emit a warning in the future if they're used incorrectly and remove the dead code that checks if the device is a VF. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Sam Bobroff <sbobroff@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190821062655.19735-3-oohall@gmail.com
Diffstat (limited to '')
-rw-r--r--arch/powerpc/kernel/pci_dn.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index c158ac897efb..4e654df55969 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -158,8 +158,8 @@ struct pci_dn *add_sriov_vf_pdns(struct pci_dev *pdev)
int i;
/* Only support IOV for now */
- if (!pdev->is_physfn)
- return pci_get_pdn(pdev);
+ if (WARN_ON(!pdev->is_physfn))
+ return NULL;
/* Check if VFs have been populated */
pdn = pci_get_pdn(pdev);
@@ -199,19 +199,8 @@ void remove_sriov_vf_pdns(struct pci_dev *pdev)
struct pci_dn *pdn, *tmp;
int i;
- /*
- * VF and VF PE are created/released dynamically, so we need to
- * bind/unbind them. Otherwise the VF and VF PE would be mismatched
- * when re-enabling SR-IOV.
- */
- if (pdev->is_virtfn) {
- pdn = pci_get_pdn(pdev);
- pdn->pe_number = IODA_INVALID_PE;
- return;
- }
-
/* Only support IOV PF for now */
- if (!pdev->is_physfn)
+ if (WARN_ON(!pdev->is_physfn))
return;
/* Check if VFs have been populated */