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;