]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: cpsw: disable napi in cpsw_ndo_open()
authorZhengchao Shao <shaozhengchao@huawei.com>
Wed, 9 Nov 2022 01:15:37 +0000 (09:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 09:04:01 +0000 (10:04 +0100)
[ Upstream commit 6d47b53fb3f363a74538a1dbd09954af3d8d4131 ]

When failed to create xdp rxqs or fill rx channels in cpsw_ndo_open() for
opening device, napi isn't disabled. When open cpsw device next time, it
will report a invalid opcode issue. Compiled tested only.

Fixes: d354eb85d618 ("drivers: net: cpsw: dual_emac: simplify napi usage")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Link: https://lore.kernel.org/r/20221109011537.96975-1-shaozhengchao@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/ti/cpsw.c

index ed66c4d4d830126e38a38b6ed2c874247b7f7c64..613e2c7c950ca4d21bc97d1cbad6f4aefd82365d 100644 (file)
@@ -854,6 +854,8 @@ static int cpsw_ndo_open(struct net_device *ndev)
 
 err_cleanup:
        if (!cpsw->usage_count) {
+               napi_disable(&cpsw->napi_rx);
+               napi_disable(&cpsw->napi_tx);
                cpdma_ctlr_stop(cpsw->dma);
                cpsw_destroy_xdp_rxqs(cpsw);
        }