From nobody Thu Nov 14 05:55:51 2024 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 49A8BC001B0 for ; Mon, 10 Jul 2023 09:00:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229659AbjGJJAV (ORCPT ); Mon, 10 Jul 2023 05:00:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232113AbjGJJAP (ORCPT ); Mon, 10 Jul 2023 05:00:15 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B5FAC9 for ; Mon, 10 Jul 2023 02:00:14 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2b6b98ac328so61893371fa.0 for ; Mon, 10 Jul 2023 02:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1688979612; x=1691571612; 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=ldjnmfjuHGS5I55mzTOKMh4kE3v23F5j9MAIR1nY9bo=; b=F1kreUToXPsJ6Yq0Kp9qLuCQkZLUPy75QODJ3HdKF1/6Wb8XYkh0/S/J8tGcClnA2P BY4rG6HGWiTt0gQsow8FV5oMqOS1ShXp6Rpe4Dfl2irBlMpBUgauzJjlwZqY1Q3Yug/Q mKCf1UvS8uWVUcYD6YktLMEFcyRifoi1oXdxJxTpdNhbNYo4L4A6ddRtFR7nSgv/YZL9 XJCwhCR9oNvvTrexaB19zQ1DuHyNUJMoQ3z3HpHRNV4MjcA8Fv2z84CrzwlrapLafucu LE9Nb9DusQxelX3+kz/7mcklvosGUpSmiCoPKiIlNN17LwIaR/UwFZMucGxUe5XDhGEG 2XQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688979612; x=1691571612; 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=ldjnmfjuHGS5I55mzTOKMh4kE3v23F5j9MAIR1nY9bo=; b=Zm2pph3LnFqJSTWxJB7efP67S83JDkHLeVbBfIDBnQMGuoUBSBo9/+ei/oYtBgeVV+ 9RxoTzAu0Nl6NQV1Z8wS5OW/948SEh1KbNtw1KSFDNLCu9i+BgY9TnQjC13p9TNCIib4 Vgs67U6P0ss6LcfPxH+LRS0q6xexWMNaYCjpHKyl56M3HPoXu6Dkf4oDuFuiyRcq3gFk KzlGavqtN6qVTymWhVUuoGkSlGPjGDDraWbnh19+jukIKgHLbuOTDjNXWFk/L2ltdV45 XEzIfv0dVVwZjjW6fPZk+1yPnbsVaR/UPkoMjkf4Iqw+WMH3TsGQYsqkhcEh6G6Z/uIE w1lw== X-Gm-Message-State: ABy/qLbRMN9O+4GcqRmpl//AtVzwuklfet7AMabBvmLL5i/klsEXmKhl 6TM3h1zxjj2c/Zwanhw/cBZSiQ== X-Google-Smtp-Source: APBJJlGRPy2fogXy7drxV05ZgYXiWSbfmzpdjVgo/I9+7T7LTWJ1gWiMUYTXSdrpwIrkoBvCiWBwhg== X-Received: by 2002:a2e:800a:0:b0:2b6:a76b:c39e with SMTP id j10-20020a2e800a000000b002b6a76bc39emr8578441ljg.35.1688979612292; Mon, 10 Jul 2023 02:00:12 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:6002:540:6954:abdd]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm8581045wmr.46.2023.07.10.02.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:00:11 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski , Andrew Halaney Subject: [PATCH net-next v3 01/12] net: stmmac: replace the has_integrated_pcs field with a flag Date: Mon, 10 Jul 2023 10:59:50 +0200 Message-Id: <20230710090001.303225-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230710090001.303225-1-brgl@bgdev.pl> References: <20230710090001.303225-1-brgl@bgdev.pl> 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" From: Bartosz Golaszewski struct plat_stmmacenet_data contains several boolean fields that could be easily replaced with a common integer 'flags' bitfield and bit defines. Start the process with the has_integrated_pcs field. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 3 ++- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- include/linux/stmmac.h | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index e62940414e54..a5e708534730 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -780,7 +780,8 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) plat_dat->tso_en =3D of_property_read_bool(np, "snps,tso"); if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) plat_dat->rx_clk_runs_in_lpi =3D 1; - plat_dat->has_integrated_pcs =3D data->has_integrated_pcs; + if (data->has_integrated_pcs) + plat_dat->flags |=3D STMMAC_FLAG_HAS_INTEGRATED_PCS; =20 if (ethqos->serdes_phy) { plat_dat->serdes_powerup =3D qcom_ethqos_serdes_powerup; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index 4727f7be4f86..38b6cbd8a133 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5798,7 +5798,8 @@ static void stmmac_common_interrupt(struct stmmac_pri= v *priv) } =20 /* PCS link status */ - if (priv->hw->pcs && !priv->plat->has_integrated_pcs) { + if (priv->hw->pcs && + !(priv->plat->flags & STMMAC_FLAG_HAS_INTEGRATED_PCS)) { if (priv->xstats.pcs_link) netif_carrier_on(priv->dev); else diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 06090538fe2d..8e7511071ef1 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -204,6 +204,8 @@ struct dwmac4_addrs { u32 mtl_low_cred_offset; }; =20 +#define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0) + struct plat_stmmacenet_data { int bus_id; int phy_addr; @@ -293,6 +295,6 @@ struct plat_stmmacenet_data { bool sph_disable; bool serdes_up_after_phy_linkup; const struct dwmac4_addrs *dwmac4_addrs; - bool has_integrated_pcs; + unsigned int flags; }; #endif --=20 2.39.2 From nobody Thu Nov 14 05:55:51 2024 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 8F752EB64DC for ; Mon, 10 Jul 2023 09:00:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232629AbjGJJAZ (ORCPT ); Mon, 10 Jul 2023 05:00:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbjGJJAQ (ORCPT ); Mon, 10 Jul 2023 05:00:16 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BF63F4 for ; Mon, 10 Jul 2023 02:00:15 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fbc244d384so43124495e9.0 for ; Mon, 10 Jul 2023 02:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1688979613; x=1691571613; 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=fyyBvpSV8LxDog0ek0zaEgbX3az6xRdpMaG/0FwAEzQ=; b=3x1HBwDRhKRpNZtS59+egzHon09AC6viqlxvkgig2u73jYmx2KoeiJv1WiGL7psptP oMeODFZTw3hjHXmYBX3QeVeNKw79pLtGo6r+NUK4N7fgNxD5BWuk2ZA8IRrXTOF3GNvY fy3dAOOguHIKIbIra8lHLXaDJ2jRzs4s3csIvTScXvBfxT2bCY0/yXUoHOeVYZyUI9AC Mr7vbwGBMJuGhmekxfISybKSynGEb/+sV5B81QyA/7tCGowtlyzQPum6C8WZmps/VrLm wx5ymFtihSkmQ9FjnCaVtJMJzrwb7VXinhrIMOtWXm5HiUsVkNJedZyIZk2jOb33wNds tO1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688979613; x=1691571613; 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=fyyBvpSV8LxDog0ek0zaEgbX3az6xRdpMaG/0FwAEzQ=; b=Y+nQrQReeZgdajH38Fyl3Pr7hVXG/AePWedS5+iFrq/pSmpibdPk/L8vnyFHfdoghH 5sZN/v6NMH2ZqnC8AdKzQI89OsJJ6mrfFS76IMlTSIO4Knq7+WyCtv3jqQVokZPnMLfV 36pC7BmaBrp7vUvgo/s7FPBlQh2OmqPzQzJ30EN0JHgSicEIz+Be+W66On1kPXEMRZ9C BlHACtMp2oA5MGSGDLusCYDyPxKZlxb1pnmbE6iWN/KyPbpEnnov2YXBs8P0KJAVxqol RtfFSvzXY4H7HkBHJKZ2JeG3VD+D+u/elKLY3QaavvwIFLuHX/CO5YH9/QQWg92Ou0CC 95aA== X-Gm-Message-State: ABy/qLZk2fVgAEo1MFX2SbcHZz1v/TP5nej1X5PY9/WGC3+ihEKP0mhm VObyElJ1aRjMdLVj/BqlUAWKjw== X-Google-Smtp-Source: APBJJlE0CWZzeJZ8TiwIWmaXT0WdMJVW73xR7UitbR/EEdZvdmMI1C9Osy594l6Z5i7AebtR9dEpZA== X-Received: by 2002:a05:600c:378b:b0:3fb:ffa8:6d78 with SMTP id o11-20020a05600c378b00b003fbffa86d78mr7014533wmr.36.1688979613585; Mon, 10 Jul 2023 02:00:13 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:6002:540:6954:abdd]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm8581045wmr.46.2023.07.10.02.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:00:13 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski , Andrew Halaney Subject: [PATCH net-next v3 02/12] net: stmmac: replace the sph_disable field with a flag Date: Mon, 10 Jul 2023 10:59:51 +0200 Message-Id: <20230710090001.303225-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230710090001.303225-1-brgl@bgdev.pl> References: <20230710090001.303225-1-brgl@bgdev.pl> 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" 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 Reviewed-by: Andrew Halaney Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- include/linux/stmmac.h | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c index 9f88530c5e8c..0c12ab67c27b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c @@ -359,7 +359,7 @@ static int tegra_eqos_probe(struct platform_device *pde= v, data->fix_mac_speed =3D tegra_eqos_fix_speed; data->init =3D tegra_eqos_init; data->bsp_priv =3D eqos; - data->sph_disable =3D 1; + data->flags |=3D STMMAC_FLAG_SPH_DISABLE; =20 err =3D tegra_eqos_init(pdev, eqos); if (err < 0) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/ne= t/ethernet/stmicro/stmmac/dwmac-intel.c index ab9f876b6df7..ae5db39a3f1b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -459,7 +459,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, plat->has_gmac4 =3D 1; plat->force_sf_dma_mode =3D 0; plat->tso_en =3D 1; - plat->sph_disable =3D 1; + plat->flags |=3D STMMAC_FLAG_SPH_DISABLE; =20 /* Multiplying factor to the clk_eee_i clock time * period to make it closer to 100 ns. This value diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index 38b6cbd8a133..18e56299363d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7258,7 +7258,8 @@ int stmmac_dvr_probe(struct device *device, dev_info(priv->device, "TSO feature enabled\n"); } =20 - if (priv->dma_cap.sphen && !priv->plat->sph_disable) { + if (priv->dma_cap.sphen && + !(priv->plat->flags & STMMAC_FLAG_SPH_DISABLE)) { ndev->hw_features |=3D NETIF_F_GRO; priv->sph_cap =3D true; priv->sph =3D priv->sph_cap; diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 8e7511071ef1..1b02f866316c 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -205,6 +205,7 @@ struct dwmac4_addrs { }; =20 #define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0) +#define STMMAC_FLAG_SPH_DISABLE BIT(1) =20 struct plat_stmmacenet_data { int bus_id; @@ -292,7 +293,6 @@ struct plat_stmmacenet_data { int msi_rx_base_vec; int msi_tx_base_vec; bool use_phy_wol; - bool sph_disable; bool serdes_up_after_phy_linkup; const struct dwmac4_addrs *dwmac4_addrs; unsigned int flags; --=20 2.39.2 From nobody Thu Nov 14 05:55:51 2024 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 271ACEB64D9 for ; Mon, 10 Jul 2023 09:00:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232937AbjGJJA2 (ORCPT ); Mon, 10 Jul 2023 05:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232328AbjGJJAS (ORCPT ); Mon, 10 Jul 2023 05:00:18 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5ED8C9 for ; Mon, 10 Jul 2023 02:00:16 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2b69dcf45faso65699751fa.0 for ; Mon, 10 Jul 2023 02:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1688979615; x=1691571615; 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=rSnjKOf9Ci1FVeqy2LquGwISKwhbeR055QIMuK7mc3Y=; b=5RNccCXJfgkU78ySq0JxTV7ZDkoePCzI4Hd3vmiYzokIy5xif5Ld1OgWceqXDnAOXx vsglSW572uQA6EyDjJUbeLXAASUP3pBzLTcLNRA2aqCvQsXgow6NVJQntG34phwd2quO HfQ09b/ietm+rHchyF5K3HIaTkmADw2xIk1i6JGT7k2+DKAtpi+thSbSiR+8ph185M9w nu91mRtbZ6qUhYC6rR1BLIPyhvbVvQSO1OCUhYyPc9DHSOofHToNYesvUqOmlilfZRU0 fjl/jgb5eNP/wa9CMqgHmvwoaPnz0QI/EyILqlZ0IiE/Hv+a4GvyNwULKuI8rx3TSs8n Rc1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688979615; x=1691571615; 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=rSnjKOf9Ci1FVeqy2LquGwISKwhbeR055QIMuK7mc3Y=; b=aQQ8uLuLsQ0wpedn2MpEHCIba4nLWtnmdO5+nWy7kRNBLUYAlgkiBOhez7wM1bVaGZ unZ+4k0TxLEnKeKiYkVW7pgu6B07fkd1HYnYaZNQT05IBRDANMciZzAI15awW9HXgW1a 3isn2bD1Yr4SY1BMMe3MeFCkZSlGMQJgk4fsNZFSM8W94Kz0AVH3528/j6lW7Xh6kk5G VuOC/lt2ztSsSbBG8f1FvBVMdxPFp8RBxtqljxUy/O1IF+S5zANMYykbCtBCPSX3+u8J PQnqBX2hO4B7uhp4B8gkQ6kbHzLJQEHBMRRPJdvyx/xiQh8EsIEQZVEE/Ud+M4YtEvla e6sA== X-Gm-Message-State: ABy/qLZ8gVAf+2EkB4GlUITcSKo+gDV/D1pE1uh98aS37QXfu43GlsNC SqF1bypE5za8NjYnF3a4jgUTvQ== X-Google-Smtp-Source: APBJJlGrmMHbn5NWmO1YYJIzI2TwRS9P95sAVzPdhjld7BDQunPplwuCb9f+WXNybWCnGYh+SMKk/w== X-Received: by 2002:a2e:8909:0:b0:2b6:9f5d:e758 with SMTP id d9-20020a2e8909000000b002b69f5de758mr10327512lji.9.1688979614960; Mon, 10 Jul 2023 02:00:14 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:6002:540:6954:abdd]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm8581045wmr.46.2023.07.10.02.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:00:14 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski , Andrew Halaney Subject: [PATCH net-next v3 03/12] net: stmmac: replace the use_phy_wol field with a flag Date: Mon, 10 Jul 2023 10:59:52 +0200 Message-Id: <20230710090001.303225-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230710090001.303225-1-brgl@bgdev.pl> References: <20230710090001.303225-1-brgl@bgdev.pl> 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" 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 Reviewed-by: Andrew Halaney Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 5 ++++- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- include/linux/stmmac.h | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/ne= t/ethernet/stmicro/stmmac/dwmac-intel.c index ae5db39a3f1b..c690ec1b9bab 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -628,7 +628,7 @@ static int ehl_common_data(struct pci_dev *pdev, { plat->rx_queues_to_use =3D 8; plat->tx_queues_to_use =3D 8; - plat->use_phy_wol =3D 1; + plat->flags |=3D STMMAC_FLAG_USE_PHY_WOL; =20 plat->safety_feat_cfg->tsoee =3D 1; plat->safety_feat_cfg->mrxpee =3D 1; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers= /net/ethernet/stmicro/stmmac/dwmac-mediatek.c index 73c1dfa7ecb1..4d877d75642d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c @@ -588,7 +588,10 @@ static int mediatek_dwmac_common_data(struct platform_= device *pdev, int i; =20 plat->interface =3D priv_plat->phy_mode; - plat->use_phy_wol =3D priv_plat->mac_wol ? 0 : 1; + if (priv_plat->mac_wol) + plat->flags |=3D STMMAC_FLAG_USE_PHY_WOL; + else + plat->flags &=3D ~STMMAC_FLAG_USE_PHY_WOL; plat->riwt_off =3D 1; plat->maxmtu =3D ETH_DATA_LEN; plat->host_dma_width =3D priv_plat->variant->dma_bit_mask; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index 18e56299363d..a1a59af3961d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6877,7 +6877,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv) */ priv->plat->enh_desc =3D priv->dma_cap.enh_desc; priv->plat->pmt =3D priv->dma_cap.pmt_remote_wake_up && - !priv->plat->use_phy_wol; + !(priv->plat->flags & STMMAC_FLAG_USE_PHY_WOL); priv->hw->pmt =3D priv->plat->pmt; if (priv->dma_cap.hash_tb_sz) { priv->hw->multicast_filter_bins =3D diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 1b02f866316c..15fb07cc89c8 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -206,6 +206,7 @@ struct dwmac4_addrs { =20 #define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0) #define STMMAC_FLAG_SPH_DISABLE BIT(1) +#define STMMAC_FLAG_USE_PHY_WOL BIT(2) =20 struct plat_stmmacenet_data { int bus_id; @@ -292,7 +293,6 @@ struct plat_stmmacenet_data { int msi_sfty_ue_vec; int msi_rx_base_vec; int msi_tx_base_vec; - bool use_phy_wol; bool serdes_up_after_phy_linkup; const struct dwmac4_addrs *dwmac4_addrs; unsigned int flags; --=20 2.39.2 From nobody Thu Nov 14 05:55:51 2024 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 00EFFEB64DA for ; Mon, 10 Jul 2023 09:00:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232565AbjGJJAb (ORCPT ); Mon, 10 Jul 2023 05:00:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231721AbjGJJAT (ORCPT ); Mon, 10 Jul 2023 05:00:19 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 109ABF1 for ; Mon, 10 Jul 2023 02:00:18 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2b70bfc8db5so51069591fa.2 for ; Mon, 10 Jul 2023 02:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1688979616; x=1691571616; 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=vlS2w38hffS8t4N6lUNAXq/+lMan+tZQyWGhu3FkWxA=; b=0yJeyY12y2yMBYTKnaWk2D4D45ts2C7hpFy2VklnAx7gax/7Er05BJfkDhAxyNh+wr pcMaEoft3w+ZM197/AX7iA7lRncxslHNX5hzYSlf9xJ4bADIRmV1TmTUKnJ+rzLsScqr NI8hChAuw1W2DALoI8XZw8mlwVCIc2IrgYI/ygruQglANToUr4tZ+YIBlH0XKPvQvOJp xDl+Z5G0Z8kfkQSOAsLYwdXhS/fawjXgkIShEbiQbCHLsxPIBERF7gg6W8larfQkrb0W TjrPc9bttebVYlIhbAT/a82z9Bd7geef2qkkTR1CFwk51iQgwRjig7IsRu1yjflhYWVX BMpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688979616; x=1691571616; 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=vlS2w38hffS8t4N6lUNAXq/+lMan+tZQyWGhu3FkWxA=; b=GNqXD+bt9725UNfVcgNBGCrEJZcRRl9BTW+yoAysau5qf1xFM7YwMKdXTllp1KGjx0 Id7/ocpqohjQeTF/QTdty+6HtkNbEIcHSFlvLDDMNSikHTopk3K3tIUoT5sYEYtD9Hyn rU98HxJl/0OqCjw0XDe7nkevZ+5Tivh+PoDu+mTjHYZhXTwxjcru+FxvzDX5WQB8kZkq Ho/M0Dxx+GPD/ZcSzAzUXi4TaSjI2UlAS7ugZIw+DXPxAJKv8zraF87vUABMheDnRDhX TK3MM6YT8HPwPYlp6vn9jmUqvdJj/JeauFoTmLyFpsAhTvYhz/SxQkZFJOd2Y8x8EGjK fPNA== X-Gm-Message-State: ABy/qLbuKnVC1yX7TDNKbrguo5qFRneulw/ybtKLRXY50bt7c3d+tSBo VSn63CzVxosCCZ0MSMUfNwGrAQ== X-Google-Smtp-Source: APBJJlHNASJzAedMGym24eWQIWNlYk7Nuh0RZzw0WLGWmWCrcXMuL0a9kaTNNidQnkYaIL3HruML+g== X-Received: by 2002:a2e:98c7:0:b0:2b7:7c:d5a1 with SMTP id s7-20020a2e98c7000000b002b7007cd5a1mr9541393ljj.23.1688979616273; Mon, 10 Jul 2023 02:00:16 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:6002:540:6954:abdd]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm8581045wmr.46.2023.07.10.02.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:00:15 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski , Andrew Halaney Subject: [PATCH net-next v3 04/12] net: stmmac: replace the has_sun8i field with a flag Date: Mon, 10 Jul 2023 10:59:53 +0200 Message-Id: <20230710090001.303225-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230710090001.303225-1-brgl@bgdev.pl> References: <20230710090001.303225-1-brgl@bgdev.pl> 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" 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 Reviewed-by: Andrew Halaney Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- include/linux/stmmac.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/ne= t/ethernet/stmicro/stmmac/dwmac-sun8i.c index 1e714380d125..2b5ebb15bfda 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1227,7 +1227,7 @@ static int sun8i_dwmac_probe(struct platform_device *= pdev) plat_dat->interface =3D interface; plat_dat->rx_coe =3D STMMAC_RX_COE_TYPE2; plat_dat->tx_coe =3D 1; - plat_dat->has_sun8i =3D true; + plat_dat->flags |=3D STMMAC_FLAG_HAS_SUN8I; plat_dat->bsp_priv =3D gmac; plat_dat->init =3D sun8i_dwmac_init; plat_dat->exit =3D sun8i_dwmac_exit; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index a1a59af3961d..3df32658b5bb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -325,7 +325,7 @@ static void stmmac_clk_csr_set(struct stmmac_priv *priv) priv->clk_csr =3D STMMAC_CSR_250_300M; } =20 - if (priv->plat->has_sun8i) { + if (priv->plat->flags & STMMAC_FLAG_HAS_SUN8I) { if (clk_rate > 160000000) priv->clk_csr =3D 0x03; else if (clk_rate > 80000000) @@ -6856,7 +6856,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv) int ret; =20 /* dwmac-sun8i only work in chain mode */ - if (priv->plat->has_sun8i) + if (priv->plat->flags & STMMAC_FLAG_HAS_SUN8I) chain_mode =3D 1; priv->chain_mode =3D chain_mode; =20 diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 15fb07cc89c8..66dcf84d024a 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -207,6 +207,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0) #define STMMAC_FLAG_SPH_DISABLE BIT(1) #define STMMAC_FLAG_USE_PHY_WOL BIT(2) +#define STMMAC_FLAG_HAS_SUN8I BIT(3) =20 struct plat_stmmacenet_data { int bus_id; @@ -270,7 +271,6 @@ struct plat_stmmacenet_data { struct reset_control *stmmac_ahb_rst; struct stmmac_axi *axi; int has_gmac4; - bool has_sun8i; bool tso_en; int rss_en; int mac_port_sel_speed; --=20 2.39.2 From nobody Thu Nov 14 05:55:51 2024 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 3EB5BC001DD for ; Mon, 10 Jul 2023 09:00:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232979AbjGJJAi (ORCPT ); Mon, 10 Jul 2023 05:00:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232113AbjGJJAW (ORCPT ); Mon, 10 Jul 2023 05:00:22 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FB76F4 for ; Mon, 10 Jul 2023 02:00:20 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fb4146e8ceso44420875e9.0 for ; Mon, 10 Jul 2023 02:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1688979618; x=1691571618; 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=Rs3h3ox9QJXzxEXaQ8eFHHv1moh5d5VyZpUhlfQfPbk=; b=j/BZlydBM6wGl4yFCHFw1nv5xpiLEeyNu/cRugRSlHsmK+YmFnanXcerms6WxdxKDF fYOBivTSiQ08bWtKMJ5IqwCOtiprl4ZQZBvwzTDSWhtX3LobmjsY4vetGemgns2xKr+v +V8L8T5lnc/XCj9QBXJnNzIQxzF7iO0xnyPwlUEmwgERKki4Y98Df96+HOKuYDDHSoOL Z1VpnZkF4QKGmJCCvw2utD85WkStlwTRMu6pkOSCcmwBsxpMV5dmLf6VCrmk3q27u07e BKjkHYXe9w3BYt1quSm//4trXKPLE4sQsdH7QGUkL/xy63DXCuDDajS5NdeJMFIm8JjN Y37w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688979618; x=1691571618; 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=Rs3h3ox9QJXzxEXaQ8eFHHv1moh5d5VyZpUhlfQfPbk=; b=lYsfAef1Zdm+jq2hnQzO6H/O5PNWOtwOc8W/ui+SdTADqdHJoeZiijB8nlNwI9ITaZ Ym5mwBEOPgt3DKznDMcAv9uhKhJ8v0eX+RGIloKJ+MXzcAFmbNC6zfHTUIQwfBqRRSgP lZsRUVBKugjIUhKj+ikhQOSNmyNeiWc6i9i/Ev2cspaiHXayGwxhZZuYcKvm3YsS73OV ivqOvaikbomI/O4s/VG2nckTEExr5R9YwPOPMQHHiL8p7jEcnJmfz1HtnoL/XhKA9tN7 s6S9QazdHzkmyGtbIKB61HwOOAnwjRggchjv9KuoRbTC1TkRJqSJ8DCzwKW2uayo/tkk Fhug== X-Gm-Message-State: ABy/qLapB6z5ov8DP1Icvv/s6cjt7iPyKk6J7RDMAxCG/75Xuq+hf0zB Q15qzRrQzw3YfkjPZpVpnSz2Sw== X-Google-Smtp-Source: APBJJlHje8En2b/i7BLbuz5lOIAZsUxfaY03jH+dzCVkrzrzF0sBF+ijHOxW/3xsSCvhR+geHHMH9g== X-Received: by 2002:a05:600c:22c6:b0:3fa:96db:7b7c with SMTP id 6-20020a05600c22c600b003fa96db7b7cmr11945769wmg.35.1688979617591; Mon, 10 Jul 2023 02:00:17 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:6002:540:6954:abdd]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm8581045wmr.46.2023.07.10.02.00.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:00:17 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski , Andrew Halaney Subject: [PATCH net-next v3 05/12] net: stmmac: replace the tso_en field with a flag Date: Mon, 10 Jul 2023 10:59:54 +0200 Message-Id: <20230710090001.303225-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230710090001.303225-1-brgl@bgdev.pl> References: <20230710090001.303225-1-brgl@bgdev.pl> 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" 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 Reviewed-by: Andrew Halaney Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 3 +-- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 3 ++- drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 6 ++++-- include/linux/stmmac.h | 2 +- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c index 0c12ab67c27b..b5efd9c2eac7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c @@ -113,7 +113,7 @@ static int dwc_eth_dwmac_config_dt(struct platform_devi= ce *pdev, /* dwc-qos needs GMAC4, AAL, TSO and PMT */ plat_dat->has_gmac4 =3D 1; plat_dat->dma_cfg->aal =3D 1; - plat_dat->tso_en =3D 1; + plat_dat->flags |=3D STMMAC_FLAG_TSO_EN; plat_dat->pmt =3D 1; =20 return 0; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/ne= t/ethernet/stmicro/stmmac/dwmac-intel.c index c690ec1b9bab..faa6f4ec6838 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -458,8 +458,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, plat->has_gmac =3D 0; plat->has_gmac4 =3D 1; plat->force_sf_dma_mode =3D 0; - plat->tso_en =3D 1; - plat->flags |=3D STMMAC_FLAG_SPH_DISABLE; + plat->flags |=3D (STMMAC_FLAG_TSO_EN | STMMAC_FLAG_SPH_DISABLE); =20 /* Multiplying factor to the clk_eee_i clock time * period to make it closer to 100 ns. This value diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index a5e708534730..2692ccebea50 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -777,7 +777,8 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) if (ethqos->has_emac_ge_3) plat_dat->dwmac4_addrs =3D &data->dwmac4_addrs; plat_dat->pmt =3D 1; - plat_dat->tso_en =3D of_property_read_bool(np, "snps,tso"); + if (of_property_read_bool(np, "snps,tso")) + plat_dat->flags |=3D STMMAC_FLAG_TSO_EN; if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) plat_dat->rx_clk_runs_in_lpi =3D 1; if (data->has_integrated_pcs) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/ne= t/ethernet/stmicro/stmmac/dwmac-tegra.c index f8367c5b490b..5e8aa03cffae 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c @@ -290,7 +290,7 @@ static int tegra_mgbe_probe(struct platform_device *pde= v) } =20 plat->has_xgmac =3D 1; - plat->tso_en =3D 1; + plat->flags |=3D STMMAC_FLAG_TSO_EN; plat->pmt =3D 1; plat->bsp_priv =3D mgbe; =20 diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index 3df32658b5bb..73002ed923aa 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5677,7 +5677,7 @@ static netdev_features_t stmmac_fix_features(struct n= et_device *dev, features &=3D ~NETIF_F_CSUM_MASK; =20 /* Disable tso if asked by ethtool */ - if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { + if ((priv->plat->flags & STMMAC_FLAG_TSO_EN) && (priv->dma_cap.tsoen)) { if (features & NETIF_F_TSO) priv->tso =3D true; else @@ -7250,7 +7250,7 @@ int stmmac_dvr_probe(struct device *device, ndev->hw_features |=3D NETIF_F_HW_TC; } =20 - if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { + if ((priv->plat->flags & STMMAC_FLAG_TSO_EN) && (priv->dma_cap.tsoen)) { ndev->hw_features |=3D NETIF_F_TSO | NETIF_F_TSO6; if (priv->plat->has_gmac4) ndev->hw_features |=3D NETIF_F_GSO_UDP_L4; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net= /ethernet/stmicro/stmmac/stmmac_pci.c index 644bb54f5f02..352b01678c22 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c @@ -77,7 +77,7 @@ static int snps_gmac5_default_data(struct pci_dev *pdev, plat->clk_csr =3D 5; plat->has_gmac4 =3D 1; plat->force_sf_dma_mode =3D 1; - plat->tso_en =3D 1; + plat->flags |=3D STMMAC_FLAG_TSO_EN; plat->pmt =3D 1; =20 /* Set default value for multicast hash bins */ diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/driver= s/net/ethernet/stmicro/stmmac/stmmac_platform.c index 231152ee5a32..f51522cb0061 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -525,7 +525,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8= *mac) plat->has_gmac4 =3D 1; plat->has_gmac =3D 0; plat->pmt =3D 1; - plat->tso_en =3D of_property_read_bool(np, "snps,tso"); + if (of_property_read_bool(np, "snps,tso")) + plat->flags |=3D STMMAC_FLAG_TSO_EN; } =20 if (of_device_is_compatible(np, "snps,dwmac-3.610") || @@ -538,7 +539,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8= *mac) if (of_device_is_compatible(np, "snps,dwxgmac")) { plat->has_xgmac =3D 1; plat->pmt =3D 1; - plat->tso_en =3D of_property_read_bool(np, "snps,tso"); + if (of_property_read_bool(np, "snps,tso")) + plat->flags |=3D STMMAC_FLAG_TSO_EN; } =20 dma_cfg =3D devm_kzalloc(&pdev->dev, sizeof(*dma_cfg), diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 66dcf84d024a..47ae29a98835 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -208,6 +208,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_SPH_DISABLE BIT(1) #define STMMAC_FLAG_USE_PHY_WOL BIT(2) #define STMMAC_FLAG_HAS_SUN8I BIT(3) +#define STMMAC_FLAG_TSO_EN BIT(4) =20 struct plat_stmmacenet_data { int bus_id; @@ -271,7 +272,6 @@ struct plat_stmmacenet_data { struct reset_control *stmmac_ahb_rst; struct stmmac_axi *axi; int has_gmac4; - bool tso_en; int rss_en; int mac_port_sel_speed; bool en_tx_lpi_clockgating; --=20 2.39.2 From nobody Thu Nov 14 05:55:51 2024 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 D4799C001B0 for ; Mon, 10 Jul 2023 09:00:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232057AbjGJJAq (ORCPT ); Mon, 10 Jul 2023 05:00:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232524AbjGJJAX (ORCPT ); Mon, 10 Jul 2023 05:00:23 -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 0B87DEC for ; Mon, 10 Jul 2023 02:00:21 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-31297125334so3082067f8f.0 for ; Mon, 10 Jul 2023 02:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1688979619; x=1691571619; 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=pnHQ3fi87K++JEC2M0ntC2YZiqmq2Ji0WvPuznxbUTo=; b=N8FoaXMEK+aMYvF61rZfw/0IJ4HERniJB6QHkMAJLUCUK3l2YkHzy70XCo8BjSzWPf h1QZhe8KthJWFMd7Nq4hp97vsECYuL6KopLzZ2hJjvANNDOwIsV5Axlg4AItZDisHHPO 1ut/nE84+pvgcYK0xK5Rg6D6YnJuRasLI3LR46+t+HtSx5GgO6m9ygYRX2fsH6JzSrMu 5SVw/1bT06b2c8YRBfH9EJDa7AJrt0ij7pF6ZECKfvt/DT9+RxGwlH3OXzGHm0fRszzy yGbOuISYexvTTbCpcOr1NiRh9012pOpNrUmBvTYcNRDByckYTOog3YV6qKqssLdqcTaT QaSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688979619; x=1691571619; 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=pnHQ3fi87K++JEC2M0ntC2YZiqmq2Ji0WvPuznxbUTo=; b=FyCcBU40110eoBAvOqN330GLzaczs5bpze5U8Urj6km3mgxw18tRmI+UHkhN5aNr6b OfLcS3J8hIqpZtpzlxFwDf/Lauxk+07Pe2AB7aBHEXJUY3DWohXGEzmkpV4oO/DtN+fF URvPzSQHDebEAuAUV+l64aBdzQN3glXPRbEEtP+Dcr0wFLqkvVwZUUYKiX2NIom2hjg+ pDwicQTk1S16AwJOl7ZVypMrGh8IvvGARsX1NhfAzfIX0uDX5HIcq1Ia6vib8OXshwat 9c0I9lg+ShOfIZppuROUoqXxrIbPsLEBV1dSP6G/m2UhSNSv2jv81+GhE4v+oDwW9cG0 LXsg== X-Gm-Message-State: ABy/qLYZlk1/YMkE31bysmUYdqyR06XF7LplS4AuPzXSm0Q9wUa1iKrA LPO56OjfSMLMfVOqf5WihdoL7Q== X-Google-Smtp-Source: APBJJlGaYeE99qIjOJtk3m8CcGSQgsKCJBRsAEzPeWRKB/MswF8PGLBEKsqz3/EZ5OF3Hz63KsveXg== X-Received: by 2002:a5d:4529:0:b0:314:17ac:5bac with SMTP id j9-20020a5d4529000000b0031417ac5bacmr14239778wra.33.1688979619525; Mon, 10 Jul 2023 02:00:19 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:6002:540:6954:abdd]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm8581045wmr.46.2023.07.10.02.00.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:00:19 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski , Andrew Halaney Subject: [PATCH net-next v3 06/12] net: stmmac: replace the serdes_up_after_phy_linkup field with a flag Date: Mon, 10 Jul 2023 10:59:55 +0200 Message-Id: <20230710090001.303225-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230710090001.303225-1-brgl@bgdev.pl> References: <20230710090001.303225-1-brgl@bgdev.pl> 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" 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 Reviewed-by: Andrew Halaney Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 ++++++--- include/linux/stmmac.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/ne= t/ethernet/stmicro/stmmac/dwmac-tegra.c index 5e8aa03cffae..99e2e5a5cd60 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c @@ -337,7 +337,7 @@ static int tegra_mgbe_probe(struct platform_device *pde= v) /* Program SID */ writel(MGBE_SID, mgbe->hv + MGBE_WRAP_AXI_ASID0_CTRL); =20 - plat->serdes_up_after_phy_linkup =3D 1; + plat->flags |=3D STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP; =20 err =3D stmmac_dvr_probe(&pdev->dev, plat, &res); if (err < 0) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index 73002ed923aa..d444514db07e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -991,7 +991,8 @@ static void stmmac_mac_link_up(struct phylink_config *c= onfig, struct stmmac_priv *priv =3D netdev_priv(to_net_dev(config->dev)); u32 old_ctrl, ctrl; =20 - if (priv->plat->serdes_up_after_phy_linkup && priv->plat->serdes_powerup) + if ((priv->plat->flags & STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP) && + priv->plat->serdes_powerup) priv->plat->serdes_powerup(priv->dev, priv->plat->bsp_priv); =20 old_ctrl =3D readl(priv->ioaddr + MAC_CTRL_REG); @@ -3838,7 +3839,8 @@ static int __stmmac_open(struct net_device *dev, =20 stmmac_reset_queues_param(priv); =20 - if (!priv->plat->serdes_up_after_phy_linkup && priv->plat->serdes_powerup= ) { + if (!(priv->plat->flags & STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP) && + priv->plat->serdes_powerup) { ret =3D priv->plat->serdes_powerup(dev, priv->plat->bsp_priv); if (ret < 0) { netdev_err(priv->dev, "%s: Serdes powerup failed\n", @@ -7623,7 +7625,8 @@ int stmmac_resume(struct device *dev) stmmac_mdio_reset(priv->mii); } =20 - if (!priv->plat->serdes_up_after_phy_linkup && priv->plat->serdes_powerup= ) { + if (!(priv->plat->flags & STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP) && + priv->plat->serdes_powerup) { ret =3D priv->plat->serdes_powerup(ndev, priv->plat->bsp_priv); =20 diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 47ae29a98835..aeb3e75dc748 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -209,6 +209,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_USE_PHY_WOL BIT(2) #define STMMAC_FLAG_HAS_SUN8I BIT(3) #define STMMAC_FLAG_TSO_EN BIT(4) +#define STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP BIT(5) =20 struct plat_stmmacenet_data { int bus_id; @@ -293,7 +294,6 @@ struct plat_stmmacenet_data { int msi_sfty_ue_vec; int msi_rx_base_vec; int msi_tx_base_vec; - bool serdes_up_after_phy_linkup; const struct dwmac4_addrs *dwmac4_addrs; unsigned int flags; }; --=20 2.39.2 From nobody Thu Nov 14 05:55:51 2024 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 7AC11EB64D9 for ; Mon, 10 Jul 2023 09:00:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232491AbjGJJAw (ORCPT ); Mon, 10 Jul 2023 05:00:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232716AbjGJJA0 (ORCPT ); Mon, 10 Jul 2023 05:00:26 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A61D103 for ; Mon, 10 Jul 2023 02:00:22 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fbab0d0b88so40381375e9.0 for ; Mon, 10 Jul 2023 02:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1688979620; x=1691571620; 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=yqDy168k4TnvbweySqHfEZPadstBh9VaBWlyLgmDoG4=; b=4XppJ28QA7t1JSx0zGkQYQE+lcFRMRgyUHUeOKT+Xb+l3oojEo474/baSa9CEHJVne 46K5dUKzG2MlT2LlVRJ0H3VLK8/N6g7abwGtGNIt6+86GEtrq+WfFChXBlEH3JEzc2GJ 8B/OV4JOl7El3bon1Tay6tQJaN5Pxb4P+TGVcZQeMta3xTx7KUmSPulUle2T9DZ50ECR M2EahG5SrsyoXTudBFezKfkh15XlnV5D9LVqXJrY7OfTkvhaOcpd6I37kqOqwKr2oRnq JQhwD/InEs072T6LGrq39NcYZaCXUr1gyUwSQVCPX6GXfQa74MrVmCDsIemdY7LkSd3l Pq6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688979620; x=1691571620; 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=yqDy168k4TnvbweySqHfEZPadstBh9VaBWlyLgmDoG4=; b=Gp9HXv5lCO2o1flpxOwVm9Se5QBjsaHPAHgXE7YQfgTsWo+HbVEgea7w+PFE3f0uEk 7H4Y+yQFZirJouWYjmZPo/LPlt3Cdes8r4uFRcePWornB062IXPK5Sz6muYMeGD8YJdy lCBfXlFUaa9V3kcQLwnSGRydUMnRaKMHPT/D3LeuMVljnPfca4sp+bkITsZFim8jQzNw IJutsqF9iBg2S0HN6IuADtZxec+3W1M/GjvvUfJPNyhB1pZrBtJaWyA7beTKAhttyee1 +HCKRWARouO9K/nBt78k0RzKhTgqqG1EyUvvtV2TjvGCayZp6Xib7l2QlJNt+XG9m8eG i0eA== X-Gm-Message-State: ABy/qLbZ08nJKF3gXqRyF1BKVtiZxc0CnOjVmmxPYpuy0shifvNhbu17 mNzBJCr8Xo2Ndk9uKmKfm2QKPA== X-Google-Smtp-Source: APBJJlGujN4ftiSWThZXtM38s/Sf7sj7je+92ZALarqYsh+BvUKgcmZFzFsl5agwyjWOpH818Z6ueA== X-Received: by 2002:a1c:cc02:0:b0:3fb:4064:7e22 with SMTP id h2-20020a1ccc02000000b003fb40647e22mr4839145wmb.19.1688979620728; Mon, 10 Jul 2023 02:00:20 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:6002:540:6954:abdd]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm8581045wmr.46.2023.07.10.02.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:00:20 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski , Andrew Halaney Subject: [PATCH net-next v3 07/12] net: stmmac: replace the vlan_fail_q_en field with a flag Date: Mon, 10 Jul 2023 10:59:56 +0200 Message-Id: <20230710090001.303225-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230710090001.303225-1-brgl@bgdev.pl> References: <20230710090001.303225-1-brgl@bgdev.pl> 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" 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 Reviewed-by: Andrew Halaney Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.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-intel.c b/drivers/ne= t/ethernet/stmicro/stmmac/dwmac-intel.c index faa6f4ec6838..1f1bc99571a5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -560,7 +560,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, /* Set the maxmtu to a default of JUMBO_LEN */ plat->maxmtu =3D JUMBO_LEN; =20 - plat->vlan_fail_q_en =3D true; + plat->flags |=3D STMMAC_FLAG_VLAN_FAIL_Q_EN; =20 /* Use the last Rx queue */ plat->vlan_fail_q =3D plat->rx_queues_to_use - 1; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index d444514db07e..c5763f60c6ef 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6923,7 +6923,8 @@ static int stmmac_hw_init(struct stmmac_priv *priv) if (priv->dma_cap.tsoen) dev_info(priv->device, "TSO supported\n"); =20 - priv->hw->vlan_fail_q_en =3D priv->plat->vlan_fail_q_en; + priv->hw->vlan_fail_q_en =3D + (priv->plat->flags & STMMAC_FLAG_VLAN_FAIL_Q_EN); priv->hw->vlan_fail_q =3D priv->plat->vlan_fail_q; =20 /* Run HW quirks, if any */ diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index aeb3e75dc748..155cb11b1c8a 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -210,6 +210,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_HAS_SUN8I BIT(3) #define STMMAC_FLAG_TSO_EN BIT(4) #define STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP BIT(5) +#define STMMAC_FLAG_VLAN_FAIL_Q_EN BIT(6) =20 struct plat_stmmacenet_data { int bus_id; @@ -278,7 +279,6 @@ struct plat_stmmacenet_data { bool en_tx_lpi_clockgating; bool rx_clk_runs_in_lpi; int has_xgmac; - bool vlan_fail_q_en; u8 vlan_fail_q; unsigned int eee_usecs_rate; struct pci_dev *pdev; --=20 2.39.2 From nobody Thu Nov 14 05:55:51 2024 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 86CABEB64DA for ; Mon, 10 Jul 2023 09:00:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233042AbjGJJA6 (ORCPT ); Mon, 10 Jul 2023 05:00:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232819AbjGJJA2 (ORCPT ); Mon, 10 Jul 2023 05:00:28 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2B57F4 for ; Mon, 10 Jul 2023 02:00:23 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fbf1b82dc7so43528315e9.2 for ; Mon, 10 Jul 2023 02:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1688979622; x=1691571622; 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=0pIcENny5wyN4aPPTX4E5kR9KARmjXxn8moCsW/zSJ4=; b=qHi6944tfn6w2OwrVVheZEXG2d9WTo+xLq3PZ0U82Cb2ffAvFnmHpBpLdSUkfDWe4O ++6LVWYpeg4A2sxrONLsAJ7jjLcBfSilqscpHFXoMCMPDles2G2b5wMYWiIE6KqLpRdM ZOu3tTL9l6a/GJ1rsZl0aaySX9bD08RyXQbv+Z+zuP6/EiVAHWuGiZSSBdhua72/5Xdp nYegQtgjuflcZjTUXTrnTupLwVq2GMQBVAzJyl8aJ7ItI6FuhNFkjJb4Fe5FUzE0sjtf aQioqMAwNhSnuFvTALABdUSvclfKnb+6B+hTesZ5qU6vPEKqtdIt2dSyeWY2bNyYgsIB 7l1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688979622; x=1691571622; 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=0pIcENny5wyN4aPPTX4E5kR9KARmjXxn8moCsW/zSJ4=; b=S214yO9cApEoztmnTZzWZthYD5kl+KnC2OFbTpWDpFVV1QY3+6Eu6Yy0QMObhH4QeV adBdMAeUC19sy4N0baneWWsqIqwYArR5WgYdzhnwsXWJbbS0f//ms9TFdvImMBa3OL1D d2zkm68C6YU9vDXAD4vJLAaDR7Bxk++CAAsnfxs+mu7NFJrYPlEQAsAOqXips6neYRr4 b6cVrrBJL8zD0WXxelFoBUKlAoH2AOceyMb1sb65uYvEcri0g3JFPoXw7TN7YBRl3RAt kLvyqSoKed19lJ0H6ikWjZjeoGhv6wKzXjaLJVD0kOAPZQN/57rtm8Dh0yb27+K5bTsw ZaSw== X-Gm-Message-State: ABy/qLbk5TubHTh5oMUptzJdYWLMc2VAxN+Mr2PE71CfPfYicOnEGK8r /WDXnuWUFmWR0/ULrAHrrrFWIQ== X-Google-Smtp-Source: APBJJlF3vmekHxIVb3j8B+wKlmnAbsnqe6QaDOHCTG1RL+70XHfWoQqWSxwZM3a9bpcOPWpDVPhiBQ== X-Received: by 2002:a7b:c7d2:0:b0:3fb:b18e:9b1a with SMTP id z18-20020a7bc7d2000000b003fbb18e9b1amr11633905wmk.8.1688979622013; Mon, 10 Jul 2023 02:00:22 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:6002:540:6954:abdd]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm8581045wmr.46.2023.07.10.02.00.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:00:21 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski , Andrew Halaney Subject: [PATCH net-next v3 08/12] net: stmmac: replace the multi_msi_en field with a flag Date: Mon, 10 Jul 2023 10:59:57 +0200 Message-Id: <20230710090001.303225-9-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230710090001.303225-1-brgl@bgdev.pl> References: <20230710090001.303225-1-brgl@bgdev.pl> 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" 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 Reviewed-by: Andrew Halaney Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 4 ++-- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++--- include/linux/stmmac.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/ne= t/ethernet/stmicro/stmmac/dwmac-intel.c index 1f1bc99571a5..d8bcf9452197 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -953,7 +953,7 @@ static int stmmac_config_single_msi(struct pci_dev *pde= v, =20 res->irq =3D pci_irq_vector(pdev, 0); res->wol_irq =3D res->irq; - plat->multi_msi_en =3D 0; + plat->flags &=3D ~STMMAC_FLAG_MULTI_MSI_EN; dev_info(&pdev->dev, "%s: Single IRQ enablement successful\n", __func__); =20 @@ -1005,7 +1005,7 @@ static int stmmac_config_multi_msi(struct pci_dev *pd= ev, if (plat->msi_sfty_ue_vec < STMMAC_MSI_VEC_MAX) res->sfty_ue_irq =3D pci_irq_vector(pdev, plat->msi_sfty_ue_vec); =20 - plat->multi_msi_en =3D 1; + plat->flags |=3D STMMAC_FLAG_MULTI_MSI_EN; dev_info(&pdev->dev, "%s: multi MSI enablement successful\n", __func__); =20 return 0; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index c5763f60c6ef..ebe82e7b50fc 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3711,7 +3711,7 @@ static int stmmac_request_irq(struct net_device *dev) int ret; =20 /* Request the IRQ lines */ - if (priv->plat->multi_msi_en) + if (priv->plat->flags & STMMAC_FLAG_MULTI_MSI_EN) ret =3D stmmac_request_irq_multi_msi(dev); else ret =3D stmmac_request_irq_single(dev); @@ -5954,7 +5954,7 @@ static void stmmac_poll_controller(struct net_device = *dev) if (test_bit(STMMAC_DOWN, &priv->state)) return; =20 - if (priv->plat->multi_msi_en) { + if (priv->plat->flags & STMMAC_FLAG_MULTI_MSI_EN) { for (i =3D 0; i < priv->plat->rx_queues_to_use; i++) stmmac_msi_intr_rx(0, &priv->dma_conf.rx_queue[i]); =20 @@ -7169,7 +7169,8 @@ int stmmac_dvr_probe(struct device *device, priv->plat =3D plat_dat; priv->ioaddr =3D res->addr; priv->dev->base_addr =3D (unsigned long)res->addr; - priv->plat->dma_cfg->multi_msi_en =3D priv->plat->multi_msi_en; + priv->plat->dma_cfg->multi_msi_en =3D + (priv->plat->flags & STMMAC_FLAG_MULTI_MSI_EN); =20 priv->dev->irq =3D res->irq; priv->wol_irq =3D res->wol_irq; diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 155cb11b1c8a..3365b8071686 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -211,6 +211,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_TSO_EN BIT(4) #define STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP BIT(5) #define STMMAC_FLAG_VLAN_FAIL_Q_EN BIT(6) +#define STMMAC_FLAG_MULTI_MSI_EN BIT(7) =20 struct plat_stmmacenet_data { int bus_id; @@ -286,7 +287,6 @@ struct plat_stmmacenet_data { int ext_snapshot_num; bool int_snapshot_en; bool ext_snapshot_en; - bool multi_msi_en; int msi_mac_vec; int msi_wol_vec; int msi_lpi_vec; --=20 2.39.2 From nobody Thu Nov 14 05:55:51 2024 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 1E052C001DD for ; Mon, 10 Jul 2023 09:01:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231689AbjGJJBC (ORCPT ); Mon, 10 Jul 2023 05:01:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232930AbjGJJA2 (ORCPT ); Mon, 10 Jul 2023 05:00:28 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFCCA12A for ; Mon, 10 Jul 2023 02:00:24 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fb4146e8fcso30873685e9.0 for ; Mon, 10 Jul 2023 02:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1688979623; x=1691571623; 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=arDDTzx7rlx99hkVbX8UgR21nnOMmWn5Zowe4OJD140=; b=2iSQcnqhNfZiZIZ/3gO2EIjwl/BFEdHSROCid1fU6iH8aQLxCkkQMVY13xb3zb/Vns +kvNsQMGcKU2c8K/sGMchwkBRNUSXyoV3JdKBe6H1LVWusD+eXI8SOmjnuo4wpIXPbFh 0pGn/f6M49ssgJlDnCVRvYhmtvSYEGEIE37T58u098IQOj6j0bIqZKrTPrBnYsmWw7OO 1+ogD6HVxQ1OaouOZ3x4ZNW8764zqhxNSLS2rr/e1mGc2QkvJ37cX0U5Mia/CihNyVf9 jdZpe8LVPbGIkdLjNTxbtDCams/nhzSprJA8m/pxEDEy3DnvUR9cAnjProXIkTK8TK+D lRwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688979623; x=1691571623; 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=arDDTzx7rlx99hkVbX8UgR21nnOMmWn5Zowe4OJD140=; b=eFBDEWJdY8DuyjcaiH8fD2L+rbHv1wJX1IjYBZvMq4W9bdq7UbR3QwD9/xCZwzxQr+ ycBDrL58lWMLtuMk4HSwAsv+cs+Nm8Bi4vNYGHRRX4v7+jiQztdcgFri3fSwMidtwCX6 yY+7qgWIhnRsVpm3gR2gcY5sEY0XtdVXzv7JyEBzXRR1UKcZtDI3HxX0hc3M0uMGJLaL VOY0xpzW6E4+mO6SEoEYZTws+eY+axn8kg8Bq+0Oln9ADl9fIBn+xFWIT212kt6TGt/a IwAUqBOD3GC6Zz3RYD2bvTWcrAzjE2iYAG4NK550LF39e08ZJIsyc1ayay+CBBUW61gO mwBw== X-Gm-Message-State: ABy/qLbnkUAqxsqM5mgXNTBmyQqRuIBMHryfn6CUmv1Vyedx4uUhcHjw PRKLxcecBlJDsyFntePWzi2BLQ== X-Google-Smtp-Source: APBJJlFo6fjKgcdQJbxXJOik5SZgI9KLZeUeclm33D7nrQbeNuwS9n/s+U+8k1vsFtlMk7zw/qxE8Q== X-Received: by 2002:a05:600c:d4:b0:3fb:af9a:bf30 with SMTP id u20-20020a05600c00d400b003fbaf9abf30mr11156882wmm.2.1688979623287; Mon, 10 Jul 2023 02:00:23 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:6002:540:6954:abdd]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm8581045wmr.46.2023.07.10.02.00.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:00:22 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski , Andrew Halaney Subject: [PATCH net-next v3 09/12] net: stmmac: replace the ext_snapshot_en field with a flag Date: Mon, 10 Jul 2023 10:59:58 +0200 Message-Id: <20230710090001.303225-10-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230710090001.303225-1-brgl@bgdev.pl> References: <20230710090001.303225-1-brgl@bgdev.pl> 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" 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 Reviewed-by: Andrew Halaney Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 5 ++++- include/linux/stmmac.h | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/ne= t/ethernet/stmicro/stmmac/dwmac-intel.c index d8bcf9452197..a3d0da4e9e91 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -326,7 +326,7 @@ static int intel_crosststamp(ktime_t *device, /* Both internal crosstimestamping and external triggered event * timestamping cannot be run concurrently. */ - if (priv->plat->ext_snapshot_en) + if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN) return -EBUSY; =20 priv->plat->int_snapshot_en =3D 1; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/driver= s/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c index 8b50f03056b7..afd81aac6644 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c @@ -195,7 +195,7 @@ static void timestamp_interrupt(struct stmmac_priv *pri= v) */ ts_status =3D readl(priv->ioaddr + GMAC_TIMESTAMP_STATUS); =20 - if (!priv->plat->ext_snapshot_en) + if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN) return; =20 num_snapshot =3D (ts_status & GMAC_TIMESTAMP_ATSNS_MASK) >> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net= /ethernet/stmicro/stmmac/stmmac_ptp.c index b4388ca8d211..3d7825cb30bb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c @@ -192,7 +192,10 @@ static int stmmac_enable(struct ptp_clock_info *ptp, write_unlock_irqrestore(&priv->ptp_lock, flags); break; case PTP_CLK_REQ_EXTTS: - priv->plat->ext_snapshot_en =3D on; + if (on) + priv->plat->flags |=3D STMMAC_FLAG_EXT_SNAPSHOT_EN; + else + priv->plat->flags &=3D ~STMMAC_FLAG_EXT_SNAPSHOT_EN; mutex_lock(&priv->aux_ts_lock); acr_value =3D readl(ptpaddr + PTP_ACR); acr_value &=3D ~PTP_ACR_MASK; diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 3365b8071686..0a77e8b05d3a 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -212,6 +212,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP BIT(5) #define STMMAC_FLAG_VLAN_FAIL_Q_EN BIT(6) #define STMMAC_FLAG_MULTI_MSI_EN BIT(7) +#define STMMAC_FLAG_EXT_SNAPSHOT_EN BIT(8) =20 struct plat_stmmacenet_data { int bus_id; @@ -286,7 +287,6 @@ struct plat_stmmacenet_data { int int_snapshot_num; int ext_snapshot_num; bool int_snapshot_en; - bool ext_snapshot_en; int msi_mac_vec; int msi_wol_vec; int msi_lpi_vec; --=20 2.39.2 From nobody Thu Nov 14 05:55:51 2024 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 13FFAEB64D9 for ; Mon, 10 Jul 2023 09:01:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230465AbjGJJBI (ORCPT ); Mon, 10 Jul 2023 05:01:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232902AbjGJJAx (ORCPT ); Mon, 10 Jul 2023 05:00:53 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A99ACF9 for ; Mon, 10 Jul 2023 02:00:26 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fbc5d5742bso47075855e9.2 for ; Mon, 10 Jul 2023 02:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1688979624; x=1691571624; 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=JCzrmvkrxX95lDclfxkC13FB8OPqOuOJRmb8eYD2LXk=; b=lzmr5H2JyLJZFSR1HX8BP7gWgcc1XuSawLvPgFsX4qK5Gqn6JS9jVHG/vDnDsGGqVF PVQZTidPzwIWrJoUPjxRWKGmZN+Wn/csnu/odgbtP/oYq9sAk3U8Yry1oZur8//i1Q/H K6d1DTHJbDwvkxTxxYYtp+6Q6zAffKPvCOOX9joq/lrd1GG0hq+vTF6eJ+0fG6v0vKua 41OxPANg6SG5hItVLVOEH9rmn2CODLbJdeqfjkIfbylHZIh2Q0qjCec8Ci5P6jhxAKgL kCvsFHUq0Bm4GieP8DKKy3ub4kVYiYau3eKzXZ8gomEEqh5RJ2RbsGVFaIYtT5j8okSq TpIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688979624; x=1691571624; 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=JCzrmvkrxX95lDclfxkC13FB8OPqOuOJRmb8eYD2LXk=; b=UaVxv3q4LXPqf9YljBuve/IDobiZI/cXIa4r7T+WNLfITB6/lfUVTl0Zt0mR24bseF HK4ajtid95oOAcCB+BZsDFFBWaiwuOyxp5bNiYU94NAWmP5FkigqMHYG22ptzf2kDJ99 B9zBEucB0j/Sjh6SdXdbMcgs8mHugLoJ4Op6hILCmdMtSYsd5sItOjmxvSmxvsubcuOT euMJ13NkHAY4GRcMHN7IK5Hosddm3II9E3f/rcgfZUP2v1o6E47moBN1SrCPpNL0Qdzy Z1pR2QOJHND8ORDS/SSRU2hdbCaQcUaIAqizKfUZYh22mPgwZeHrU+t5RX0auY10abM6 qsFA== X-Gm-Message-State: ABy/qLamEJllFcv7ix8Z4Pe303t+BEm7i7ETPZlg6bvYGQihNd7n+H1u E5ULdERNeIaWlDmwwog/9I07sw== X-Google-Smtp-Source: APBJJlE6D/TZ+GjwSXOMj+kecMOl3xY1WK0EcS6qAygHxCOclG4KnpRd6znUpyJJke/KJpWrsx3UJA== X-Received: by 2002:a1c:7416:0:b0:3fb:b3aa:1c88 with SMTP id p22-20020a1c7416000000b003fbb3aa1c88mr6693201wmc.26.1688979624591; Mon, 10 Jul 2023 02:00:24 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:6002:540:6954:abdd]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm8581045wmr.46.2023.07.10.02.00.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:00:24 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski , Andrew Halaney Subject: [PATCH net-next v3 10/12] net: stmmac: replace the int_snapshot_en field with a flag Date: Mon, 10 Jul 2023 10:59:59 +0200 Message-Id: <20230710090001.303225-11-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230710090001.303225-1-brgl@bgdev.pl> References: <20230710090001.303225-1-brgl@bgdev.pl> 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" 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 Reviewed-by: Andrew Halaney Reviewed-by: Simon Horman --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 10 +++++----- drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 2 +- include/linux/stmmac.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/ne= t/ethernet/stmicro/stmmac/dwmac-intel.c index a3d0da4e9e91..0ffae785d8bd 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -329,7 +329,7 @@ static int intel_crosststamp(ktime_t *device, if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN) return -EBUSY; =20 - priv->plat->int_snapshot_en =3D 1; + priv->plat->flags |=3D STMMAC_FLAG_INT_SNAPSHOT_EN; =20 mutex_lock(&priv->aux_ts_lock); /* Enable Internal snapshot trigger */ @@ -350,7 +350,7 @@ static int intel_crosststamp(ktime_t *device, break; default: mutex_unlock(&priv->aux_ts_lock); - priv->plat->int_snapshot_en =3D 0; + priv->plat->flags &=3D ~STMMAC_FLAG_INT_SNAPSHOT_EN; return -EINVAL; } writel(acr_value, ptpaddr + PTP_ACR); @@ -376,7 +376,7 @@ static int intel_crosststamp(ktime_t *device, if (!wait_event_interruptible_timeout(priv->tstamp_busy_wait, stmmac_cross_ts_isr(priv), HZ / 100)) { - priv->plat->int_snapshot_en =3D 0; + priv->plat->flags &=3D ~STMMAC_FLAG_INT_SNAPSHOT_EN; return -ETIMEDOUT; } =20 @@ -395,7 +395,7 @@ static int intel_crosststamp(ktime_t *device, } =20 system->cycles *=3D intel_priv->crossts_adj; - priv->plat->int_snapshot_en =3D 0; + priv->plat->flags &=3D ~STMMAC_FLAG_INT_SNAPSHOT_EN; =20 return 0; } @@ -609,7 +609,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, plat->ext_snapshot_num =3D AUX_SNAPSHOT0; =20 plat->crosststamp =3D intel_crosststamp; - plat->int_snapshot_en =3D 0; + plat->flags &=3D ~STMMAC_FLAG_INT_SNAPSHOT_EN; =20 /* Setup MSI vector offset specific to Intel mGbE controller */ plat->msi_mac_vec =3D 29; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/driver= s/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c index afd81aac6644..fa2c3ba7e9fe 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c @@ -180,7 +180,7 @@ static void timestamp_interrupt(struct stmmac_priv *pri= v) u64 ptp_time; int i; =20 - if (priv->plat->int_snapshot_en) { + if (priv->plat->flags & STMMAC_FLAG_INT_SNAPSHOT_EN) { wake_up(&priv->tstamp_busy_wait); return; } diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 0a77e8b05d3a..47708ddd57fd 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -213,6 +213,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_VLAN_FAIL_Q_EN BIT(6) #define STMMAC_FLAG_MULTI_MSI_EN BIT(7) #define STMMAC_FLAG_EXT_SNAPSHOT_EN BIT(8) +#define STMMAC_FLAG_INT_SNAPSHOT_EN BIT(9) =20 struct plat_stmmacenet_data { int bus_id; @@ -286,7 +287,6 @@ struct plat_stmmacenet_data { struct pci_dev *pdev; int int_snapshot_num; int ext_snapshot_num; - bool int_snapshot_en; int msi_mac_vec; int msi_wol_vec; int msi_lpi_vec; --=20 2.39.2 From nobody Thu Nov 14 05:55:51 2024 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 03EE2EB64D9 for ; Mon, 10 Jul 2023 09:01:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231978AbjGJJBY (ORCPT ); Mon, 10 Jul 2023 05:01:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233055AbjGJJA6 (ORCPT ); Mon, 10 Jul 2023 05:00:58 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 417A7FE for ; Mon, 10 Jul 2023 02:00:28 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2b6ff1ada5dso65167111fa.2 for ; Mon, 10 Jul 2023 02:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1688979626; x=1691571626; 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=DVtFhd0Km8syItagysZcPYxDGwV5P+/dGFTOfEg0+Yc=; b=CddbWTskACPRtMQSrRi4hJeH5Iup7rrWzy4Y8GGk40YSMoIVZ0micpUHWhleaEjv+U wKS3OBd0Nl397l8bwV8e9M1orYGwEMc0VG4rCfFxqiHRmVhQGKLtknOwXuDKrva7rglX ecl89XAzYl15aSaP8fCzOsRoecFyyGAu1YUaZr3d89Mfdb8ZmSgxo8+ONF6EVPjlJFPd OV+5BOOxYHddIf1neWL3qxjyUfhAEVkA3qZqZlwQt1hSI/UXdRieUC/ZQQvRVA7FEz4o +mAK24YMtG1mgMKy7fLp4WmXKocn32um2M+EeyMIzwCrCYQZ30cjEt/orHyh2Y1Cw7c7 6pGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688979626; x=1691571626; 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=DVtFhd0Km8syItagysZcPYxDGwV5P+/dGFTOfEg0+Yc=; b=gI2T1/uTsZUvZy9fWcV7Qk2W/Im5ka6Kk3xA0c09TGce0M5utYZmXQHlwO9or6X2/Y 5yRsdKLzFIEIZk3KLtR/CeKuq1c2zSiU0fgGn0kZhvpE+H8fG4SSDlM0sjU9gxYoD02s lLeshvDciI7WTS/4Unhs0lJmc9xjn4SIsyCG1Bb+ymTL8Gc/T5lcfBjZp5mc2C4XdvcV imJ3UXLcchb2fb64BsRADmIqksRkwhdvas1zfG5q/iusZVHiVt+YWf5X8u2/1pi0UwNz zB7oUmVaKrKviWL4YWsh1ROFj67rIwfDa3MV93g3Z0p72MwlE11Pgt/8U/Il225zkLFx 2oGg== X-Gm-Message-State: ABy/qLbpR04NpGXXL9kJICR7jZxbMxSSbLrGoNPlOPvbr0U008ShBcbe Hv/2xKigQEZuDf5pLKoJqVpxWQ== X-Google-Smtp-Source: APBJJlEP8RjYI6mEVqb8E5PCwkoT0tyhZKt8ufMjMDNngPcNAkchhf2+a4Mz1t5LkL2DBdggALs1DA== X-Received: by 2002:a2e:9815:0:b0:2b6:d8d5:15b1 with SMTP id a21-20020a2e9815000000b002b6d8d515b1mr8428218ljj.50.1688979625880; Mon, 10 Jul 2023 02:00:25 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:6002:540:6954:abdd]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm8581045wmr.46.2023.07.10.02.00.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:00:25 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski , Andrew Halaney Subject: [PATCH net-next v3 11/12] net: stmmac: replace the rx_clk_runs_in_lpi field with a flag Date: Mon, 10 Jul 2023 11:00:00 +0200 Message-Id: <20230710090001.303225-12-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230710090001.303225-1-brgl@bgdev.pl> References: <20230710090001.303225-1-brgl@bgdev.pl> 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" 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 Reviewed-by: Andrew Halaney Reviewed-by: Simon Horman --- 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/driv= ers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 2692ccebea50..fb593250c2e8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -780,7 +780,7 @@ static int qcom_ethqos_probe(struct platform_device *pd= ev) if (of_property_read_bool(np, "snps,tso")) plat_dat->flags |=3D STMMAC_FLAG_TSO_EN; if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) - plat_dat->rx_clk_runs_in_lpi =3D 1; + plat_dat->flags |=3D STMMAC_FLAG_RX_CLK_RUNS_IN_LPI; if (data->has_integrated_pcs) plat_dat->flags |=3D STMMAC_FLAG_HAS_INTEGRATED_PCS; =20 diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/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 =3D - phy_init_eee(phy, !priv->plat->rx_clk_runs_in_lpi) >=3D 0; + phy_init_eee(phy, !(priv->plat->flags & + STMMAC_FLAG_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/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) =20 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; --=20 2.39.2 From nobody Thu Nov 14 05:55:51 2024 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 697BFEB64D9 for ; Mon, 10 Jul 2023 09:01:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230416AbjGJJBg (ORCPT ); Mon, 10 Jul 2023 05:01:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232894AbjGJJA7 (ORCPT ); Mon, 10 Jul 2023 05:00:59 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EF121B4 for ; Mon, 10 Jul 2023 02:00:29 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fbc244d384so43128415e9.0 for ; Mon, 10 Jul 2023 02:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1688979627; x=1691571627; 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=o0rWskzXieUZbB116gf4yd7qvzoiqPrQgJ7WLt8WOY8=; b=kIhb6iVdgmZpI7b/3LkKN5H64ZHm72dF2AwRuA6RGp0LXEGkOBGORKjJVJAXV7GOCk cwLbqzHRwnfceM08unaFdJqsXZ6lrLJUnDoHFMutQiU7LCItZgXEM72L3GZVhoytyusH 1NMpP+7IXokgxZjtgoi6vdUkIojJWsA6dN3kMB1lmMRaBjOTgeVgkTySpHN3rydyM117 M6hWbp+IkDxKUeRimHNGazAijGXbtdZpUz72cPzNhbL5YNMgneYi+J5M6yulXJ7wpWuz yqSYn+SXiB+TfnV/Hi2B4qETNQ+bBzv4rbubW27wqmaFDY77Ncp7c/Cy2pp5eNucZ0hh Bqwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688979627; x=1691571627; 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=o0rWskzXieUZbB116gf4yd7qvzoiqPrQgJ7WLt8WOY8=; b=UH4MvMeRqjG+cN6M9BoWRvQWU5D9P7pL+XckDWeTqyTf/LZPCazJjrvcSuinFdb3Tr lwpOlUv/exyDU5vE9QU6JnXfk2l1KWclKJWk7QDBnLrc5+NY59uMyHpWut/V7V54Sg7W zdZ1FsCOWUYfvkR8U+mM7QgIdZLWqWLcRn0warkIXqsHoqjMku4glkpm3ugHxIg8vDRT 8y5up0lFPLmKcnE8OxoWPaAiCQndXvN1fDPWmK98H4luJxRV4PGv02UP3aHnGCVCw1Ej 4xP0axApKLWrRvtv9MGDzLkqOlFcAQLOMGmoV5ueEMvtgB58mzNyfpDLJb/zKjiCeKjb Ip1g== X-Gm-Message-State: ABy/qLaA39U7g/sq93WlNnwcDZqhHe16tyWfiDOvnTzmoZZuGX4iF5aC HI04y9tG5SqLe50Ba5k+KzTUHg== X-Google-Smtp-Source: APBJJlFVEFLv7NsAd9bHXGtmkXrMxRkAN54ouiP3rIZwa1lYBs3dSXHMX0+nk9m4mDprFRyW2m0WTw== X-Received: by 2002:a1c:7206:0:b0:3fb:8284:35b0 with SMTP id n6-20020a1c7206000000b003fb828435b0mr9602632wmc.30.1688979627723; Mon, 10 Jul 2023 02:00:27 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:6002:540:6954:abdd]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c0b4600b003fc00702f65sm8581045wmr.46.2023.07.10.02.00.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 02:00:27 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski , Andrew Halaney Subject: [PATCH net-next v3 12/12] net: stmmac: replace the en_tx_lpi_clockgating field with a flag Date: Mon, 10 Jul 2023 11:00:01 +0200 Message-Id: <20230710090001.303225-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230710090001.303225-1-brgl@bgdev.pl> References: <20230710090001.303225-1-brgl@bgdev.pl> 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" 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 Reviewed-by: Andrew Halaney Reviewed-by: Simon Horman --- 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/ne= t/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 *p= riv) /* 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; } =20 diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/driver= s/net/ethernet/stmicro/stmmac/stmmac_platform.c index f51522cb0061..23d53ea04b24 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -466,8 +466,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8= *mac) plat->force_sf_dma_mode =3D of_property_read_bool(np, "snps,force_sf_dma_mode"); =20 - plat->en_tx_lpi_clockgating =3D - of_property_read_bool(np, "snps,en-tx-lpi-clockgating"); + if (of_property_read_bool(np, "snps,en-tx-lpi-clockgating")) + plat->flags |=3D STMMAC_FLAG_EN_TX_LPI_CLOCKGATING; =20 /* 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) =20 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; --=20 2.39.2