Skip to contentSkip to conversation

igc: set the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr

PATCH Superseded Kevin Lo 2 participants 3 messages Dec 11, 2020 – Dec 14, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Kevin Lo

author
#0 lore raw

PATCH 1/1 igc: set the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr

This patch sets the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr. Without this change it wouldn't lead to a shadow RAM write EEWR timeout.

---

drivers/net/ethernet/intel/igc/igc_i225.c +1 -2
index 8b67d9b49a83..b0a5cd31683e 100644
@@ -221,7 +221,7 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
 	struct igc_nvm_info *nvm = &hw->nvm;
 	u32 attempts = 100000;
 	u32 i, k, eewr = 0;
-	s32 ret_val = 0;
+	s32 ret_val = -IGC_ERR_NVM;
 
 	/* A check for invalid values:  offset too large, too many words,
 	 * too many words for the offset, and not enough words.
@@ -229,7 +229,6 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
 	if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) ||
 	    words == 0) {
 		hw_dbg("nvm parameter(s) out of bounds\n");
-		ret_val = -IGC_ERR_NVM;
 		goto out;
 	}
 
maintainer
#1 lore raw
Quoted 4 lines · On Fri, 11 Dec 2020 22:34:56 +0800 Kevin Lo wrote:

This patch sets the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr. Without this change it wouldn't lead to a shadow RAM write EEWR timeout.

This is a fix, please add a Fixes tag.

Please CC the maintainers:

M: Jesse Brandeburg <[email protected]>
M: Tony Nguyen <[email protected]>

author
#2 lore raw
Quoted 5 lines · Jakub Kicinski
Quoted 3 lines · On Fri, 11 Dec 2020 22:34:56 +0800 Kevin Lo wrote:

This patch sets the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr. Without this change it wouldn't lead to a shadow RAM write EEWR timeout.

Quoted 8 lines
Quoted 1 line

This is a fix, please add a Fixes tag.

Please CC the maintainers:

M: Jesse Brandeburg <[email protected]>
M: Tony Nguyen <[email protected]>

I will update the Fixes tag and send V2, thanks.