From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C22BEC433FE for ; Sun, 24 Oct 2021 19:56:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91E3B61052 for ; Sun, 24 Oct 2021 19:56:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 91E3B61052 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mleia.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PrKT7Jup8SLIQdGqW0UYcGrQR428SDo8nKWcG3QheM4=; b=mbgAd+DRhyxow0O3ojwqynLDxb l1AzcokESMr+XiWjAav+QclQKKPDcw3DuKaJLkD30lj0MQqk2FRAjo/FP0fqUff6zOI3dbYSx4dJP eJzFZWkNIKeNkB7C/0MpKI9H9nHsOF2zzqVhg97HJCv+nXx57TI3yx29FZLYPo6ithj6yYnwY8pIv PrfYMQWhIBv2jJ9rJC2noZW6w2PPF+DAv6C2qsvXKu7uRLnBYjYkigtKBf7+BviSS1JcKweqy7cxe +lgKG3rkisTCLNvfFOtW95W7YR/+L/YJyjZaEJvug8ufzxM6vNj1zpXzQLHYdYeG8eC2J+Sf/0Xyp Lh+7APnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mejaU-00EXvy-1v; Sun, 24 Oct 2021 19:55:22 +0000 Received: from mleia.com ([178.79.152.223] helo=mail.mleia.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mejaP-00EXup-UL for linux-arm-kernel@lists.infradead.org; Sun, 24 Oct 2021 19:55:19 +0000 Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id E0A2B2E3E5; Sun, 24 Oct 2021 19:55:13 +0000 (UTC) Subject: Re: [PATCH] net: nxp: lpc_eth.c: avoid hang when bringing interface down To: Trevor Woerner , linux-kernel@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , "moderated list:ARM/LPC32XX SOC SUPPORT" , "open list:NETWORKING DRIVERS" References: <20211024175003.7879-1-twoerner@gmail.com> From: Vladimir Zapolskiy Message-ID: <47e68cfd-6c59-3d47-78cc-c2971c379146@mleia.com> Date: Sun, 24 Oct 2021 22:55:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20211024175003.7879-1-twoerner@gmail.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20211024_195513_938277_201D596E X-CRM114-Status: GOOD ( 17.13 ) /bin/ln: failed to access 'reaver_cache/texts/20211024_195513_938277_201D596E': No such file or directory X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211024_195513_938277_201D596E X-CRM114-Status: GOOD ( 18.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > --- > 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 -- Best wishes, Vladimir _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48DC3C433EF for ; Sun, 24 Oct 2021 20:01:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D3CE61077 for ; Sun, 24 Oct 2021 20:01:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231691AbhJXUD0 (ORCPT ); Sun, 24 Oct 2021 16:03:26 -0400 Received: from mleia.com ([178.79.152.223]:47018 "EHLO mail.mleia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231259AbhJXUDZ (ORCPT ); Sun, 24 Oct 2021 16:03:25 -0400 X-Greylist: delayed 349 seconds by postgrey-1.27 at vger.kernel.org; Sun, 24 Oct 2021 16:03:25 EDT Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id E0A2B2E3E5; Sun, 24 Oct 2021 19:55:13 +0000 (UTC) Subject: Re: [PATCH] net: nxp: lpc_eth.c: avoid hang when bringing interface down To: Trevor Woerner , linux-kernel@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , "moderated list:ARM/LPC32XX SOC SUPPORT" , "open list:NETWORKING DRIVERS" References: <20211024175003.7879-1-twoerner@gmail.com> From: Vladimir Zapolskiy Message-ID: <47e68cfd-6c59-3d47-78cc-c2971c379146@mleia.com> Date: Sun, 24 Oct 2021 22:55:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20211024175003.7879-1-twoerner@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20211024_195513_938277_201D596E X-CRM114-Status: GOOD ( 17.13 ) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 -- Best wishes, Vladimir