]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/net/ethernet/intel/fm10k/fm10k_pf.c
fm10k: Only trigger data path reset if fabric is up
[mirror_ubuntu-bionic-kernel.git] / drivers / net / ethernet / intel / fm10k / fm10k_pf.c
index 3ca0233b3ea23682c23126bc24357629e3a4eb9a..d806d87a6192033e100e1e5426db5114429a67e1 100644 (file)
@@ -59,6 +59,11 @@ static s32 fm10k_reset_hw_pf(struct fm10k_hw *hw)
        if (reg & (FM10K_DMA_CTRL_TX_ACTIVE | FM10K_DMA_CTRL_RX_ACTIVE))
                return FM10K_ERR_DMA_PENDING;
 
+       /* verify the switch is ready for reset */
+       reg = fm10k_read_reg(hw, FM10K_DMA_CTRL2);
+       if (!(reg & FM10K_DMA_CTRL2_SWITCH_READY))
+               goto out;
+
        /* Inititate data path reset */
        reg |= FM10K_DMA_CTRL_DATAPATH_RESET;
        fm10k_write_reg(hw, FM10K_DMA_CTRL, reg);
@@ -72,6 +77,7 @@ static s32 fm10k_reset_hw_pf(struct fm10k_hw *hw)
        if (!(reg & FM10K_IP_NOTINRESET))
                err = FM10K_ERR_RESET_FAILED;
 
+out:
        return err;
 }
 
@@ -184,19 +190,6 @@ static s32 fm10k_init_hw_pf(struct fm10k_hw *hw)
        return 0;
 }
 
-/**
- *  fm10k_is_slot_appropriate_pf - Indicate appropriate slot for this SKU
- *  @hw: pointer to hardware structure
- *
- *  Looks at the PCIe bus info to confirm whether or not this slot can support
- *  the necessary bandwidth for this device.
- **/
-static bool fm10k_is_slot_appropriate_pf(struct fm10k_hw *hw)
-{
-       return (hw->bus.speed == hw->bus_caps.speed) &&
-              (hw->bus.width == hw->bus_caps.width);
-}
-
 /**
  *  fm10k_update_vlan_pf - Update status of VLAN ID in VLAN filter table
  *  @hw: pointer to hardware structure
@@ -1849,7 +1842,6 @@ static struct fm10k_mac_ops mac_ops_pf = {
        .init_hw                = &fm10k_init_hw_pf,
        .start_hw               = &fm10k_start_hw_generic,
        .stop_hw                = &fm10k_stop_hw_generic,
-       .is_slot_appropriate    = &fm10k_is_slot_appropriate_pf,
        .update_vlan            = &fm10k_update_vlan_pf,
        .read_mac_addr          = &fm10k_read_mac_addr_pf,
        .update_uc_addr         = &fm10k_update_uc_addr_pf,