From nobody Thu Nov 14 17:27:59 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 CDB2AEB64D7 for ; Wed, 21 Jun 2023 18:26:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230419AbjFUS01 (ORCPT ); Wed, 21 Jun 2023 14:26:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230142AbjFUS0S (ORCPT ); Wed, 21 Jun 2023 14:26:18 -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 A7C3A198E for ; Wed, 21 Jun 2023 11:26:15 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f9c2913133so9144035e9.1 for ; Wed, 21 Jun 2023 11:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687371974; x=1689963974; 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=ew/OjzgYg2nsW0kAROkz29zhVp2ggSYw8qH9w/3MfWE=; b=n6Qrtw98lb9RJIZ3WHsZmyS+biWZdAAD8pO3XorHwhSNypxDHdSpsc/DcdZn2wepf1 eeoKDOVpPuuUpfLGUv8Au6ECGFSan8lw9NwNAYv9oQJaGxeVandunPuMbdJtuVIG9LvQ yNiUt095Y8g+of78t6IIzuh7kONVQgsc+u8IR/Hf1b6NfSBHiytmSu/NkEfyIzOjV/JV DKUKL5muz+H6jvIW7FcYK0TY2/n8I7+oSfAKZn/Uzohi+qyg+iO6onmnZyNHAHnOGKqO 9TOeFhR6+KzFtZg61XWdXfAcuT83tEGvMvH6jPWjtX8YGxceNdmVt6l3hr5z1qMD9mb2 UC/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687371974; x=1689963974; 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=ew/OjzgYg2nsW0kAROkz29zhVp2ggSYw8qH9w/3MfWE=; b=k28BaEXwZ7yy5ev9IPzlxT5ZxscSLAJIbeNIXVQ0kxHE4G86/wsuzjL0ocshPK7Mew 9NJL+d8cSzbFrn4SxrQR5tgYiV/xU/orcpNt+oAY8trGn6U0tRTJAtlCHhbF6cPqU4ut Crns2up/HP9r0P+MKBt/wcTbDAzB6ATxZ12onMa2fCf8IGbogBbFsueKJw61QCOFTpqD aPuuO+b2nDhsGeMKVvYy1bcEKhOme9A6xpcK4iLm4w9a7NyKm8N35BA9QGejgqg9RGTO AVgfyK5tm3epN/8mUBX8BNqRgCp1FPaoW9czHpMFeLxG8IUPiMKESoSSz2Hwr8loywz7 8J/Q== X-Gm-Message-State: AC+VfDxlyXDBHG4idC103MDG/gR097lewRAKZuWzSn5Cs5vvUZhE8fwR 1xWwOanInoXVi6U2T4dy+Ji3Yg== X-Google-Smtp-Source: ACHHUZ5g8Bd2osHTM6eMARbkeDbcanxof28/KfBKN1/bOW0HcCripbW+ahgdGPn2t/CUqjH7+8vfjg== X-Received: by 2002:adf:f203:0:b0:30f:ca58:39ca with SMTP id p3-20020adff203000000b0030fca5839camr12679570wro.31.1687371974190; Wed, 21 Jun 2023 11:26:14 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a69f:8ee3:6907:ccdf]) by smtp.gmail.com with ESMTPSA id z13-20020adff74d000000b0030af15d7e41sm5176994wrp.4.2023.06.21.11.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 11:26: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 Subject: [PATCH net-next 02/12] net: stmmac: replace the sph_disable field with a flag Date: Wed, 21 Jun 2023 20:25:48 +0200 Message-Id: <20230621182558.544417-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230621182558.544417-1-brgl@bgdev.pl> References: <20230621182558.544417-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 --- 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..70e91bbef2a6 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; + data->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