liquidio: use pcie_flr instead of duplicating it
authorChristoph Hellwig <hch@lst.de>
Tue, 16 May 2017 14:21:46 +0000 (16:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 May 2017 19:59:35 +0000 (15:59 -0400)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c

index 34c77821fad9f2a49d49841bef2b0c601ca402aa..d51c8d8d9a35fcb6554a591b0daf7d3d672d2289 100644 (file)
@@ -879,8 +879,6 @@ liquidio_vf_probe(struct pci_dev *pdev,
  */
 static void octeon_pci_flr(struct octeon_device *oct)
 {
-       u16 status;
-
        pci_save_state(oct->pci_dev);
 
        pci_cfg_access_lock(oct->pci_dev);
@@ -889,20 +887,7 @@ static void octeon_pci_flr(struct octeon_device *oct)
        pci_write_config_word(oct->pci_dev, PCI_COMMAND,
                              PCI_COMMAND_INTX_DISABLE);
 
-       /* Wait for Transaction Pending bit clean */
-       msleep(100);
-       pcie_capability_read_word(oct->pci_dev, PCI_EXP_DEVSTA, &status);
-       if (status & PCI_EXP_DEVSTA_TRPND) {
-               dev_info(&oct->pci_dev->dev, "Function reset incomplete after 100ms, sleeping for 5 seconds\n");
-               ssleep(5);
-               pcie_capability_read_word(oct->pci_dev, PCI_EXP_DEVSTA,
-                                         &status);
-               if (status & PCI_EXP_DEVSTA_TRPND)
-                       dev_info(&oct->pci_dev->dev, "Function reset still incomplete after 5s, reset anyway\n");
-       }
-       pcie_capability_set_word(oct->pci_dev, PCI_EXP_DEVCTL,
-                                PCI_EXP_DEVCTL_BCR_FLR);
-       mdelay(100);
+       pcie_flr(oct->pci_dev);
 
        pci_cfg_access_unlock(oct->pci_dev);