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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02E1BC54EAA for ; Thu, 26 Jan 2023 21:36:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233048AbjAZVgW (ORCPT ); Thu, 26 Jan 2023 16:36:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233019AbjAZVgM (ORCPT ); Thu, 26 Jan 2023 16:36:12 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3CFE15CA9 for ; Thu, 26 Jan 2023 13:36:10 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id me3so8737109ejb.7 for ; Thu, 26 Jan 2023 13:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WUoBTYLOr108fyfxD4wyJMAOsefZoDsyGTAdmy/lBCE=; b=b2fcFkM1YxdUWa/ELImacpa70REr0lAWiptZA+OMDpGJeO4fIcgrSzGWnK475HSo9b BbAAwGKLhbQyycV2dC/mGs+6+WJ+GasIvz9snUSgLvKjC5iqARo3MBpOGbJtdiGKBbnH FzTtgOf1O8hpYl91GZINbTkw1Xobkym9DMqmrFEeLHWKk3dx9KiCrUzMbHY+xJFqteR6 WHdTK3sdbnQ3R+jABiseBIHAiu/I0W7l/csoZnAme32DJigf6cLlv0PLxrJber6TfLgA ne56+sWfx0jOBPCYhTyJBltyyih0wEfWaUFDxfnQnNBxgXpknCLzPyzQg3yTVHBkeku6 2e8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WUoBTYLOr108fyfxD4wyJMAOsefZoDsyGTAdmy/lBCE=; b=zZRYVsaRX1EqDzWL7CX2DwGysJWsZRLUNafkNZhp/X8yPpOCU7CqFyg7TCUSiGzsq1 WG03YIqdXUwazeMim/3ky7Sd41owOH33SffGkzwhiIPBVD6gnVutrLD7MQDp6mcZZCx6 WkKv54TQoUHIGiQjz/tYVXAm5up6qBd35ZpfDs3KsKDCofoZh106fmpQB0jXHARS5lR1 uJYsRkjfNAlFrTpe/khP48yb6eccj32+S/iCbgfiaf/vOB4c6WLXOgY7bNCXVO55zoZT yRG8AEBNOv08nVyemh8fwi8Iay3/rG+nX3XKSEW7fuLfPRsDLiWmQAlCLRpn7lqD6ArG KzzA== X-Gm-Message-State: AFqh2krn1yDtqyBTzX29roZJXsARxmuHDm2YI3+wGKbSxqKrnWU63VO7 r4pVQYndIESZrN5ebpWK+wQyOAQ0RiPSVe86mC4= X-Google-Smtp-Source: AMrXdXuEM+4fnv0ZhybLPelstCQ+jeWMOqiAT1+pZYf980zA1g3Ur+9wz6z7+YC4nh7CjrWRqxMcrw== X-Received: by 2002:a17:907:2106:b0:871:c2e4:2e94 with SMTP id qn6-20020a170907210600b00871c2e42e94mr37184416ejb.2.1674768969356; Thu, 26 Jan 2023 13:36:09 -0800 (PST) Received: from Lat-5310.. ([87.116.162.186]) by smtp.gmail.com with ESMTPSA id gy4-20020a170906f24400b0083ffb81f01esm1148486ejb.136.2023.01.26.13.36.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 13:36:09 -0800 (PST) From: Andrey Konovalov To: vkoul@kernel.org, bhupesh.sharma@linaro.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew@lunn.ch, robh@kernel.org, alexandre.torgue@foss.st.com, peppe.cavallaro@st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Andrey Konovalov Subject: [PATCH 1/1] net: stmmac: do not stop RX_CLK in Rx LPI state for qcs404 SoC Date: Fri, 27 Jan 2023 00:35:39 +0300 Message-Id: <20230126213539.166298-2-andrey.konovalov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230126213539.166298-1-andrey.konovalov@linaro.org> References: <20230126213539.166298-1-andrey.konovalov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently in phy_init_eee() the driver unconditionally configures the PHY to stop RX_CLK after entering Rx LPI state. This causes an LPI interrupt storm on my qcs404-base board. Change the PHY initialization so that for "qcom,qcs404-ethqos" compatible device RX_CLK continues to run even in Rx LPI state. Signed-off-by: Andrey Konovalov --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 ++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- include/linux/stmmac.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 835caa15d55f..732774645c1a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -560,6 +560,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) plat_dat->has_gmac4 = 1; plat_dat->pmt = 1; plat_dat->tso_en = of_property_read_bool(np, "snps,tso"); + if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) + plat_dat->rx_clk_runs_in_lpi = 1; ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index b7e5af58ab75..1a5b8dab5e9b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1080,7 +1080,8 @@ 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, !priv->plat->rx_clk_runs_in_lpi) >= 0; priv->eee_enabled = stmmac_eee_init(priv); priv->tx_lpi_enabled = priv->eee_enabled; stmmac_set_eee_pls(priv, priv->hw, true); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 83ca2e8eb6b5..a152678b82b7 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -252,6 +252,7 @@ struct plat_stmmacenet_data { int rss_en; int mac_port_sel_speed; bool en_tx_lpi_clockgating; + bool rx_clk_runs_in_lpi; int has_xgmac; bool vlan_fail_q_en; u8 vlan_fail_q; -- 2.34.1