From patchwork Thu Jan 26 21:35:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 48910 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp505069wrn; Thu, 26 Jan 2023 13:53:10 -0800 (PST) X-Google-Smtp-Source: AK7set+HIoJoAmVuDR/jJZGcN2KOOyUEpc2Uul9paFoTim+L4yArU02TZ6ssJpaq6P0Pv75ekn8E X-Received: by 2002:a17:902:a704:b0:196:40b1:3319 with SMTP id w4-20020a170902a70400b0019640b13319mr2628020plq.5.1674769990019; Thu, 26 Jan 2023 13:53:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674769990; cv=none; d=google.com; s=arc-20160816; b=tYOLF9zzzCw3l7KimSSL9MiPWfeMOVY+QPH59UP0cUJWXIDJ3qZx/nPDxw4/A5BR8c DpEmnBJ42G2DNs8yB+pK+0Sv35t0qyFRRAZerY/q5RDt9EFMbgERpcqtKgAjeir5r4/M 3FzIVvCzNeUkZDvjLEo/M+sjHXQr4xPBEBxqsDeP+BYSxM4OnwWdueJPCNU/puLccdUK VaLtIZKBvfYKTKq8rrsmslWC3zpsg2NcsQTXUCsGZZp4r4svWaLWlPoU0YjzSPq0NYXh IYLcw2igtYOKsp5IoS/qIHJVqTg6DrHUEuyKSkzfSK0JkH0+B9YXzTBSocB4ZRjgB8aE egVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WUoBTYLOr108fyfxD4wyJMAOsefZoDsyGTAdmy/lBCE=; b=JVE5ysbPMwJ2EoF1VrUJ+CjILZLGjtTNN9XrhlX8f8Jt4jxLnrHSi9qGV8aAo6TJ80 TIIyYGDfqEhDq3dzVBR+itcR6TwMLgcjhw0UR2c9m9yKrgFKV9XF4U9B5yMRmJQtyyDb p/MAhEyNLuCNtxrlhAPbXQgc8ysZ8ujWhHKQq1EkBqvm51TtBrjGgA3kZhgQRkEqeuNc dJ7mmfdlhzxBsFOPeoQznOF1L+NCYy5s6kmeZTqdJu1GzK33nWcpQOFJ4ed3lVtkSryA pIm64tkKEOr1CwfrG/gkEjyEVf4v/Xlc1KaeEWe0ctbo92829NRbIQntOx3D7xNHUr/Y bAbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b2fcFkM1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x16-20020a170902b41000b0019441960a48si2623810plr.236.2023.01.26.13.52.56; Thu, 26 Jan 2023 13:53:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b2fcFkM1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233044AbjAZVgW (ORCPT + 99 others); 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-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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756123617184784083?= X-GMAIL-MSGID: =?utf-8?q?1756123617184784083?= 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;