From patchwork Fri Jun 23 10:08:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 695973 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 21194EB64D7 for ; Fri, 23 Jun 2023 10:11:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231935AbjFWKLO (ORCPT ); Fri, 23 Jun 2023 06:11:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231905AbjFWKKT (ORCPT ); Fri, 23 Jun 2023 06:10:19 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3D6A30EF for ; Fri, 23 Jun 2023 03:09:08 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3090d3e9c92so682715f8f.2 for ; Fri, 23 Jun 2023 03:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687514947; x=1690106947; 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=/ds8NiiaWx7S6UP8O9D/ooCMxtDTCkVYtSDsiDSpfu8=; b=05CEclI0RNBG811nHybT4Wf80lxO/5ncTBmCTBZUwmnZJB+wENLgDJW7YoVimVGpsw QbEv1xphO/vYaGbskQWEgUFe2Kvn4oRjin1OYZh4LYRrjviR8fy4G/sc4g2su6mEcnT8 KKvz9uCVulrGi537aPDOocdZt4Wkpa0uBYxI9Blbu6aA0R+jAnuUEbgdDlHZy+hlTINu a0n9x6klMBJM6soYf5rOYX7X7auxd+l/YMQmNtj2DA22uNSlf6dBq7QYjYqF5SpMchKC H7530d/4fhVzqZ/TAABdazsKCEVMFA2MbHN/qQo0E4ldvwJyY9Yu2odiwa43pSwCJdY9 ZWPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687514947; x=1690106947; 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=/ds8NiiaWx7S6UP8O9D/ooCMxtDTCkVYtSDsiDSpfu8=; b=OTPqcFBgr8a4IILM2zxQgAnCr2cLnHrdIFnwnVygh6tjWI+1s/GDZfj6jo6rhlCIvW UGdHxjD4BfRAGKvUhRZcrSvhQEehrvF3NdgRAXvIPk4sEsxGVB3HLytQNY1fxI26iB+U GNGL6ISFa9IWK/abHEJjajeiEHU1yER6sWBByRbW6Y+x9HPRAtFhtwBx6qNjScW6z+EM DVK2RvjVvqToTUxAUqDoUvBzcLHZB3mjoNSgmMUaB377EIX+v4G60ETH/zQ7NWVPScrN Roa2cJgpL+qGjgBS6G/t09dRyF5CEPPKf5/0ucDTEZKtceYweiuvsDFNlDrdd5MdATPx 34SQ== X-Gm-Message-State: AC+VfDwSQZQtYd1zIZIm4OxECWq9kdjXaXhi3pXT+Pc++WN5azlDESrR eMdi7a/TuRuKLcUrgz47M+z6vA== X-Google-Smtp-Source: ACHHUZ5upJVkJxHOJd3gKTPyf7WvTtsGYzbtpLvkW3EB4LbPt3cmjmcCo5+rWdFRVSnc5yhWB90msw== X-Received: by 2002:adf:df81:0:b0:311:1cd7:68b3 with SMTP id z1-20020adfdf81000000b003111cd768b3mr21982343wrl.57.1687514947319; Fri, 23 Jun 2023 03:09:07 -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.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 03:09:06 -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 12/12] net: stmmac: replace the en_tx_lpi_clockgating field with a flag Date: Fri, 23 Jun 2023 12:08:45 +0200 Message-Id: <20230623100845.114085-13-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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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/stmmac_main.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 ++-- include/linux/stmmac.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 2d68a6e84b0e..efe85b086abe 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -421,7 +421,7 @@ static int stmmac_enable_eee_mode(struct stmmac_priv *priv) /* Check and enter in LPI mode */ if (!priv->tx_path_in_lpi_mode) stmmac_set_eee_mode(priv, priv->hw, - priv->plat->en_tx_lpi_clockgating); + priv->plat->flags & STMMAC_FLAG_EN_TX_LPI_CLOCKGATING); return 0; } diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 5a67af4526c7..0be3113197b1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -465,8 +465,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) plat->force_sf_dma_mode = of_property_read_bool(np, "snps,force_sf_dma_mode"); - plat->en_tx_lpi_clockgating = - of_property_read_bool(np, "snps,en-tx-lpi-clockgating"); + if (of_property_read_bool(np, "snps,en-tx-lpi-clockgating")) + plat->flags |= STMMAC_FLAG_EN_TX_LPI_CLOCKGATING; /* 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 c3769dad8238..ef67dba775d0 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -215,6 +215,7 @@ struct dwmac4_addrs { #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) +#define STMMAC_FLAG_EN_TX_LPI_CLOCKGATING BIT(11) struct plat_stmmacenet_data { int bus_id; @@ -280,7 +281,6 @@ struct plat_stmmacenet_data { int has_gmac4; int rss_en; int mac_port_sel_speed; - bool en_tx_lpi_clockgating; int has_xgmac; u8 vlan_fail_q; unsigned int eee_usecs_rate;