Skip to contentSkip to conversation

ice: Fix package download algorithm

PATCH In review Paul Greenwalt 3 participants 3 messages Mar 26, 2024 – May 8, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ice: Fix package download algorithm

From: Dan Nowlin <[email protected]>

Previously, the driver assumed that all signature segments would contain one or more buffers to download. In the future, there will be signature segments that will contain no buffers to download.

Correct download flow to allow for signature segments that have zero download buffers and skip the download in this case.

Fixes 3cbdb0343022 ("ice: Add support for E830 DDP package segment")
---
 drivers/net/ethernet/intel/ice/ice_ddp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/ice/ice_ddp.c +4 -4
index 8b7504a9df31..90b9e28ddba9 100644
@@ -1424,14 +1424,14 @@ ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr,
 		goto exit;
 	}
 
-	conf_idx = le32_to_cpu(seg->signed_seg_idx);
-	start = le32_to_cpu(seg->signed_buf_start);
 	count = le32_to_cpu(seg->signed_buf_count);
-
 	state = ice_download_pkg_sig_seg(hw, seg);
-	if (state)
+	if (state || !count)
 		goto exit;
 
+	conf_idx = le32_to_cpu(seg->signed_seg_idx);
+	start = le32_to_cpu(seg->signed_buf_start);
+
 	state = ice_download_pkg_config_seg(hw, pkg_hdr, conf_idx, start,
 					    count);
 
Signature · 1 line
2.41.0
Tested-by on v2 1/1
#2 lore raw
In reply to Paul Greenwalt
Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Paul Greenwalt
Sent: Wednesday, March 27, 2024 2:30 AM
To: [email protected]
Cc: Nowlin, Dan <[email protected]>; Greenwalt, Paul <[email protected]>; Kitszel, Przemyslaw <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v2] ice: Fix package download algorithm

From: Dan Nowlin <[email protected]>

Previously, the driver assumed that all signature segments would contain one or more buffers to download. In the future, there will be signature segments that will contain no buffers to download.

Correct download flow to allow for signature segments that have zero download buffers and skip the download in this case.

Quoted 8 lines
Fixes 3cbdb0343022 ("ice: Add support for E830 DDP package segment")
---
 drivers/net/ethernet/intel/ice/ice_ddp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)