From patchwork Thu Jun 13 15:45:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 13697069 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42E1614B94F for ; Thu, 13 Jun 2024 15:45:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718293526; cv=none; b=dXMySJvXjUA+F2ecvnQRAuGmhl72dXmV27D8QiqlthFf78eO+w6wdZT2vkiTaR+0QHQ60kzwiYrhKIGvBG/Iix8zhHQ5sdVT+pT70BIY/L8+ieRSHBq9AWNLCZO2OyzA0aeST2bBKGbsy8CnssSdzV7JjXeYwtsquBsiIsMv2gE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718293526; c=relaxed/simple; bh=Kzn4+5NYzf3vBoHKEY1YRsaK1lMRlsJAo/vlsKmp0SY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OI68ocvZOuIdLzf19cFM2sAWTqpfcrLehzehzgDS130W90BkTWww/FuHMPqcwgVgzWDu9HAZmpXlA0GFRnB6SeBDVsACDAoksQVjWfr0guVkcxL9s1wy4eocfz860J/jy4s6+bt6YW4jz8M/2uGA4oZTHkiMbLnrR7V/WkrAjPQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=NuKZuAak; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NuKZuAak" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718293525; x=1749829525; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Kzn4+5NYzf3vBoHKEY1YRsaK1lMRlsJAo/vlsKmp0SY=; b=NuKZuAakpjhder08Q08CrKy8Ec056da1l1LvrZ+EOtG17f2hcVq0lhRi AueAwsHg3OqCTxn3S0iH00lFYurQJaJkj3u5j8lHjvSHXmdMSRiLBOt3A DbMJg/KxcDwtKAOyfZ3Esa1+L8PvtOGEbBuyeilbN1Uk6vi0oz/yjnyXS U+VBECRShMkak31PYcHU2Crg2Pik8NAZgT1wSuKVqx9NadXEXVfzQ2ugw 9AQWXjgESn6WEUH6Nhdbwqu+67PzmiOwnvBqC2+7HJZmjhnCylHpqgTTW 0EyMFEaFPPN8nNroYEIFB9tzM8JrEo6rmt2P+QfkERIOOFn9rT1KdUmR6 Q==; X-CSE-ConnectionGUID: eGpDUcPXST27ZQ1YJ9h3Xw== X-CSE-MsgGUID: 6dGuWmYRS6CdVUJJGJWreA== X-IronPort-AV: E=McAfee;i="6700,10204,11102"; a="37645771" X-IronPort-AV: E=Sophos;i="6.08,235,1712646000"; d="scan'208";a="37645771" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2024 08:45:22 -0700 X-CSE-ConnectionGUID: d/ju/p1kRNe2GNP0XIsPiw== X-CSE-MsgGUID: alKR7UHyT2i7WSzyMb9VIA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,235,1712646000"; d="scan'208";a="40124498" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by orviesa010.jf.intel.com with ESMTP; 13 Jun 2024 08:45:22 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org Cc: Wojciech Drewek , anthony.l.nguyen@intel.com, Michal Swiatkowski , Brett Creeley , Przemek Kitszel , Pucha Himasekhar Reddy Subject: [PATCH net v2 3/3] ice: implement AQ download pkg retry Date: Thu, 13 Jun 2024 08:45:10 -0700 Message-ID: <20240613154514.1948785-4-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240613154514.1948785-1-anthony.l.nguyen@intel.com> References: <20240613154514.1948785-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Wojciech Drewek 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: c76488109616 ("ice: Implement Dynamic Device Personalization (DDP) download") Reviewed-by: Michal Swiatkowski Signed-off-by: Wojciech Drewek Reviewed-by: Brett Creeley Reviewed-by: Przemek Kitszel Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ice/ice_ddp.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ddp.c b/drivers/net/ethernet/intel/ice/ice_ddp.c index ce5034ed2b24..f182179529b7 100644 --- a/drivers/net/ethernet/intel/ice/ice_ddp.c +++ b/drivers/net/ethernet/intel/ice/ice_ddp.c @@ -1339,6 +1339,7 @@ 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); @@ -1346,8 +1347,26 @@ ice_dwnld_cfg_bufs_no_lock(struct ice_hw *hw, struct ice_buf *bufs, u32 start, 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) {