net/ice/base: give time for package download after PF reset
[dpdk.git] / drivers / net / ice / base / ice_common.c
index 908ef90..a617643 100644 (file)
@@ -912,7 +912,12 @@ static enum ice_status ice_pf_reset(struct ice_hw *hw)
 
        wr32(hw, PFGEN_CTRL, (reg | PFGEN_CTRL_PFSWR_M));
 
-       for (cnt = 0; cnt < ICE_PF_RESET_WAIT_COUNT; cnt++) {
+       /* Wait for the PFR to complete. The wait time is the global config lock
+        * timeout plus the PFR timeout which will account for a possible reset
+        * that is occurring during a download package operation.
+        */
+       for (cnt = 0; cnt < ICE_GLOBAL_CFG_LOCK_TIMEOUT +
+            ICE_PF_RESET_WAIT_COUNT; cnt++) {
                reg = rd32(hw, PFGEN_CTRL);
                if (!(reg & PFGEN_CTRL_PFSWR_M))
                        break;
@@ -2762,6 +2767,9 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,
        if (status)
                goto out;
 
+       cfg->caps |= (pcaps->caps & ICE_AQC_PHY_EN_AUTO_FEC);
+       cfg->link_fec_opt = pcaps->link_fec_options;
+
        switch (fec) {
        case ICE_FEC_BASER:
                /* Clear RS bits, and AND BASE-R ability