diff mbox series

net: ll_temac: stop phy when request_irq() failed in temac_open()

Message ID 20221121010658.106749-1-shaozhengchao@huawei.com (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series net: ll_temac: stop phy when request_irq() failed in temac_open() | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
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: 29 this patch: 29
netdev/cc_maintainers success CCed 12 of 12 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: 29 this patch: 29
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 22 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. 21, 2022, 1:06 a.m. UTC
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 <shaozhengchao@huawei.com>
---
 drivers/net/ethernet/xilinx/ll_temac_main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

shaozhengchao Nov. 21, 2022, 1:05 a.m. UTC | #1
Sorry to interrupt, please ignore this patch.

On 2022/11/21 9:06, Zhengchao Shao wrote:
> 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 <shaozhengchao@huawei.com>
> ---
>   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);
>
diff mbox series

Patch

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);