diff mbox series

[net] net: mv643xx_eth: disable napi when init rxq or txq failed in mv643xx_eth_open()

Message ID 20221108025156.327279-1-shaozhengchao@huawei.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] net: mv643xx_eth: disable napi when init rxq or txq failed in mv643xx_eth_open() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 6 this patch: 6
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 6 this patch: 6
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

shaozhengchao Nov. 8, 2022, 2:51 a.m. UTC
When failed to init rxq or txq in mv643xx_eth_open() for opening device,
napi isn't disabled. When open mv643xx_eth device next time, it will
report a invalid opcode issue. Fix it. Only be compiled, not be tested.

Fixes: 527a626601de ("skge/sky2/mv643xx/pxa168: Move the Marvell Ethernet drivers")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
 drivers/net/ethernet/marvell/mv643xx_eth.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jakub Kicinski Nov. 9, 2022, 1:27 a.m. UTC | #1
On Tue, 8 Nov 2022 10:51:56 +0800 Zhengchao Shao wrote:
> When failed to init rxq or txq in mv643xx_eth_open() for opening device,
> napi isn't disabled. When open mv643xx_eth device next time, it will
> report a invalid opcode issue.

It will trigger a BUG_ON() in napi_enable()

> Fix it. Only be compiled, not be tested.

Please replace "Fix it. Only be compiled, not be tested."
with "Compile tested only."

> Fixes: 527a626601de ("skge/sky2/mv643xx/pxa168: Move the Marvell Ethernet drivers")

This is not the commit which added this code, please find out where 
the code was added.
shaozhengchao Nov. 9, 2022, 1:42 a.m. UTC | #2
On 2022/11/9 9:27, Jakub Kicinski wrote:
> On Tue, 8 Nov 2022 10:51:56 +0800 Zhengchao Shao wrote:
>> When failed to init rxq or txq in mv643xx_eth_open() for opening device,
>> napi isn't disabled. When open mv643xx_eth device next time, it will
>> report a invalid opcode issue.
> 
> It will trigger a BUG_ON() in napi_enable()
> 
>> Fix it. Only be compiled, not be tested.
> 
> Please replace "Fix it. Only be compiled, not be tested."
> with "Compile tested only."
> 
>> Fixes: 527a626601de ("skge/sky2/mv643xx/pxa168: Move the Marvell Ethernet drivers")
> 
> This is not the commit which added this code, please find out where
> the code was added.

Hi Jakub:
	Thank you for your review. I will fix them in V2.

Zhengchao Shao
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 707993b445d1..8941f69d93e9 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2481,6 +2481,7 @@  static int mv643xx_eth_open(struct net_device *dev)
 	for (i = 0; i < mp->rxq_count; i++)
 		rxq_deinit(mp->rxq + i);
 out:
+	napi_disable(&mp->napi);
 	free_irq(dev->irq, dev);
 
 	return err;