diff mbox series

net/e1000: fix write NVM srwr alwayes return success

Message ID 1618986145-15414-1-git-send-email-humin29@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers show
Series net/e1000: fix write NVM srwr alwayes return success | expand

Checks

Context Check Description
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot success github build: passed
ci/checkpatch success coding style OK

Commit Message

Min Hu (Connor) April 21, 2021, 6:22 a.m. UTC
From: Chengwen Feng <fengchengwen@huawei.com>

This patch fixes e1000_write_nvm_srwr() alwayes return success.

Fixes: 5a32a257f957 ("e1000: more NICs in base driver")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/e1000/base/e1000_i210.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Wang, Haiyue April 21, 2021, 6:56 a.m. UTC | #1
> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Wednesday, April 21, 2021 14:22
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Guo, Jia <jia.guo@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>
> Subject: [PATCH] net/e1000: fix write NVM srwr alwayes return success
> 
> From: Chengwen Feng <fengchengwen@huawei.com>
> 
> This patch fixes e1000_write_nvm_srwr() alwayes return success.

This commit message seems not so correct, it should be like:

This fixes the timed out for shadow RAM write EEWR can't be detected.

> 
> Fixes: 5a32a257f957 ("e1000: more NICs in base driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  drivers/net/e1000/base/e1000_i210.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/e1000/base/e1000_i210.c b/drivers/net/e1000/base/e1000_i210.c
> index 3c349d3..615e7c9 100644
> --- a/drivers/net/e1000/base/e1000_i210.c
> +++ b/drivers/net/e1000/base/e1000_i210.c
> @@ -310,6 +310,8 @@ STATIC s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,
>  	}
> 
>  	for (i = 0; i < words; i++) {
> +		ret_val = E1000_ERR_NVM;

Should be "-E1000_ERR_NVM" as the below used:

	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
	    (words == 0)) {
		DEBUGOUT("nvm parameter(s) out of bounds\n");
		ret_val = -E1000_ERR_NVM; <---
		goto out;
	}

> +
>  		eewr = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) |
>  			(data[i] << E1000_NVM_RW_REG_DATA) |
>  			E1000_NVM_RW_REG_START;
> --
> 2.7.4
Min Hu (Connor) April 21, 2021, 7:14 a.m. UTC | #2
在 2021/4/21 14:56, Wang, Haiyue 写道:
>> -----Original Message-----
>> From: Min Hu (Connor) <humin29@huawei.com>
>> Sent: Wednesday, April 21, 2021 14:22
>> To: dev@dpdk.org
>> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Guo, Jia <jia.guo@intel.com>; Wang, Haiyue
>> <haiyue.wang@intel.com>
>> Subject: [PATCH] net/e1000: fix write NVM srwr alwayes return success
>>
>> From: Chengwen Feng <fengchengwen@huawei.com>
>>
>> This patch fixes e1000_write_nvm_srwr() alwayes return success.
> 
> This commit message seems not so correct, it should be like:
> 
> This fixes the timed out for shadow RAM write EEWR can't be detected.
> 
>>
>> Fixes: 5a32a257f957 ("e1000: more NICs in base driver")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> ---
>>   drivers/net/e1000/base/e1000_i210.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/e1000/base/e1000_i210.c b/drivers/net/e1000/base/e1000_i210.c
>> index 3c349d3..615e7c9 100644
>> --- a/drivers/net/e1000/base/e1000_i210.c
>> +++ b/drivers/net/e1000/base/e1000_i210.c
>> @@ -310,6 +310,8 @@ STATIC s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,
>>   	}
>>
>>   	for (i = 0; i < words; i++) {
>> +		ret_val = E1000_ERR_NVM;
> 
> Should be "-E1000_ERR_NVM" as the below used:
> 
Hi, fixed in v2, thanks.
> 	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
> 	    (words == 0)) {
> 		DEBUGOUT("nvm parameter(s) out of bounds\n");
> 		ret_val = -E1000_ERR_NVM; <---
> 		goto out;
> 	}
> 
>> +
>>   		eewr = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) |
>>   			(data[i] << E1000_NVM_RW_REG_DATA) |
>>   			E1000_NVM_RW_REG_START;
>> --
>> 2.7.4
> 
> .
>
diff mbox series

Patch

diff --git a/drivers/net/e1000/base/e1000_i210.c b/drivers/net/e1000/base/e1000_i210.c
index 3c349d3..615e7c9 100644
--- a/drivers/net/e1000/base/e1000_i210.c
+++ b/drivers/net/e1000/base/e1000_i210.c
@@ -310,6 +310,8 @@  STATIC s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,
 	}
 
 	for (i = 0; i < words; i++) {
+		ret_val = E1000_ERR_NVM;
+
 		eewr = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) |
 			(data[i] << E1000_NVM_RW_REG_DATA) |
 			E1000_NVM_RW_REG_START;