From patchwork Fri Jun 23 10:08:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 112035 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5665749vqr; Fri, 23 Jun 2023 03:23:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jlljsmR3XxEeiU4ZwDa/u9rKNOzHMP6IA8rsjCxfuAp2amoDrOiLY8xIX2zNJ4nHMtJmI X-Received: by 2002:a05:6830:1618:b0:6b5:e816:b650 with SMTP id g24-20020a056830161800b006b5e816b650mr5573054otr.25.1687515820106; Fri, 23 Jun 2023 03:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687515820; cv=none; d=google.com; s=arc-20160816; b=lRVPURpHq42h66CHMMTqeIefbUuh0f+AIjhMfh9ss7mPX6Yrttxn0MSl6eAfsBRFGV E4NK8EbKLRBxCeolSvCrj4Rbtt+1o/K0g1+HAQdbJ8ZlR2jLOYe0ntvRJkeGaiLZec5+ fSL1VnjYBkhZVIDuh/4H1tkBWJOxwhFxaUMFv0lDv57xg16qxGAX9xMGAWYEqodnR2YD mim6/+sDS0brC4dfU1G967Zd6nV7EPKZZMoi/UE9Lv+ZrB4kDMnB7GWKaK+ewC4IwxY0 Nuz8T0gngjxq91YdaXHwYg7ae16RWVdhajIU/5u1JvU+qEAeUFNJpm7V0aYFwN/Sy6Z4 lHqQ== 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=QwyUb1LcLxFuKvlYDOLM+hUXxmW+mTunlzrn4iVWnOo=; b=VN+oKbFZZMBzFn7NQErnfB0fpHnIHAuYjTrP87JVXtLEWGKBsKQGePLm9TXVGjJNqS iyJvNLyTuqLz4wND2KuzqVj2iMBhDmOF5pGlyIT5+80U0HZC8v7Uk0k3hRoUKIdRNfp6 JYXBi6oH795Yhi7vv4SxKqatz3qCrtGuz9dsTT0yKHFozJA2xD95q/rtSnGkP3tiweIY HPCaNn1t4WIbQVcPT/QKESSx/X30/mMCL6ApcKpjTpTLwUNyuSNnTKjFmbVEGCnbr6U4 dGsJa1KZN5Bv8yuT3/bAg5oO8Unry0Yjm6iVArQue3Gn0gEI9WPTf1mwvxWjOzCy0nJc ZJGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=0mmVBYGr; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a63b54b000000b0054fdafd5b45si883278pgo.740.2023.06.23.03.23.27; Fri, 23 Jun 2023 03:23:40 -0700 (PDT) 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=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=0mmVBYGr; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231905AbjFWKLR (ORCPT + 99 others); Fri, 23 Jun 2023 06:11:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231858AbjFWKKS (ORCPT ); Fri, 23 Jun 2023 06:10:18 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A9BB3A8E for ; Fri, 23 Jun 2023 03:09:07 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3113da5260dso443023f8f.2 for ; Fri, 23 Jun 2023 03:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514946; x=1690106946; 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=QwyUb1LcLxFuKvlYDOLM+hUXxmW+mTunlzrn4iVWnOo=; b=0mmVBYGrvOJOt+Jg5VZ0+zKW+YJWPhN5BKjhv/JMmHRQ99euFJfiQ7hDBHFm8wxebQ x9x3aNpCzEamSQrRKJBoatuR16RXW0X0LVYv0toaMt/AijJGi6BNlS+aG1iuPW6WAZu3 5MURUoFjAQLiREdG+zzRQ5v9m/sc4rrD6uzBuGvVydh+4Adk0pn0Wkn3sjGblzXQAmki I0o+KmZru/W8iSIyURvKsEtkhcVoS7MpfRS4V41ILnn6IfuVYT46pRIM9gqAaUIlvs2I 7CAZQiPTPKtuMhKui7b1fBzbVppytynni412lmmMYFToE3aNbmR5dbsiZ/1QPVCdNUDE AswA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514946; x=1690106946; 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=QwyUb1LcLxFuKvlYDOLM+hUXxmW+mTunlzrn4iVWnOo=; b=i+eX1VNUBR+tdM62Cv2+qIGz4zAWzi6nQw37hLjUm2MVJDUmgVraKD0aT6Fu6POr6i hn8KR7EmPG9dzUBLhp/9boK9TV4abNB2S8c2KT6EEVL/Jes5MyOqfWXNvzv+1EdUi6nr 2kY7C6Q8Lb2QUv1rP/PPZBTC9leoJzpgPTy7OnspzsrQVh9ICAhRnANfo3PLEpUDnV5r /vABqxuQd5XhOdY6N6N0G2nxlExAXY5jS38OoYrX6chwKE+j0lzr7C6JtjdBMjI83jhw d49z2MYmqFhmhXTaZ8zSPKIij1okjeAdrflTnzkIBgmQI62EAeCaWCTG2lX9KnljY0aT Qvew== X-Gm-Message-State: AC+VfDyplQtqakXrAPnKN3/dWOPb3JDBNckhxam8UntkpLdcPrKcOTxB kLwogikYlmph0OzowSQOMazsWw== X-Received: by 2002:a5d:43c2:0:b0:30f:c00d:8a7 with SMTP id v2-20020a5d43c2000000b0030fc00d08a7mr3285754wrr.44.1687514946092; Fri, 23 Jun 2023 03:09:06 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:ddc2:ce92:1ed6:27bd]) by smtp.gmail.com with ESMTPSA id k18-20020adfe8d2000000b0030ae3a6be4asm9278100wrn.72.2023.06.23.03.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:09:05 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next v2 11/12] net: stmmac: replace the rx_clk_runs_in_lpi field with a flag Date: Fri, 23 Jun 2023 12:08:44 +0200 Message-Id: <20230623100845.114085-12-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623100845.114085-1-brgl@bgdev.pl> References: <20230623100845.114085-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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?1769488588791100248?= X-GMAIL-MSGID: =?utf-8?q?1769488588791100248?= From: Bartosz Golaszewski Drop the boolean field of the plat_stmmacenet_data structure in favor of a simple bitfield flag. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- include/linux/stmmac.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 79e196397aea..743f2261b964 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -790,7 +790,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (of_property_read_bool(np, "snps,tso")) plat_dat->flags |= STMMAC_FLAG_TSO_EN; if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) - plat_dat->rx_clk_runs_in_lpi = 1; + plat_dat->flags |= STMMAC_FLAG_RX_CLK_RUNS_IN_LPI; if (data->has_integrated_pcs) plat_dat->flags |= STMMAC_FLAG_HAS_INTEGRATED_PCS; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index ebe82e7b50fc..2d68a6e84b0e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1085,7 +1085,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, !priv->plat->rx_clk_runs_in_lpi) >= 0; + phy_init_eee(phy, !(priv->plat->flags & + STMMAC_FLAG_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 47708ddd57fd..c3769dad8238 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -214,6 +214,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_MULTI_MSI_EN BIT(7) #define STMMAC_FLAG_EXT_SNAPSHOT_EN BIT(8) #define STMMAC_FLAG_INT_SNAPSHOT_EN BIT(9) +#define STMMAC_FLAG_RX_CLK_RUNS_IN_LPI BIT(10) struct plat_stmmacenet_data { int bus_id; @@ -280,7 +281,6 @@ 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; u8 vlan_fail_q; unsigned int eee_usecs_rate;