]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: ethernet: mtk-star-emac: disable napi when connect and start PHY failed in mtk_s...
authorZhengchao Shao <shaozhengchao@huawei.com>
Mon, 7 Nov 2022 01:21:59 +0000 (09:21 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 8 Nov 2022 12:28:07 +0000 (13:28 +0100)
When failed to connect to and start PHY in mtk_star_enable() for opening
device, napi isn't disabled. When open mtk star device next time, it will
reports a invalid opcode issue. Fix it. Only be compiled, not be tested.

Fixes: e104d92c885f ("net: ethernet: mtk-star-emac: new driver")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20221107012159.211387-1-shaozhengchao@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mediatek/mtk_star_emac.c

index 7e890f81148e6a8f7c625b4399d9fa44f8e81c0f..7050351250b7a38679aa901348976c9d2eb5b99b 100644 (file)
@@ -1026,6 +1026,8 @@ static int mtk_star_enable(struct net_device *ndev)
        return 0;
 
 err_free_irq:
+       napi_disable(&priv->rx_napi);
+       napi_disable(&priv->tx_napi);
        free_irq(ndev->irq, ndev);
 err_free_skbs:
        mtk_star_free_rx_skbs(priv);