Skip to contentSkip to conversation

net/ice/base: fix ddp pkg loaded failed

PATCH In review Steve Yang 2 participants 2 messages Sep 7, 2022 Network drivers

lore
Share & tools
lore

Steve Yang

author
#0 lore raw

PATCH 1/1 net/ice/base: fix ddp pkg loaded failed

When DDP package state is 'ICE_DDP_PKG_SAME_VERSION_ALREADY_LOADED', it should be treated as success state, otherwise, the wrong state will be used within 'ice_load_pkg'.

Fixes 58e9fd55be0e ("net/ice/base: refactor DDP code")
---
 drivers/net/ice/base/ice_ddp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_ddp.c +4 -1
index d1cae48047..284b58a6b1 100644
@@ -1378,8 +1378,11 @@ enum ice_ddp_state ice_init_pkg(struct ice_hw *hw, u8 *buf, u32 len)
 	 */
 	if (!state || state == ICE_DDP_PKG_ALREADY_LOADED) {
 		state = ice_get_pkg_info(hw);
-		if (!state)
+		if (!state) {
 			state = ice_get_ddp_pkg_state(hw, already_loaded);
+			if (state == ICE_DDP_PKG_SAME_VERSION_ALREADY_LOADED)
+				state = ICE_SUCCESS;
+		}
 	}
 
 	if (ice_is_init_pkg_successful(state)) {
Signature · 1 line
2.25.1
#1 lore raw
Quoted 27 lines

-----Original Message-----
From: Yang, SteveX <[email protected]>
Sent: Wednesday, September 7, 2022 5:10 PM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>; Yang, SteveX <[email protected]>
Subject: [PATCH v1] net/ice/base: fix ddp pkg loaded failed

When DDP package state is 'ICE_DDP_PKG_SAME_VERSION_ALREADY_LOADED',
it should be treated as success state, otherwise, the wrong state will be used within 'ice_load_pkg'.

Fixes 58e9fd55be0e ("net/ice/base: refactor DDP code")
---
 drivers/net/ice/base/ice_ddp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ice/base/ice_ddp.c +0 -0
index d1cae48047..284b58a6b1 100644

drivers/net/ice/base/ice_ddp.c enum ice_ddp_state ice_init_pkg(struct ice_hw · line 1385

Quoted 9 lines
drivers/net/ice/base/ice_ddp.c +2 -1
@@ -1378,8 +1378,11 @@ enum ice_ddp_state ice_init_pkg(struct ice_hw
 *hw, u8 *buf, u32 len)
 	 */
 	if (!state || state == ICE_DDP_PKG_ALREADY_LOADED) {
 		state = ice_get_pkg_info(hw);
-		if (!state)
+		if (!state) {
 			state = ice_get_ddp_pkg_state(hw, already_loaded);
+			if (state ==
 ICE_DDP_PKG_SAME_VERSION_ALREADY_LOADED)

We can use ice_is_init_pkg_successful to check the return value which also accept ICE_DDP_PKG_COMPATIBLE_ALREADY_LOADED and this is expected.

Btw, I didn't notice this patch has been sent before I send another one for the same purpose, this one can be superseded.

Quoted 7 lines
drivers/net/ice/base/ice_ddp.c +2 -0
+				state = ICE_SUCCESS;
+		}
 	}

if (ice_is_init_pkg_successful(state)) {
--
2.25.1