diff mbox series

[iwl-net,v3] ice: implement AQ download pkg retry

Message ID 20240531093206.714632-1-wojciech.drewek@intel.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [iwl-net,v3] ice: implement AQ download pkg retry | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 902 this patch: 902
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 1 blamed authors not CCed: anthony.l.nguyen@intel.com; 4 maintainers not CCed: anthony.l.nguyen@intel.com pabeni@redhat.com jesse.brandeburg@intel.com edumazet@google.com
netdev/build_clang success Errors and warnings before: 906 this patch: 906
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 906 this patch: 906
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 35 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 142 this patch: 142
netdev/source_inline success Was 0 now: 0

Commit Message

Wojciech Drewek May 31, 2024, 9:32 a.m. UTC
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.

Fixes: c76488109616 ("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>
---
v2: remove "failure" from log message
v3: don't sleep in the last iteration of the wait loop
---
 drivers/net/ethernet/intel/ice/ice_ddp.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

Comments

Paul Menzel May 31, 2024, 10:36 a.m. UTC | #1
Dear Wojciech,


Thank you for your patch.

Am 31.05.24 um 11:32 schrieb 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.

Also mention the delay of 20 ms?

Please elaborate, what firmware version you tested with, and if there 
are plans to fix this in the firmware.

> Fixes: c76488109616 ("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>
> ---
> v2: remove "failure" from log message
> v3: don't sleep in the last iteration of the wait loop
> ---
>   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);

Should the firmware be fixed, a warning could be shown asking to update 
the firmware.

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


Kind regards,

Paul
Wojciech Drewek June 3, 2024, 8:41 a.m. UTC | #2
On 31.05.2024 12:36, Paul Menzel wrote:
> Dear Wojciech,
> 
> 
> Thank you for your patch.
> 
> Am 31.05.24 um 11:32 schrieb 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.
> 
> Also mention the delay of 20 ms?

I can do this.

> 
> Please elaborate, what firmware version you tested with, and if there are plans to fix this in the firmware.

I tested it with firmware 4.40, I don't know anything about the fix yet.

> 
>> Fixes: c76488109616 ("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>
>> ---
>> v2: remove "failure" from log message
>> v3: don't sleep in the last iteration of the wait loop
>> ---
>>   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);
> 
> Should the firmware be fixed, a warning could be shown asking to update the firmware.

I won't put such info before we actually have a fix in the firmware.

> 
>>             /* Save AQ status from download package */
>>           if (status) {
> 
> 
> Kind regards,
> 
> Paul
Pucha, HimasekharX Reddy June 4, 2024, 9:58 a.m. UTC | #3
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Wojciech Drewek
> Sent: Friday, May 31, 2024 3:02 PM
> To: netdev@vger.kernel.org
> Cc: Keller, Jacob E <jacob.e.keller@intel.com>; kuba@kernel.org; intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH iwl-net v3] 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.
>
> Fixes: c76488109616 ("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>
> ---
> v2: remove "failure" from log message
> v3: don't sleep in the last iteration of the wait loop
> ---
>  drivers/net/ethernet/intel/ice/ice_ddp.c | 23 +++++++++++++++++++++--
>  1 file changed, 21 insertions(+), 2 deletions(-)
>

Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
diff mbox series

Patch

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) {