Skip to content

Commit 03e7e72

Browse files
committed
Merge branch '100GbE' of https://github.com/anguy11/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2020-09-30 This series contains updates to ice driver only. Jake increases the wait time for firmware response as it can take longer than the current wait time. Preserves the NVM capabilities of the device in safe mode so the device reports its NVM update capabilities properly when in this state. v2: Added cover letter ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 1f25c9b + be49b1a commit 03e7e72

File tree

2 files changed

+35
-24
lines changed

2 files changed

+35
-24
lines changed

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,26 +2288,28 @@ void ice_set_safe_mode_caps(struct ice_hw *hw)
22882288
{
22892289
struct ice_hw_func_caps *func_caps = &hw->func_caps;
22902290
struct ice_hw_dev_caps *dev_caps = &hw->dev_caps;
2291-
u32 valid_func, rxq_first_id, txq_first_id;
2292-
u32 msix_vector_first_id, max_mtu;
2291+
struct ice_hw_common_caps cached_caps;
22932292
u32 num_funcs;
22942293

22952294
/* cache some func_caps values that should be restored after memset */
2296-
valid_func = func_caps->common_cap.valid_functions;
2297-
txq_first_id = func_caps->common_cap.txq_first_id;
2298-
rxq_first_id = func_caps->common_cap.rxq_first_id;
2299-
msix_vector_first_id = func_caps->common_cap.msix_vector_first_id;
2300-
max_mtu = func_caps->common_cap.max_mtu;
2295+
cached_caps = func_caps->common_cap;
23012296

23022297
/* unset func capabilities */
23032298
memset(func_caps, 0, sizeof(*func_caps));
23042299

2300+
#define ICE_RESTORE_FUNC_CAP(name) \
2301+
func_caps->common_cap.name = cached_caps.name
2302+
23052303
/* restore cached values */
2306-
func_caps->common_cap.valid_functions = valid_func;
2307-
func_caps->common_cap.txq_first_id = txq_first_id;
2308-
func_caps->common_cap.rxq_first_id = rxq_first_id;
2309-
func_caps->common_cap.msix_vector_first_id = msix_vector_first_id;
2310-
func_caps->common_cap.max_mtu = max_mtu;
2304+
ICE_RESTORE_FUNC_CAP(valid_functions);
2305+
ICE_RESTORE_FUNC_CAP(txq_first_id);
2306+
ICE_RESTORE_FUNC_CAP(rxq_first_id);
2307+
ICE_RESTORE_FUNC_CAP(msix_vector_first_id);
2308+
ICE_RESTORE_FUNC_CAP(max_mtu);
2309+
ICE_RESTORE_FUNC_CAP(nvm_unified_update);
2310+
ICE_RESTORE_FUNC_CAP(nvm_update_pending_nvm);
2311+
ICE_RESTORE_FUNC_CAP(nvm_update_pending_orom);
2312+
ICE_RESTORE_FUNC_CAP(nvm_update_pending_netlist);
23112313

23122314
/* one Tx and one Rx queue in safe mode */
23132315
func_caps->common_cap.num_rxq = 1;
@@ -2318,22 +2320,25 @@ void ice_set_safe_mode_caps(struct ice_hw *hw)
23182320
func_caps->guar_num_vsi = 1;
23192321

23202322
/* cache some dev_caps values that should be restored after memset */
2321-
valid_func = dev_caps->common_cap.valid_functions;
2322-
txq_first_id = dev_caps->common_cap.txq_first_id;
2323-
rxq_first_id = dev_caps->common_cap.rxq_first_id;
2324-
msix_vector_first_id = dev_caps->common_cap.msix_vector_first_id;
2325-
max_mtu = dev_caps->common_cap.max_mtu;
2323+
cached_caps = dev_caps->common_cap;
23262324
num_funcs = dev_caps->num_funcs;
23272325

23282326
/* unset dev capabilities */
23292327
memset(dev_caps, 0, sizeof(*dev_caps));
23302328

2329+
#define ICE_RESTORE_DEV_CAP(name) \
2330+
dev_caps->common_cap.name = cached_caps.name
2331+
23312332
/* restore cached values */
2332-
dev_caps->common_cap.valid_functions = valid_func;
2333-
dev_caps->common_cap.txq_first_id = txq_first_id;
2334-
dev_caps->common_cap.rxq_first_id = rxq_first_id;
2335-
dev_caps->common_cap.msix_vector_first_id = msix_vector_first_id;
2336-
dev_caps->common_cap.max_mtu = max_mtu;
2333+
ICE_RESTORE_DEV_CAP(valid_functions);
2334+
ICE_RESTORE_DEV_CAP(txq_first_id);
2335+
ICE_RESTORE_DEV_CAP(rxq_first_id);
2336+
ICE_RESTORE_DEV_CAP(msix_vector_first_id);
2337+
ICE_RESTORE_DEV_CAP(max_mtu);
2338+
ICE_RESTORE_DEV_CAP(nvm_unified_update);
2339+
ICE_RESTORE_DEV_CAP(nvm_update_pending_nvm);
2340+
ICE_RESTORE_DEV_CAP(nvm_update_pending_orom);
2341+
ICE_RESTORE_DEV_CAP(nvm_update_pending_netlist);
23372342
dev_caps->num_funcs = num_funcs;
23382343

23392344
/* one Tx and one Rx queue per function in safe mode */

drivers/net/ethernet/intel/ice/ice_fw_update.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,13 @@ ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
289289
return -EIO;
290290
}
291291

292-
err = ice_aq_wait_for_event(pf, ice_aqc_opc_nvm_write, HZ, &event);
292+
/* In most cases, firmware reports a write completion within a few
293+
* milliseconds. However, it has been observed that a completion might
294+
* take more than a second to complete in some cases. The timeout here
295+
* is conservative and is intended to prevent failure to update when
296+
* firmware is slow to respond.
297+
*/
298+
err = ice_aq_wait_for_event(pf, ice_aqc_opc_nvm_write, 15 * HZ, &event);
293299
if (err) {
294300
dev_err(dev, "Timed out waiting for firmware write completion for module 0x%02x, err %d\n",
295301
module, err);
@@ -513,7 +519,7 @@ static int ice_switch_flash_banks(struct ice_pf *pf, u8 activate_flags,
513519
return -EIO;
514520
}
515521

516-
err = ice_aq_wait_for_event(pf, ice_aqc_opc_nvm_write_activate, HZ,
522+
err = ice_aq_wait_for_event(pf, ice_aqc_opc_nvm_write_activate, 30 * HZ,
517523
&event);
518524
if (err) {
519525
dev_err(dev, "Timed out waiting for firmware to switch active flash banks, err %d\n",

0 commit comments

Comments
 (0)