Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3089213pxb; Mon, 24 Jan 2022 02:05:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBtHtqQcQjjwwRS3Wxxi1xJOOEmEAMHEQY2nPUqhwfTOP33JmB40A/YcXlzqxbwUQFfACo X-Received: by 2002:a17:902:7617:b0:149:9c02:f260 with SMTP id k23-20020a170902761700b001499c02f260mr13758028pll.30.1643018747713; Mon, 24 Jan 2022 02:05:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643018747; cv=none; d=google.com; s=arc-20160816; b=ikX+gHBnSuWP3BCEwP+b8NDIBuRjZMOqLGdBcPhYi34uv/04egQuVZEPhKmBL8a10T zsYimYgx/JhmYFi3WporwfnGfNI3/Ae5pXHG7sn1Ez0iub2Gjyt+a6xcrpbuIGkiRibq /2lUrP+tjp98cKM/upfLcG5MKTmBc+K9l/hS3u9lwvwhUgz6qD+eztsaPsgoWYlss/4c 78UyiA0gj2A9kJslPoghMYDfahdiWQSDd8qMe+de+/in+FgmB8Hb7NQd2qmuKcBj0Aps wF+TwP6cOnbBq1lvoxEGFbLGwfvGg6+HAv3WX+3CneFI2hjEp/B9woWuH3ZOgA2XBdGU EbVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=EMC6Ft10JXwi16PGGMWQ1pe3LM0kkBsvwtaXhgSs0wM=; b=pbd8db65mJ5DKNJNPZxggYeBUiRpm1+Ko792ONWQTiWuQR5tTevqQUjEB24l7wSEEu oZ4ow8hltHjb7fiae8GUbJTMu7OkBoB55cFYdGM/Q4BSUnQNSDV5tb4+Mgvl0hq18Axs nOgSx3s1Ug7R0qjncywaSKt8VpOwKQCVZz2lu7YpZY2vc3fIFE1vqT3x08maqiDSbyoZ S4MqHU/vVmZ+l9EWCbWUb9HAJ/WY+5gVB9YT5vL6vei6w1d/IRKEktSAoBCyxI4CVazS nm06rVxSSF6+Gq5IHdnBbFhwcsUazc7865Q2Gl7yTxk3ANo9DgJpczgF/IzA60qNQP91 jGaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=EO0tRbP4; 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 t31si13221534pga.276.2022.01.24.02.05.35; Mon, 24 Jan 2022 02:05:47 -0800 (PST) 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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=EO0tRbP4; 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 S238189AbiAWPwl (ORCPT + 99 others); Sun, 23 Jan 2022 10:52:41 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:49648 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238181AbiAWPwk (ORCPT ); Sun, 23 Jan 2022 10:52:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=EMC6Ft10JXwi16PGGMWQ1pe3LM0kkBsvwtaXhgSs0wM=; b=EO0tRbP4Cm6mmtzSNEUjPEe+fN gEll1aTSwCLFqWNaKAehFMt6LO3f3TV6EsNHAZGABi4xyxeHb8Tpf+vbNq26LfSK0KL9iDpWUzJZI +kQE8nHGPjqqqISIy1/DC/Yk4uQ+cxG41jqOjV8AQAKzMk3WcnoirV20gNJSx7do3ELU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nBfAL-002OLT-JC; Sun, 23 Jan 2022 16:52:29 +0100 Date: Sun, 23 Jan 2022 16:52:29 +0100 From: Andrew Lunn To: Jisheng Zhang Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: stmmac: don't stop RXC during LPI Message-ID: References: <20220123141245.1060-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220123141245.1060-1-jszhang@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 23, 2022 at 10:12:45PM +0800, Jisheng Zhang wrote: > I met can't receive rx pkt issue with below steps: > 0.plug in ethernet cable then boot normal and get ip from dhcp server > 1.quickly hotplug out then hotplug in the ethernet cable > 2.trigger the dhcp client to renew lease > > tcpdump shows that the request tx pkt is sent out successfully, > but the mac can't receive the rx pkt. > > The issue can easily be reproduced on platforms with PHY_POLL external > phy. If we don't allow the phy to stop the RXC during LPI, the issue > is gone. I think it's unsafe to stop the RXC during LPI because the mac > needs RXC clock to support RX logic. > > And the 2nd param clk_stop_enable of phy_init_eee() is a bool, so use > false instead of 0. > > Signed-off-by: Jisheng Zhang > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > index 6708ca2aa4f7..92a9b0b226b1 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > @@ -1162,7 +1162,7 @@ static void stmmac_mac_link_up(struct phylink_config *config, > > stmmac_mac_set(priv, priv->ioaddr, true); > if (phy && priv->dma_cap.eee) { > - priv->eee_active = phy_init_eee(phy, 1) >= 0; > + priv->eee_active = phy_init_eee(phy, false) >= 0; This has not caused issues in the past. So i'm wondering if this is somehow specific to your system? Does everybody else use a PHY which does not implement this bit? Does your synthesis of the stmmac have a different clock tree? By changing this value for every instance of the stmmac, you are potentially causing a power regression for stmmac implementations which don't need the clock. So we need a clear understanding, stopping the clock is wrong in general and so the change is correct in general. Or this is specific to your system, and you probably need to add priv->dma_cap.keep_rx_clock_ticking, which you set in your glue driver,and use here to decide what to pass to phy_init_eee(). Andrew