[v2,090/148] net/ice/base: fix package download algorithm

Message ID 7204b01d9d0a93303a566e4dd0f54ea6f3a8956f.1718204529.git.anatoly.burakov@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Bruce Richardson
Headers
Series Update net/ice base driver to latest upstream snapshot |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Anatoly Burakov June 12, 2024, 3:01 p.m. UTC
From: Ian Stokes <ian.stokes@intel.com>

Previously, the code would assume that only "Modular Signature Segment"
existed. Given a package with both a "Reference Signature Segment" and a
"Modular Signature Segment" the download would not have been successful
because an incorrect sequence of buffers would be sent to the firmware.

Update download flow to detect a "Reference Signature Segment" and to
only download the buffers in the signature segment in this case, and to
skip downloading any buffers from the configuration segment.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
---
 drivers/net/ice/base/ice_ddp.c | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Patch

diff --git a/drivers/net/ice/base/ice_ddp.c b/drivers/net/ice/base/ice_ddp.c
index 5a0cf4d54f..b57c67d849 100644
--- a/drivers/net/ice/base/ice_ddp.c
+++ b/drivers/net/ice/base/ice_ddp.c
@@ -568,6 +568,14 @@  ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr,
 	if (state)
 		goto exit;
 
+	if (count == 0) {
+		/* this is a "Reference Signature Segment" and download should
+		 * be only for the buffers in the signature segment (and not
+		 * the hardware configuration segment)
+		 */
+		goto exit;
+	}
+
 	state = ice_download_pkg_config_seg(hw, pkg_hdr, conf_idx, start,
 					    count);