Commit fac248f8 authored by Oliver O'Halloran's avatar Oliver O'Halloran Committed by Michael Ellerman

powerpc/powernv/sriov: Rename truncate_iov

This prevents SR-IOV being used by making the SR-IOV BAR resources
unallocatable. Rename it to reflect what it actually does.
Signed-off-by: default avatarOliver O'Halloran <oohall@gmail.com>
Reviewed-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200722065715.1432738-7-oohall@gmail.com
parent ff79e11a
...@@ -155,7 +155,7 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev) ...@@ -155,7 +155,7 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev)
iov = kzalloc(sizeof(*iov), GFP_KERNEL); iov = kzalloc(sizeof(*iov), GFP_KERNEL);
if (!iov) if (!iov)
goto truncate_iov; goto disable_iov;
pdev->dev.archdata.iov_data = iov; pdev->dev.archdata.iov_data = iov;
total_vfs = pci_sriov_get_totalvfs(pdev); total_vfs = pci_sriov_get_totalvfs(pdev);
...@@ -169,7 +169,7 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev) ...@@ -169,7 +169,7 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev)
if (!pnv_pci_is_m64_flags(res->flags)) { if (!pnv_pci_is_m64_flags(res->flags)) {
dev_warn(&pdev->dev, "Don't support SR-IOV with non M64 VF BAR%d: %pR. \n", dev_warn(&pdev->dev, "Don't support SR-IOV with non M64 VF BAR%d: %pR. \n",
i, res); i, res);
goto truncate_iov; goto disable_iov;
} }
total_vf_bar_sz += pci_iov_resource_size(pdev, total_vf_bar_sz += pci_iov_resource_size(pdev,
...@@ -208,7 +208,8 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev) ...@@ -208,7 +208,8 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev)
* mode is 32MB. * mode is 32MB.
*/ */
if (iov->m64_single_mode && (size < SZ_32M)) if (iov->m64_single_mode && (size < SZ_32M))
goto truncate_iov; goto disable_iov;
dev_dbg(&pdev->dev, " Fixing VF BAR%d: %pR to\n", i, res); dev_dbg(&pdev->dev, " Fixing VF BAR%d: %pR to\n", i, res);
res->end = res->start + size * mul - 1; res->end = res->start + size * mul - 1;
dev_dbg(&pdev->dev, " %pR\n", res); dev_dbg(&pdev->dev, " %pR\n", res);
...@@ -219,8 +220,8 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev) ...@@ -219,8 +220,8 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev)
return; return;
truncate_iov: disable_iov:
/* To save MMIO space, IOV BAR is truncated. */ /* Save ourselves some MMIO space by disabling the unusable BARs */
for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) { for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
res = &pdev->resource[i + PCI_IOV_RESOURCES]; res = &pdev->resource[i + PCI_IOV_RESOURCES];
res->flags = 0; res->flags = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment