]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ice: Fix package download algorithm
authorDan Nowlin <dan.nowlin@intel.com>
Wed, 8 May 2024 17:19:07 +0000 (10:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2024 07:49:25 +0000 (09:49 +0200)
[ Upstream commit 6d51d44ecddb5c2962688ef06e55e4fbc949f04a ]

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")
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
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>
Link: https://lore.kernel.org/r/20240508171908.2760776-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_ddp.c

index 8b7504a9df316ce3be5786b61f603f0183dca5e6..90b9e28ddba912897de42924519c58b65d0e01d8 100644 (file)
@@ -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);