From patchwork Mon Jan 23 13:37:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 47150 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1613405wrn; Mon, 23 Jan 2023 05:39:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXsPYoeLWFzpOAO9vMtixkYY4y8IfExfH3I8XlsBr3C14ixGOKrKLsDOM8xale7qnkZFUpEf X-Received: by 2002:a17:906:3616:b0:870:e329:5f2e with SMTP id q22-20020a170906361600b00870e3295f2emr25443890ejb.20.1674481196011; Mon, 23 Jan 2023 05:39:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674481195; cv=none; d=google.com; s=arc-20160816; b=EDa9R+oDGM4jMFaDtj+l//n2GWS/ei6JyKk0q+18sN6HvrS/+EvZMwoXr3LdfLzSYQ WZugr9CLH3/Npbz7Mu4uPpxbsT1s+gOmYN8je37W9fI4I94tFYeITSRUkytTxuiU+CW4 TFdUOeVIxjXHOU8Dv+D9jAfZ82DR3d7qd4pPNEUfEK9MP+MqBBV3wV4LmCWha/o98YLE SDFAyx2aWlj7mKHdp04UCVgAd89QJYfFEMNTRWRIMxWVuXSSV/nEHRWuHEabPC05vLGB YjdnIp7FDeEoKU6K2mVZbhFoOfzv5N4JRecYUC0D8FITNmpHaOUvVkbUsKD8YkadxcLC MH2w== 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=ehxoyvaIc4ExsaI/5CJUPfW8cWsLvfgBKNN5d4+uPKk=; b=I/2b+HH1xi87QwsSQZ2edXwkUH21TY9I1pRaPpN/iTpzs1iMELpwJ6HCCsNWfALuDe mdqB243TypLlLu+7hzGQutcqSJLceyes5Vsf18A1pbi1hrTNNVj1VHRbTMiJB/X2TmEo Y2TzBjAfOerSSH5jbqbFaGz4xiVoPoQ6tyEm9cTDQyopJHuu4WJVHzyVzC2St/2N3OBY GIHkLbWUjxSslFGDudksPoVOMGETYmeBC6iTbBuNsDD6Du+Hb0Mb/+FQ2ig2CGK4zvPN C93SKaQPkKTXfADcQ28P/CBjWFGshs2nPF7jlWromNeXs8pC79MeYC6eLxgCKnmJDQN7 exUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VR9HWOoP; 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 i8-20020a1709064fc800b007c6be268253si51090716ejw.608.2023.01.23.05.39.32; Mon, 23 Jan 2023 05:39:55 -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=VR9HWOoP; 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 S231852AbjAWNic (ORCPT + 99 others); Mon, 23 Jan 2023 08:38:32 -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-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 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?1755820794574014618?= X-GMAIL-MSGID: =?utf-8?q?1755820794574014618?= 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/Documentation/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 + 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: From patchwork Mon Jan 23 13:37:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 47151 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1613469wrn; Mon, 23 Jan 2023 05:40:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXt3CSk5HktrW1oblJMt8j//tbwm08azlc/qQo0y3FHZScbayCuveQoE/AzeS8bhLqqpHfnK X-Received: by 2002:a17:907:104d:b0:86e:d851:3a0a with SMTP id oy13-20020a170907104d00b0086ed8513a0amr34695710ejb.51.1674481203186; Mon, 23 Jan 2023 05:40:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674481203; cv=none; d=google.com; s=arc-20160816; b=FfY+lTM2L9CVBV2TaSKNlgHLaF5wEeHz7p4goob9lXyQ5M/Oh9hsqHpJH5Ro334W8q jOsw8kXIhuG2WjmFS5gYBr93BoUK2WnyjUT2lOmOOVp3+KvF9zsBUzwK3opzj0qdE8Zs bE2Va9+ps4OkvHUUSQz0qgx0fSXQ1wFzJK2nhl4+bfIJzsUy8AzADuqvEdFrJVwLVqrV y380/CQG9DLS/ZESO77exOJ23l6J+/T+jH0w/QS9Wq7OmeLfz8jvrQZPOG3OVPfMgcGQ dGZWMHTiAuvAgFbokCyFjn12bg7YDj6QjTzjd/4w5vdkhv0kYpWlEFdc8JUSn+CATIHe NXog== 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=AK+/wzvr19IkadKcShT9VhU2Wbb6mjo7zPwMi9XuUSc=; b=h2u7qEijirZ46fOgvvM1XJzHzIaZa36tlr7jgcQNWDX2QAMsa/eGpsYqRCVd9PSdfw wZx1n+89v1np1iOgphGQgswS/L6oTNlMcIKe8eibJ8XdnyF8qiVd/FPeOVpn9beQ8GiN zrkrxPEvQzoBNRERQ09vLB9K+OnpTQgnLGUmBWAbibz8zWeOfYPkSL+QIzM5Cb+ejorR Syt5Z4np3xwQiLENgLn4rYiyw7aliERf1rm1+DorqCvLfG2gs1Yf4sk70gOuR6QDn1t8 7cXHnL+VCYM28VDwXRL7sd1MRsB5kWIbENxhopQvl8QZHRQl+LmQI79xf+rMjxIbAjKJ 4JVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nOUDGDEo; 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 xc2-20020a170907074200b0084d1310711fsi58345808ejb.782.2023.01.23.05.39.39; Mon, 23 Jan 2023 05:40:03 -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=nOUDGDEo; 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 S231537AbjAWNij (ORCPT + 99 others); Mon, 23 Jan 2023 08:38:39 -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-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 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=ham 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?1755820801658413588?= X-GMAIL-MSGID: =?utf-8?q?1755820801658413588?= 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/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/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/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 = of_property_read_bool(np, "snps,en-tx-lpi-clockgating"); + plat->rx_clk_runs_in_lpi = + 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;