From patchwork Wed Jun 21 18:25:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13287865 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5E0419E68 for ; Wed, 21 Jun 2023 18:26:19 +0000 (UTC) Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F29FF1996 for ; Wed, 21 Jun 2023 11:26:16 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3111cb3dda1so7129042f8f.0 for ; Wed, 21 Jun 2023 11:26:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687371975; x=1689963975; 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=R0OwBqk57PhsZ04IZ/thQPvSHwVfxueGqzoT1EHd/f0=; b=gXdVXlJTcS5XYEo51rAA4JlwFbLrG4KYmIfKfFEMJfyjsCe39ue7rCvQCs/Gm47qB4 bJrItSEK/CqlAUvrHnlGOshz1H7uqWkLRLQ8Hj23JDUdJgq6Tsau8Vj8Uzo3FDatkAut IDPiT9Il41Ab78s7xFRHzIBBL3ETf77C/+RcY3ZhokR2PcPkVhlTOWiK8b7xJ/3jCp1b USWaPGQNNwGxg5YfdCVVVv7Mm/LCG5PI3sG1b6IpB0V+U38EObFZbjVIcgccKX79bJAY b98y6vu2+0g9+LmJ+iIK/AsxM47nRu8w6leDmRCw8VUeE/yr4cmqQZjgwzfKorxVjm1c ybow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687371975; x=1689963975; 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=R0OwBqk57PhsZ04IZ/thQPvSHwVfxueGqzoT1EHd/f0=; b=RhQZqzQuT8wXtr2PM45k7gc3a8tZGWm+ckYsMfqVfHt7Z9tgnHKt8ZbBhqbHauORfR sm5u69nDDxqNeYVkax1JVz6XHjhY6Z5OTAN/Z4xtNhxHHkzkzv1CBSjPoRUnebW66bB5 lo6+Y0o/mSW3JCJfHAzY46XUrXsTGamCFoudfpseSS+fAHYVm6h7W7WP6ZBLEWm8gJeX P6yfzXrJpOvolv4af6rbgSN240VjDPfX7QOTY/d/TzijTagKBLRbvX3K+ZPaYH/YnFvd qjo4vve613RRyfFf1OfW44YjuShQ9U7dQz+gj5u7qJg4/d4uStsxai9Cla9YT0R/8NvR uCyA== X-Gm-Message-State: AC+VfDxIE9EoY4JIG5ioai0JXi5dD4W2TpZ8ZwH254zdKMhkQz1+WCfw HAQCiAE29cIypB/9H51/Zdt/eA== X-Google-Smtp-Source: ACHHUZ6ro2dY8kK22wivgUJLDisEOfpm9abhyjxSzeV3udAHBYE7eMFpsn15ij2gBjweFqUIcAwI4w== X-Received: by 2002:adf:fe48:0:b0:311:1b34:a7c9 with SMTP id m8-20020adffe48000000b003111b34a7c9mr14485298wrs.12.1687371975524; Wed, 21 Jun 2023 11:26:15 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 11:26: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 Subject: [PATCH net-next 03/12] net: stmmac: replace the use_phy_wol field with a flag Date: Wed, 21 Jun 2023 20:25:49 +0200 Message-Id: <20230621182558.544417-4-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> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Bartosz Golaszewski Drop the boolean field of the plat_stmmacenet_data structure in favor of a simple bitfield flag. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/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/net/ethernet/stmicro/stmmac/dwmac-intel.c index 70e91bbef2a6..44a84a6c18ce 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 = 8; plat->tx_queues_to_use = 8; - plat->use_phy_wol = 1; + plat->flags |= STMMAC_FLAG_USE_PHY_WOL; plat->safety_feat_cfg->tsoee = 1; plat->safety_feat_cfg->mrxpee = 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; plat->interface = priv_plat->phy_mode; - plat->use_phy_wol = priv_plat->mac_wol ? 0 : 1; + if (priv_plat->mac_wol) + plat->flags |= STMMAC_FLAG_USE_PHY_WOL; + else + plat->flags &= ~STMMAC_FLAG_USE_PHY_WOL; plat->riwt_off = 1; plat->maxmtu = ETH_DATA_LEN; plat->host_dma_width = priv_plat->variant->dma_bit_mask; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/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 = priv->dma_cap.enh_desc; priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up && - !priv->plat->use_phy_wol; + !(priv->plat->flags & STMMAC_FLAG_USE_PHY_WOL); priv->hw->pmt = priv->plat->pmt; if (priv->dma_cap.hash_tb_sz) { priv->hw->multicast_filter_bins = 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 { #define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0) #define STMMAC_FLAG_SPH_DISABLE BIT(1) +#define STMMAC_FLAG_USE_PHY_WOL BIT(2) 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;