Skip to content

Commit a27f6ac

Browse files
WojDrewanguy11
authored andcommitted
ice: implement AQ download pkg retry
ice_aqc_opc_download_pkg (0x0C40) AQ sporadically returns error due to FW issue. Fix this by retrying five times before moving to Safe Mode. Sleep for 20 ms before retrying. This was tested with the 4.40 firmware. Fixes: c764881 ("ice: Implement Dynamic Device Personalization (DDP) download") Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com> Reviewed-by: Brett Creeley <brett.creeley@amd.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent aeccadb commit a27f6ac

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,15 +1339,34 @@ ice_dwnld_cfg_bufs_no_lock(struct ice_hw *hw, struct ice_buf *bufs, u32 start,
13391339

13401340
for (i = 0; i < count; i++) {
13411341
bool last = false;
1342+
int try_cnt = 0;
13421343
int status;
13431344

13441345
bh = (struct ice_buf_hdr *)(bufs + start + i);
13451346

13461347
if (indicate_last)
13471348
last = ice_is_last_download_buffer(bh, i, count);
13481349

1349-
status = ice_aq_download_pkg(hw, bh, ICE_PKG_BUF_SIZE, last,
1350-
&offset, &info, NULL);
1350+
while (1) {
1351+
status = ice_aq_download_pkg(hw, bh, ICE_PKG_BUF_SIZE,
1352+
last, &offset, &info,
1353+
NULL);
1354+
if (hw->adminq.sq_last_status != ICE_AQ_RC_ENOSEC &&
1355+
hw->adminq.sq_last_status != ICE_AQ_RC_EBADSIG)
1356+
break;
1357+
1358+
try_cnt++;
1359+
1360+
if (try_cnt == 5)
1361+
break;
1362+
1363+
msleep(20);
1364+
}
1365+
1366+
if (try_cnt)
1367+
dev_dbg(ice_hw_to_dev(hw),
1368+
"ice_aq_download_pkg number of retries: %d\n",
1369+
try_cnt);
13511370

13521371
/* Save AQ status from download package */
13531372
if (status) {

0 commit comments

Comments
 (0)