Commit c4e43e14 authored by Ganesh Goudar's avatar Ganesh Goudar Committed by David S. Miller

cxgb4: free up resources of pf 0-3

free pf 0-3 resources, commit baf50868 ("cxgb4:
restructure VF mgmt code") erroneously removed the
code which frees the pf 0-3 resources, causing the
probe of pf 0-3 to fail in case of driver reload.

Fixes: baf50868 ("cxgb4: restructure VF mgmt code")
Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a8c6db1d
...@@ -4982,9 +4982,10 @@ static int cxgb4_iov_configure(struct pci_dev *pdev, int num_vfs) ...@@ -4982,9 +4982,10 @@ static int cxgb4_iov_configure(struct pci_dev *pdev, int num_vfs)
pcie_fw = readl(adap->regs + PCIE_FW_A); pcie_fw = readl(adap->regs + PCIE_FW_A);
/* Check if cxgb4 is the MASTER and fw is initialized */ /* Check if cxgb4 is the MASTER and fw is initialized */
if (!(pcie_fw & PCIE_FW_INIT_F) || if (num_vfs &&
(!(pcie_fw & PCIE_FW_INIT_F) ||
!(pcie_fw & PCIE_FW_MASTER_VLD_F) || !(pcie_fw & PCIE_FW_MASTER_VLD_F) ||
PCIE_FW_MASTER_G(pcie_fw) != CXGB4_UNIFIED_PF) { PCIE_FW_MASTER_G(pcie_fw) != CXGB4_UNIFIED_PF)) {
dev_warn(&pdev->dev, dev_warn(&pdev->dev,
"cxgb4 driver needs to be MASTER to support SRIOV\n"); "cxgb4 driver needs to be MASTER to support SRIOV\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -5599,9 +5600,15 @@ static void remove_one(struct pci_dev *pdev) ...@@ -5599,9 +5600,15 @@ static void remove_one(struct pci_dev *pdev)
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
t4_cleanup_clip_tbl(adapter); t4_cleanup_clip_tbl(adapter);
#endif #endif
iounmap(adapter->regs);
if (!is_t4(adapter->params.chip)) if (!is_t4(adapter->params.chip))
iounmap(adapter->bar2); iounmap(adapter->bar2);
}
#ifdef CONFIG_PCI_IOV
else {
cxgb4_iov_configure(adapter->pdev, 0);
}
#endif
iounmap(adapter->regs);
pci_disable_pcie_error_reporting(pdev); pci_disable_pcie_error_reporting(pdev);
if ((adapter->flags & DEV_ENABLED)) { if ((adapter->flags & DEV_ENABLED)) {
pci_disable_device(pdev); pci_disable_device(pdev);
...@@ -5611,12 +5618,6 @@ static void remove_one(struct pci_dev *pdev) ...@@ -5611,12 +5618,6 @@ static void remove_one(struct pci_dev *pdev)
kfree(adapter->mbox_log); kfree(adapter->mbox_log);
synchronize_rcu(); synchronize_rcu();
kfree(adapter); kfree(adapter);
}
#ifdef CONFIG_PCI_IOV
else {
cxgb4_iov_configure(adapter->pdev, 0);
}
#endif
} }
/* "Shutdown" quiesces the device, stopping Ingress Packet and Interrupt /* "Shutdown" quiesces the device, stopping Ingress Packet and Interrupt
......
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