Skip to content

Commit

Permalink
ice: implement AQ download pkg retry
Browse files Browse the repository at this point in the history
[ Upstream commit a27f6ac ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
WojDrew authored and gregkh committed Jun 27, 2024
1 parent d4090e3 commit d6a44eb
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions drivers/net/ethernet/intel/ice/ice_ddp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,15 +1329,34 @@ ice_dwnld_cfg_bufs_no_lock(struct ice_hw *hw, struct ice_buf *bufs, u32 start,

for (i = 0; i < count; i++) {
bool last = false;
int try_cnt = 0;
int status;

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

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

status = ice_aq_download_pkg(hw, bh, ICE_PKG_BUF_SIZE, last,
&offset, &info, NULL);
while (1) {
status = ice_aq_download_pkg(hw, bh, ICE_PKG_BUF_SIZE,
last, &offset, &info,
NULL);
if (hw->adminq.sq_last_status != ICE_AQ_RC_ENOSEC &&
hw->adminq.sq_last_status != ICE_AQ_RC_EBADSIG)
break;

try_cnt++;

if (try_cnt == 5)
break;

msleep(20);
}

if (try_cnt)
dev_dbg(ice_hw_to_dev(hw),
"ice_aq_download_pkg number of retries: %d\n",
try_cnt);

/* Save AQ status from download package */
if (status) {
Expand Down

0 comments on commit d6a44eb

Please sign in to comment.