From nobody Thu Nov 14 17:33:32 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 --- 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