diff options
author | Jakub Kicinski <kuba@kernel.org> | 2023-08-09 02:41:30 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-08-09 02:41:30 +0300 |
commit | 1c2c8c3517b3ba43a964afe1ff7926b13dc51492 (patch) | |
tree | 0447825e51e86eaddc6bd0c20bf2e024b191bc29 /drivers/net/ethernet/intel/ice/ice_main.c | |
parent | f5f502a3ea349bc549dd42fb2aca7daaccc9bd03 (diff) | |
parent | b6143c9b073fb321d948b6647065748337918dd8 (diff) | |
download | linux-1c2c8c3517b3ba43a964afe1ff7926b13dc51492.tar.xz |
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says:
====================
Intel Wired LAN Driver Updates 2023-08-07 (ice)
This series contains updates to ice driver only.
Wojciech allows for LAG interfaces to be used for bridge offloads.
Marcin tracks additional metadata for filtering rules to aid in proper
differentiation of similar rules. He also renames some flags that
do not entirely describe their representation.
Karol and Jan add additional waiting for firmware load on devices that
require it.
Przemek refactors RSS implementation to clarify/simplify configurations.
* '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
ice: clean up __ice_aq_get_set_rss_lut()
ice: add FW load wait
ice: Add get C827 PHY index function
ice: Rename enum ice_pkt_flags values
ice: Add direction metadata
ice: Accept LAG netdevs in bridge offloads
====================
Link: https://lore.kernel.org/r/20230807204835.3129164-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_main.c')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_main.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 2e80d5cd9f56..0f04347eda39 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -4520,6 +4520,31 @@ static void ice_deinit_eth(struct ice_pf *pf) ice_decfg_netdev(vsi); } +/** + * ice_wait_for_fw - wait for full FW readiness + * @hw: pointer to the hardware structure + * @timeout: milliseconds that can elapse before timing out + */ +static int ice_wait_for_fw(struct ice_hw *hw, u32 timeout) +{ + int fw_loading; + u32 elapsed = 0; + + while (elapsed <= timeout) { + fw_loading = rd32(hw, GL_MNG_FWSM) & GL_MNG_FWSM_FW_LOADING_M; + + /* firmware was not yet loaded, we have to wait more */ + if (fw_loading) { + elapsed += 100; + msleep(100); + continue; + } + return 0; + } + + return -ETIMEDOUT; +} + static int ice_init_dev(struct ice_pf *pf) { struct device *dev = ice_pf_to_dev(pf); @@ -4532,6 +4557,18 @@ static int ice_init_dev(struct ice_pf *pf) return err; } + /* Some cards require longer initialization times + * due to necessity of loading FW from an external source. + * This can take even half a minute. + */ + if (ice_is_pf_c827(hw)) { + err = ice_wait_for_fw(hw, 30000); + if (err) { + dev_err(dev, "ice_wait_for_fw timed out"); + return err; + } + } + ice_init_feature_support(pf); ice_request_fw(pf); |