Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3910104pxb; Sun, 24 Oct 2021 14:36:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeswFmZeLpIQuuCdylheQWgw2eEJpGdIuC2T+aoM2HrQQ1ksf9PC9iIiP0ND3ZTFi9IVUM X-Received: by 2002:a63:1d13:: with SMTP id d19mr10497412pgd.383.1635111374808; Sun, 24 Oct 2021 14:36:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635111374; cv=none; d=google.com; s=arc-20160816; b=LBo4MJKVxegrfMtA+5DJmKZXdind4C1MKvHxcVfpsbdYfZM0xhIAwI1k5rF4aUSuAn /Cb+F3N7adxoX3/3frxDJPq1+SXdRxlC0RksVZ1fZtSBPHXSNr8jQclgNLzKk1obZ83b OJ86liJGFBTUJyUm4hj+Hhxq0EpOxxeNENqNG0FsfHov9pThe8AXefaLSVioxzYG0n2v XfcGNF69Ve5HT6zfIcQGqnIP5w9AVUWhH/mTHhHx4eZ45rl8p0+08ovrdRgtG8Z6YZz8 l75m8N5s2dx6ha5Nv+aclz4Aw7fhiGgqPwLx9Q8hAoyDQHlsesqJh7atZ3ZxTGj7Iygm lv0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=pHQZP55xLKU9SRLCqSyEIsLBEK/ETe2SKkoOeJOqg4w=; b=MlxvgVeqN8TiYu2FhDpZrguFEv8AEqKdTaurPp1WpJDGB32OyNlS1HXxOXTHdb8U7c v7e4Xfc5XH6Iyw5SLc8ryvcp92WgazHZvtzdcXEIHsmJ7KNzb1Zww+bSboFSMclD3iF/ mqKmQ/4idvV+J1svqulJFdSzhlwbV7vWFHHbUFetqsuOeGQ6FZxV8VP7C47ta5jYLeOc /5ej9pRm0S5B6yULjENNtqS8gyQu6EmHxaj50AhP/l6p+1JrDJxDRffjUxl9U1gaR8V8 cnoryRsRcD3lwE+/e0/eHxelEFprMty2FHyyWPgMCNnYIp87p/H3cg0yp1wtRZ9Iq2yG ak/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h2si22669426pfv.20.2021.10.24.14.36.00; Sun, 24 Oct 2021 14:36:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231627AbhJXUD0 (ORCPT + 99 others); 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