aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-04-14 15:11:28 -0400
committerBjorn Helgaas <bhelgaas@google.com>2017-04-27 12:46:50 -0400
commit63af8f7a8293b94787763c933abfd21ba852807f (patch)
treef35ba6347a20ade83f3ef0bb3a467e4593f6f669
parent21c433a74b6b94538d01ea18d66195018136efd6 (diff)
ixgbe: Use pcie_flr() instead of duplicating it
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index a7a430a7be2c..543ddde5f8e2 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7112,18 +7112,6 @@ static void ixgbe_watchdog_flush_tx(struct ixgbe_adapter *adapter)
7112} 7112}
7113 7113
7114#ifdef CONFIG_PCI_IOV 7114#ifdef CONFIG_PCI_IOV
7115static inline void ixgbe_issue_vf_flr(struct ixgbe_adapter *adapter,
7116 struct pci_dev *vfdev)
7117{
7118 if (!pci_wait_for_pending_transaction(vfdev))
7119 e_dev_warn("Issuing VFLR with pending transactions\n");
7120
7121 e_dev_err("Issuing VFLR for VF %s\n", pci_name(vfdev));
7122 pcie_capability_set_word(vfdev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR);
7123
7124 msleep(100);
7125}
7126
7127static void ixgbe_check_for_bad_vf(struct ixgbe_adapter *adapter) 7115static void ixgbe_check_for_bad_vf(struct ixgbe_adapter *adapter)
7128{ 7116{
7129 struct ixgbe_hw *hw = &adapter->hw; 7117 struct ixgbe_hw *hw = &adapter->hw;
@@ -7156,7 +7144,7 @@ static void ixgbe_check_for_bad_vf(struct ixgbe_adapter *adapter)
7156 pci_read_config_word(vfdev, PCI_STATUS, &status_reg); 7144 pci_read_config_word(vfdev, PCI_STATUS, &status_reg);
7157 if (status_reg != IXGBE_FAILED_READ_CFG_WORD && 7145 if (status_reg != IXGBE_FAILED_READ_CFG_WORD &&
7158 status_reg & PCI_STATUS_REC_MASTER_ABORT) 7146 status_reg & PCI_STATUS_REC_MASTER_ABORT)
7159 ixgbe_issue_vf_flr(adapter, vfdev); 7147 pcie_flr(vfdev);
7160 } 7148 }
7161} 7149}
7162 7150
@@ -10244,7 +10232,7 @@ static pci_ers_result_t ixgbe_io_error_detected(struct pci_dev *pdev,
10244 * VFLR. Just clean up the AER in that case. 10232 * VFLR. Just clean up the AER in that case.
10245 */ 10233 */
10246 if (vfdev) { 10234 if (vfdev) {
10247 ixgbe_issue_vf_flr(adapter, vfdev); 10235 pcie_flr(vfdev);
10248 /* Free device reference count */ 10236 /* Free device reference count */
10249 pci_dev_put(vfdev); 10237 pci_dev_put(vfdev);
10250 } 10238 }