From nobody Tue Dec 16 21:02:20 2025 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 B790FC38142 for ; Mon, 23 Jan 2023 13:38:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231861AbjAWNid (ORCPT ); Mon, 23 Jan 2023 08:38:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231874AbjAWNi2 (ORCPT ); Mon, 23 Jan 2023 08:38:28 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9C7413D48 for ; Mon, 23 Jan 2023 05:38:26 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id vw16so30487744ejc.12 for ; Mon, 23 Jan 2023 05:38:26 -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=ehxoyvaIc4ExsaI/5CJUPfW8cWsLvfgBKNN5d4+uPKk=; b=VR9HWOoPmixdQ4AjASWT9GZdYWGZAxSM7xbdZfaviE3YAo/5HeiFmBKL/hUn1nxS9g MtnvUlrKh5U5QhhmQ+RJpyC82kkarTzSYjtpZcv+TI0fAycBP+EGc9xHFdHNR//kf6kQ bb1a68ssbXUmSJKtGHGskPCAEerSQ9YdEg/Fx6GlTCY03tElN/br7HGGyV3e5ZZLVL5O cvSR+A2qS0EyGI3iq38cvgbdn67T16fvExwx7QV/aUr9DbWrYO0TWeK4F1mPTnzehA6x zYFP3sPvAG88j5hIGwdVn5QOUbxcxvNRXI2IPFLEGanTS/tmgIq9Q7/+k7TqRqlF67TB xiDw== 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=ehxoyvaIc4ExsaI/5CJUPfW8cWsLvfgBKNN5d4+uPKk=; b=IV6FOaotQ65rVXh8wJyEoQVFADtmtxhpjw9KAc6pMCDEsg/GSEVGnr7yb/9jv491/1 RHqlQlxHAceDszbxps7KGcLAbhtoGiAl6sTsff+3S6HurAFXGhyFSPJISmLuq/VQC5wc /EFAnOTKvMydvoWu8dlHYF3geJ48wNx8p3teTZQyM2Q68SuiHB2bRLJNWr4w/uf8nGax hkS+iCoDnavurG7egQVqBt/w6L23nn5DAA181CQPrqXtaZEkZ3ahhznZJx9UYStoHY9x cokRdiZ55V/gYBuoSe3iCMkxzkEgf5n0DbaRpN85rsQVtp1ptRfSwgSacnffLO61b4Xw dAQw== X-Gm-Message-State: AFqh2kqgwXPYkStMoA07mR8QaeesSYnmM29Cd/hItZgoX6DRK8jQ81o9 51Xwdj0qeqw1LD8o1cS8gZD0EQ== X-Google-Smtp-Source: AMrXdXsRRAXoiK6hJwxk8oz7TxWkF28p/lA+lqmYR6NW373WGtg3B8wN4nvjZIl531gHEA6tLth5zw== X-Received: by 2002:a17:907:6d0e:b0:871:7b6f:9c53 with SMTP id sa14-20020a1709076d0e00b008717b6f9c53mr33986620ejc.30.1674481105281; Mon, 23 Jan 2023 05:38:25 -0800 (PST) Received: from Lat-5310.dev.rtsoft.ru ([87.116.163.233]) by smtp.gmail.com with ESMTPSA id s1-20020aa7cb01000000b00463b9d47e1fsm21502050edt.71.2023.01.23.05.38.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 05:38:24 -0800 (PST) From: Andrey Konovalov To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, alexandre.torgue@foss.st.com, peppe.cavallaro@st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Andrey Konovalov Subject: [PATCH 1/2] dt-bindings: net: snps,dwmac: add snps,rx-clk-runs-in-lpi parameter Date: Mon, 23 Jan 2023 16:37:46 +0300 Message-Id: <20230123133747.18896-2-andrey.konovalov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230123133747.18896-1-andrey.konovalov@linaro.org> References: <20230123133747.18896-1-andrey.konovalov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This patch adds a new parameter to the stmmac DT: snps,rx-clk-runs-in-lpi. If this parameter is present in the device tree, the PHY should not stop RX_CLK after entering Rx LPI state. Signed-off-by: Andrey Konovalov --- Documentation/devicetree/bindings/net/snps,dwmac.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Docume= ntation/devicetree/bindings/net/snps,dwmac.yaml index e88a86623fce..771f09db4a3f 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -452,6 +452,11 @@ properties: description: Enable gating of the MAC TX clock during TX low-power mode =20 + snps,rx-clk-runs-in-lpi: + $ref: /schemas/types.yaml#/definitions/flag + description: + Keep RX_CLK from the PHY running in RX low-power mode + snps,multicast-filter-bins: $ref: /schemas/types.yaml#/definitions/uint32 description: --=20 2.34.1 From nobody Tue Dec 16 21:02:20 2025 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 A46E1C05027 for ; Mon, 23 Jan 2023 13:38:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231869AbjAWNik (ORCPT ); Mon, 23 Jan 2023 08:38:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231877AbjAWNig (ORCPT ); Mon, 23 Jan 2023 08:38:36 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23844D53D for ; Mon, 23 Jan 2023 05:38:31 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id mp20so30483892ejc.7 for ; Mon, 23 Jan 2023 05:38:31 -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=AK+/wzvr19IkadKcShT9VhU2Wbb6mjo7zPwMi9XuUSc=; b=nOUDGDEoCFHwdDvtbNtP91LAZ1Vjbqx5L4W/oFL4lsEwsdgirSvgMemgaA+2aP8DRr 0n/aF4rjdDEwJwGdCT2tmJYoNJElxtTTaIfjC6Jr+Up+0Ty294B8zRFOagBqLrvwmt83 DvTVOvrrU9FXdYJZNH3blaD1oGtDp2qQwrznx2f8dcr6LFGoatDyi+S4lnBF5iVu4nwp /ckbqKxbn4ELWFD2wmPRc4faakVo0o1z225Pt9ntBHwO/+Fm4m32eG6VKAsSUVVHEkx9 DdgQ0tPja+F4idUUtvZVqmeNG7LHqBnokB0jwxJ/Tf8Q+8OYPcUbKIMFUFTRS0h39imf nUPQ== 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=AK+/wzvr19IkadKcShT9VhU2Wbb6mjo7zPwMi9XuUSc=; b=20z3/f/IlkswXPOKN7uGx/Wg2AEhQevddX7LN19fqj0RghWGp3mUDBhZo52IWTr+fw ZidNYV4fX8+Kx8/Lrp5qnbl8HgBljI1YfihWM0Lpms69lfDS0l6CVSRVeiAUK95whuOu DVscm7bJr6QwRKPXMDccUJpOc/jofZcTLjK6x5/Iq5OH/oR3U0yFhGvmlFq6rIFiAPPR LWRyX/bTVjMGe2ZEf7yxtxzpsfU+SsksMald+KLrL4+q3GbJbEnsTDUxWn5n8i7GVBDY rgtYAJfM8vxSTEcGw15LRQPo/bu2dJuBYiImfK7yr0BrWOOPsevilXwEs+Pk6+ZjISOy 57NA== X-Gm-Message-State: AFqh2kreFvLvQLaqMLY5DHHcKDH4UD9NeVEsm3qiD4EIiB4DNVXB2Zb+ hfDTIkGgWa1qKBs90IX5/1F9jQ== X-Google-Smtp-Source: AMrXdXsuCu/CpLRug9+eoQ9tuAnNu0+lxPYf7lVb2TpwPEvPc5j/TURtpfbkmGLKqbjxJsHxsQ5JNQ== X-Received: by 2002:a17:907:a07b:b0:7c1:3f04:efa2 with SMTP id ia27-20020a170907a07b00b007c13f04efa2mr37544023ejc.29.1674481109546; Mon, 23 Jan 2023 05:38:29 -0800 (PST) Received: from Lat-5310.dev.rtsoft.ru ([87.116.163.233]) by smtp.gmail.com with ESMTPSA id s1-20020aa7cb01000000b00463b9d47e1fsm21502050edt.71.2023.01.23.05.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 05:38:29 -0800 (PST) From: Andrey Konovalov To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, alexandre.torgue@foss.st.com, peppe.cavallaro@st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Andrey Konovalov Subject: [PATCH 2/2] net: stmmac: consider snps,rx-clk-runs-in-lpi DT parameter Date: Mon, 23 Jan 2023 16:37:47 +0300 Message-Id: <20230123133747.18896-3-andrey.konovalov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230123133747.18896-1-andrey.konovalov@linaro.org> References: <20230123133747.18896-1-andrey.konovalov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" If snps,rx-clk-runs-in-lpi parameter is present in the device tree, the driver configures the PHY not to stop RX_CLK after entering Rx LPI state. Signed-off-by: Andrey Konovalov --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 +++ include/linux/stmmac.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/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, =20 stmmac_mac_set(priv, priv->ioaddr, true); if (phy && priv->dma_cap.eee) { - priv->eee_active =3D phy_init_eee(phy, 1) >=3D 0; + priv->eee_active =3D + phy_init_eee(phy, !priv->plat->rx_clk_runs_in_lpi) >=3D 0; priv->eee_enabled =3D stmmac_eee_init(priv); priv->tx_lpi_enabled =3D priv->eee_enabled; stmmac_set_eee_pls(priv, priv->hw, true); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/driver= s/net/ethernet/stmicro/stmmac/stmmac_platform.c index eb6d9cd8e93f..4dacda387fa4 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -468,6 +468,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8= *mac) plat->en_tx_lpi_clockgating =3D of_property_read_bool(np, "snps,en-tx-lpi-clockgating"); =20 + plat->rx_clk_runs_in_lpi =3D + of_property_read_bool(np, "snps,rx-clk-runs-in-lpi"); + /* Set the maxmtu to a default of JUMBO_LEN in case the * parameter is not present in the device tree. */ 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; --=20 2.34.1