lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 24 Oct 2021 22:55:13 +0300
From:   Vladimir Zapolskiy <vz@...ia.com>
To:     Trevor Woerner <twoerner@...il.com>, linux-kernel@...r.kernel.org
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        "moderated list:ARM/LPC32XX SOC SUPPORT" 
        <linux-arm-kernel@...ts.infradead.org>,
        "open list:NETWORKING DRIVERS" <netdev@...r.kernel.org>
Subject: Re: [PATCH] net: nxp: lpc_eth.c: avoid hang when bringing interface
 down

Hi Trevor,

On 10/24/21 8:50 PM, Trevor Woerner wrote:
> A hard hang is observed whenever the ethernet interface is brought
> down. If the PHY is stopped before the LPC core block is reset,
> the SoC will hang. Comparing lpc_eth_close() and lpc_eth_open() I
> re-arranged the ordering of the functions calls in lpc_eth_close() to
> reset the hardware before stopping the PHY.
> 
> Signed-off-by: Trevor Woerner <twoerner@...il.com>
> ---
>   drivers/net/ethernet/nxp/lpc_eth.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
> index d29fe562b3de..c910fa2f40a4 100644
> --- a/drivers/net/ethernet/nxp/lpc_eth.c
> +++ b/drivers/net/ethernet/nxp/lpc_eth.c
> @@ -1015,9 +1015,6 @@ static int lpc_eth_close(struct net_device *ndev)
>   	napi_disable(&pldat->napi);
>   	netif_stop_queue(ndev);
>   
> -	if (ndev->phydev)
> -		phy_stop(ndev->phydev);
> -
>   	spin_lock_irqsave(&pldat->lock, flags);
>   	__lpc_eth_reset(pldat);
>   	netif_carrier_off(ndev);
> @@ -1025,6 +1022,8 @@ static int lpc_eth_close(struct net_device *ndev)
>   	writel(0, LPC_ENET_MAC2(pldat->net_base));
>   	spin_unlock_irqrestore(&pldat->lock, flags);
>   
> +	if (ndev->phydev)
> +		phy_stop(ndev->phydev);
>   	clk_disable_unprepare(pldat->clk);
>   
>   	return 0;
> 

thank you for the fix!

Fixes: b7370112f519 ("lpc32xx: Added ethernet driver")
Acked-by: Vladimir Zapolskiy <vz@...ia.com>

--
Best wishes,
Vladimir

Powered by blists - more mailing lists