From patchwork Mon Nov 21 01:06:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shaozhengchao X-Patchwork-Id: 13050265 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3534EC433FE for ; Mon, 21 Nov 2022 01:00:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229881AbiKUBAe (ORCPT ); Sun, 20 Nov 2022 20:00:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbiKUBAd (ORCPT ); Sun, 20 Nov 2022 20:00:33 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEEF220BF5 for ; Sun, 20 Nov 2022 17:00:31 -0800 (PST) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NFpvk11b6z15Mll; Mon, 21 Nov 2022 09:00:02 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 21 Nov 2022 09:00:29 +0800 From: Zhengchao Shao To: , , , , , CC: , , , , , , , , , , , , Subject: [PATCH] net: ll_temac: stop phy when request_irq() failed in temac_open() Date: Mon, 21 Nov 2022 09:06:58 +0800 Message-ID: <20221121010658.106749-1-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org When request_irq() failed in temac_open(), phy is not stopped. Compiled test only. Fixes: 92744989533c ("net: add Xilinx ll_temac device driver") Signed-off-by: Zhengchao Shao --- drivers/net/ethernet/xilinx/ll_temac_main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index 1066420d6a83..2b61fa2c04a2 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c @@ -1193,8 +1193,10 @@ static int temac_open(struct net_device *ndev) err_rx_irq: free_irq(lp->tx_irq, ndev); err_tx_irq: - if (phydev) + if (phydev) { + phy_stop(phydev); phy_disconnect(phydev); + } dev_err(lp->dev, "request_irq() failed\n"); return rc; } @@ -1211,8 +1213,10 @@ static int temac_stop(struct net_device *ndev) free_irq(lp->tx_irq, ndev); free_irq(lp->rx_irq, ndev); - if (phydev) + if (phydev) { + phy_stop(phydev); phy_disconnect(phydev); + } temac_dma_bd_release(ndev);