From patchwork Sun Jan 23 14:12:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 12720971 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 52BB6C433F5 for ; Sun, 23 Jan 2022 14:21:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=HbpFvJIMLgq8nHFDknla7sm3EijuGyx2WchzXCFJ69g=; b=kgOB4Fzv8Vf5/x QDLcGeIVALBng91qzGrUMN2OQo3ZQIfpSIZyAU9noAQKP7izP2p3YT+TpYwi8aDA+C814yFflGQiM 4GitDdesuOfnuaiHTVYk0KpbdRjUS47UZRhDraaX1nHUfZaRVZIclnv+iDCvCwA1NBVoTtXhT33YK ltYOcIqphZbPECrUini9h3cWN2BY5ToqLipAhZ0097/UW5b2/T3a36BFOxPXtwPhq3sWtgm+SWz3a 28+fams6XBxXTMJYM8BFfqNKwP4xqgWE5fohTRkddSROTpBHw5MZ0VH51zQaKqk7w9LI/ldBR4OqC PIq53gPkCVRxdjfMNDdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBdjG-000y51-Ne; Sun, 23 Jan 2022 14:20:26 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBdjD-000y46-OX for linux-arm-kernel@lists.infradead.org; Sun, 23 Jan 2022 14:20:25 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7CDB9B80B28; Sun, 23 Jan 2022 14:20:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 987CDC340E2; Sun, 23 Jan 2022 14:20:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642947621; bh=sPP73J14sFJ1BrFw8EftFhDZ6LJsU6ER5loSACvyBtQ=; h=From:To:Cc:Subject:Date:From; b=jCbKhn6d320AUbUEPCXhhjj8Z3b3TV9nET3CToXH9Tbja6BPdXmzbEca+a1yWx5po b2J2LfWrTphyL5/zBQ01js7LOnbgABtvmjPddfvDHj1D7lGUw1v5Ca5xLfIEn6fkeb eSn2nYVRvIhB00/5guw866QakBpzFXczU5HIQCjWxN8VV4MT4IIXgIgAEcfIJHOyfO ixCtFTh0ir2onzZN7i/UsGpp/Vq21VXjE09/Q/KN3d64aVIQiIQek05+xZk1OjZcK2 Ly9+8so5Y2WSAZaq+aMUhqYB/LrX2/4lCdEpfliXxjKLdRNz5XRZ2GcoHdYX/jfh/z PJ5Wi8Sj7/3ZQ== From: Jisheng Zhang To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Maxime Coquelin Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: stmmac: don't stop RXC during LPI Date: Sun, 23 Jan 2022 22:12:45 +0800 Message-Id: <20220123141245.1060-1-jszhang@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220123_062023_959279_1104965C X-CRM114-Status: GOOD ( 14.35 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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; priv->eee_enabled = stmmac_eee_init(priv); priv->tx_lpi_enabled = priv->eee_enabled; stmmac_set_eee_pls(priv, priv->hw, true);