* [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags
@ 2023-07-10 8:59 Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 01/12] net: stmmac: replace the has_integrated_pcs field with a flag Bartosz Golaszewski
` (14 more replies)
0 siblings, 15 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 8:59 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
As suggested by Jose Abreu: let's drop all 12 boolean fields in
plat_stmmacenet_data and replace them with a common bitfield.
v2 -> v3:
- fix build on intel platforms even more
- collect review tags from Andrew
v1 -> v2:
- fix build on intel platforms
Bartosz Golaszewski (12):
net: stmmac: replace the has_integrated_pcs field with a flag
net: stmmac: replace the sph_disable field with a flag
net: stmmac: replace the use_phy_wol field with a flag
net: stmmac: replace the has_sun8i field with a flag
net: stmmac: replace the tso_en field with a flag
net: stmmac: replace the serdes_up_after_phy_linkup field with a flag
net: stmmac: replace the vlan_fail_q_en field with a flag
net: stmmac: replace the multi_msi_en field with a flag
net: stmmac: replace the ext_snapshot_en field with a flag
net: stmmac: replace the int_snapshot_en field with a flag
net: stmmac: replace the rx_clk_runs_in_lpi field with a flag
net: stmmac: replace the en_tx_lpi_clockgating field with a flag
.../stmicro/stmmac/dwmac-dwc-qos-eth.c | 4 +-
.../net/ethernet/stmicro/stmmac/dwmac-intel.c | 23 +++++------
.../ethernet/stmicro/stmmac/dwmac-mediatek.c | 5 ++-
.../stmicro/stmmac/dwmac-qcom-ethqos.c | 8 ++--
.../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +-
.../net/ethernet/stmicro/stmmac/dwmac-tegra.c | 4 +-
.../ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 4 +-
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 40 +++++++++++--------
.../net/ethernet/stmicro/stmmac/stmmac_pci.c | 2 +-
.../ethernet/stmicro/stmmac/stmmac_platform.c | 10 +++--
.../net/ethernet/stmicro/stmmac/stmmac_ptp.c | 5 ++-
include/linux/stmmac.h | 26 ++++++------
12 files changed, 76 insertions(+), 57 deletions(-)
--
2.39.2
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH net-next v3 01/12] net: stmmac: replace the has_integrated_pcs field with a flag
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
@ 2023-07-10 8:59 ` Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 02/12] net: stmmac: replace the sph_disable " Bartosz Golaszewski
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 8:59 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski, Andrew Halaney
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
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 <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
---
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/drivers/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 *pdev)
plat_dat->tso_en = of_property_read_bool(np, "snps,tso");
if (of_device_is_compatible(np, "qcom,qcs404-ethqos"))
plat_dat->rx_clk_runs_in_lpi = 1;
- plat_dat->has_integrated_pcs = data->has_integrated_pcs;
+ if (data->has_integrated_pcs)
+ plat_dat->flags |= STMMAC_FLAG_HAS_INTEGRATED_PCS;
if (ethqos->serdes_phy) {
plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/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_priv *priv)
}
/* 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;
};
+#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
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v3 02/12] net: stmmac: replace the sph_disable field with a flag
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 01/12] net: stmmac: replace the has_integrated_pcs field with a flag Bartosz Golaszewski
@ 2023-07-10 8:59 ` Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 03/12] net: stmmac: replace the use_phy_wol " Bartosz Golaszewski
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 8:59 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski, Andrew Halaney
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
---
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/drivers/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 *pdev,
data->fix_mac_speed = tegra_eqos_fix_speed;
data->init = tegra_eqos_init;
data->bsp_priv = eqos;
- data->sph_disable = 1;
+ data->flags |= STMMAC_FLAG_SPH_DISABLE;
err = tegra_eqos_init(pdev, eqos);
if (err < 0)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/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 = 1;
plat->force_sf_dma_mode = 0;
plat->tso_en = 1;
- plat->sph_disable = 1;
+ plat->flags |= STMMAC_FLAG_SPH_DISABLE;
/* 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/net/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");
}
- if (priv->dma_cap.sphen && !priv->plat->sph_disable) {
+ if (priv->dma_cap.sphen &&
+ !(priv->plat->flags & STMMAC_FLAG_SPH_DISABLE)) {
ndev->hw_features |= NETIF_F_GRO;
priv->sph_cap = true;
priv->sph = 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 {
};
#define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0)
+#define STMMAC_FLAG_SPH_DISABLE BIT(1)
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;
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v3 03/12] net: stmmac: replace the use_phy_wol field with a flag
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 01/12] net: stmmac: replace the has_integrated_pcs field with a flag Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 02/12] net: stmmac: replace the sph_disable " Bartosz Golaszewski
@ 2023-07-10 8:59 ` Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 04/12] net: stmmac: replace the has_sun8i " Bartosz Golaszewski
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 8:59 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski, Andrew Halaney
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
---
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 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 = 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;
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v3 04/12] net: stmmac: replace the has_sun8i field with a flag
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
` (2 preceding siblings ...)
2023-07-10 8:59 ` [PATCH net-next v3 03/12] net: stmmac: replace the use_phy_wol " Bartosz Golaszewski
@ 2023-07-10 8:59 ` Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 05/12] net: stmmac: replace the tso_en " Bartosz Golaszewski
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 8:59 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski, Andrew Halaney
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
---
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/net/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 = interface;
plat_dat->rx_coe = STMMAC_RX_COE_TYPE2;
plat_dat->tx_coe = 1;
- plat_dat->has_sun8i = true;
+ plat_dat->flags |= STMMAC_FLAG_HAS_SUN8I;
plat_dat->bsp_priv = gmac;
plat_dat->init = sun8i_dwmac_init;
plat_dat->exit = sun8i_dwmac_exit;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/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 = STMMAC_CSR_250_300M;
}
- if (priv->plat->has_sun8i) {
+ if (priv->plat->flags & STMMAC_FLAG_HAS_SUN8I) {
if (clk_rate > 160000000)
priv->clk_csr = 0x03;
else if (clk_rate > 80000000)
@@ -6856,7 +6856,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
int ret;
/* dwmac-sun8i only work in chain mode */
- if (priv->plat->has_sun8i)
+ if (priv->plat->flags & STMMAC_FLAG_HAS_SUN8I)
chain_mode = 1;
priv->chain_mode = chain_mode;
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)
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;
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v3 05/12] net: stmmac: replace the tso_en field with a flag
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
` (3 preceding siblings ...)
2023-07-10 8:59 ` [PATCH net-next v3 04/12] net: stmmac: replace the has_sun8i " Bartosz Golaszewski
@ 2023-07-10 8:59 ` Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 06/12] net: stmmac: replace the serdes_up_after_phy_linkup " Bartosz Golaszewski
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 8:59 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski, Andrew Halaney
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
---
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/drivers/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_device *pdev,
/* dwc-qos needs GMAC4, AAL, TSO and PMT */
plat_dat->has_gmac4 = 1;
plat_dat->dma_cfg->aal = 1;
- plat_dat->tso_en = 1;
+ plat_dat->flags |= STMMAC_FLAG_TSO_EN;
plat_dat->pmt = 1;
return 0;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/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 = 0;
plat->has_gmac4 = 1;
plat->force_sf_dma_mode = 0;
- plat->tso_en = 1;
- plat->flags |= STMMAC_FLAG_SPH_DISABLE;
+ plat->flags |= (STMMAC_FLAG_TSO_EN | STMMAC_FLAG_SPH_DISABLE);
/* 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/drivers/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 *pdev)
if (ethqos->has_emac_ge_3)
plat_dat->dwmac4_addrs = &data->dwmac4_addrs;
plat_dat->pmt = 1;
- plat_dat->tso_en = of_property_read_bool(np, "snps,tso");
+ if (of_property_read_bool(np, "snps,tso"))
+ plat_dat->flags |= STMMAC_FLAG_TSO_EN;
if (of_device_is_compatible(np, "qcom,qcs404-ethqos"))
plat_dat->rx_clk_runs_in_lpi = 1;
if (data->has_integrated_pcs)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/net/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 *pdev)
}
plat->has_xgmac = 1;
- plat->tso_en = 1;
+ plat->flags |= STMMAC_FLAG_TSO_EN;
plat->pmt = 1;
plat->bsp_priv = mgbe;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/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 net_device *dev,
features &= ~NETIF_F_CSUM_MASK;
/* 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 = true;
else
@@ -7250,7 +7250,7 @@ int stmmac_dvr_probe(struct device *device,
ndev->hw_features |= NETIF_F_HW_TC;
}
- if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) {
+ if ((priv->plat->flags & STMMAC_FLAG_TSO_EN) && (priv->dma_cap.tsoen)) {
ndev->hw_features |= NETIF_F_TSO | NETIF_F_TSO6;
if (priv->plat->has_gmac4)
ndev->hw_features |= 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 = 5;
plat->has_gmac4 = 1;
plat->force_sf_dma_mode = 1;
- plat->tso_en = 1;
+ plat->flags |= STMMAC_FLAG_TSO_EN;
plat->pmt = 1;
/* Set default value for multicast hash bins */
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/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 = 1;
plat->has_gmac = 0;
plat->pmt = 1;
- plat->tso_en = of_property_read_bool(np, "snps,tso");
+ if (of_property_read_bool(np, "snps,tso"))
+ plat->flags |= STMMAC_FLAG_TSO_EN;
}
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 = 1;
plat->pmt = 1;
- plat->tso_en = of_property_read_bool(np, "snps,tso");
+ if (of_property_read_bool(np, "snps,tso"))
+ plat->flags |= STMMAC_FLAG_TSO_EN;
}
dma_cfg = 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)
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;
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v3 06/12] net: stmmac: replace the serdes_up_after_phy_linkup field with a flag
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
` (4 preceding siblings ...)
2023-07-10 8:59 ` [PATCH net-next v3 05/12] net: stmmac: replace the tso_en " Bartosz Golaszewski
@ 2023-07-10 8:59 ` Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 07/12] net: stmmac: replace the vlan_fail_q_en " Bartosz Golaszewski
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 8:59 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski, Andrew Halaney
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
---
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/net/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 *pdev)
/* Program SID */
writel(MGBE_SID, mgbe->hv + MGBE_WRAP_AXI_ASID0_CTRL);
- plat->serdes_up_after_phy_linkup = 1;
+ plat->flags |= STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP;
err = stmmac_dvr_probe(&pdev->dev, plat, &res);
if (err < 0)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/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 *config,
struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev));
u32 old_ctrl, ctrl;
- 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);
old_ctrl = readl(priv->ioaddr + MAC_CTRL_REG);
@@ -3838,7 +3839,8 @@ static int __stmmac_open(struct net_device *dev,
stmmac_reset_queues_param(priv);
- 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 = 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);
}
- 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 = priv->plat->serdes_powerup(ndev,
priv->plat->bsp_priv);
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)
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;
};
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v3 07/12] net: stmmac: replace the vlan_fail_q_en field with a flag
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
` (5 preceding siblings ...)
2023-07-10 8:59 ` [PATCH net-next v3 06/12] net: stmmac: replace the serdes_up_after_phy_linkup " Bartosz Golaszewski
@ 2023-07-10 8:59 ` Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 08/12] net: stmmac: replace the multi_msi_en " Bartosz Golaszewski
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 8:59 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski, Andrew Halaney
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
---
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/net/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 = JUMBO_LEN;
- plat->vlan_fail_q_en = true;
+ plat->flags |= STMMAC_FLAG_VLAN_FAIL_Q_EN;
/* Use the last Rx queue */
plat->vlan_fail_q = plat->rx_queues_to_use - 1;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/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");
- priv->hw->vlan_fail_q_en = priv->plat->vlan_fail_q_en;
+ priv->hw->vlan_fail_q_en =
+ (priv->plat->flags & STMMAC_FLAG_VLAN_FAIL_Q_EN);
priv->hw->vlan_fail_q = priv->plat->vlan_fail_q;
/* 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)
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;
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v3 08/12] net: stmmac: replace the multi_msi_en field with a flag
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
` (6 preceding siblings ...)
2023-07-10 8:59 ` [PATCH net-next v3 07/12] net: stmmac: replace the vlan_fail_q_en " Bartosz Golaszewski
@ 2023-07-10 8:59 ` Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 09/12] net: stmmac: replace the ext_snapshot_en " Bartosz Golaszewski
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 8:59 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski, Andrew Halaney
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
---
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/net/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 *pdev,
res->irq = pci_irq_vector(pdev, 0);
res->wol_irq = res->irq;
- plat->multi_msi_en = 0;
+ plat->flags &= ~STMMAC_FLAG_MULTI_MSI_EN;
dev_info(&pdev->dev, "%s: Single IRQ enablement successful\n",
__func__);
@@ -1005,7 +1005,7 @@ static int stmmac_config_multi_msi(struct pci_dev *pdev,
if (plat->msi_sfty_ue_vec < STMMAC_MSI_VEC_MAX)
res->sfty_ue_irq = pci_irq_vector(pdev, plat->msi_sfty_ue_vec);
- plat->multi_msi_en = 1;
+ plat->flags |= STMMAC_FLAG_MULTI_MSI_EN;
dev_info(&pdev->dev, "%s: multi MSI enablement successful\n", __func__);
return 0;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/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;
/* Request the IRQ lines */
- if (priv->plat->multi_msi_en)
+ if (priv->plat->flags & STMMAC_FLAG_MULTI_MSI_EN)
ret = stmmac_request_irq_multi_msi(dev);
else
ret = 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;
- if (priv->plat->multi_msi_en) {
+ if (priv->plat->flags & STMMAC_FLAG_MULTI_MSI_EN) {
for (i = 0; i < priv->plat->rx_queues_to_use; i++)
stmmac_msi_intr_rx(0, &priv->dma_conf.rx_queue[i]);
@@ -7169,7 +7169,8 @@ int stmmac_dvr_probe(struct device *device,
priv->plat = plat_dat;
priv->ioaddr = res->addr;
priv->dev->base_addr = (unsigned long)res->addr;
- priv->plat->dma_cfg->multi_msi_en = priv->plat->multi_msi_en;
+ priv->plat->dma_cfg->multi_msi_en =
+ (priv->plat->flags & STMMAC_FLAG_MULTI_MSI_EN);
priv->dev->irq = res->irq;
priv->wol_irq = 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)
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;
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v3 09/12] net: stmmac: replace the ext_snapshot_en field with a flag
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
` (7 preceding siblings ...)
2023-07-10 8:59 ` [PATCH net-next v3 08/12] net: stmmac: replace the multi_msi_en " Bartosz Golaszewski
@ 2023-07-10 8:59 ` Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 10/12] net: stmmac: replace the int_snapshot_en " Bartosz Golaszewski
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 8:59 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski, Andrew Halaney
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
---
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/net/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;
priv->plat->int_snapshot_en = 1;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/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 *priv)
*/
ts_status = readl(priv->ioaddr + GMAC_TIMESTAMP_STATUS);
- if (!priv->plat->ext_snapshot_en)
+ if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN)
return;
num_snapshot = (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 = on;
+ if (on)
+ priv->plat->flags |= STMMAC_FLAG_EXT_SNAPSHOT_EN;
+ else
+ priv->plat->flags &= ~STMMAC_FLAG_EXT_SNAPSHOT_EN;
mutex_lock(&priv->aux_ts_lock);
acr_value = readl(ptpaddr + PTP_ACR);
acr_value &= ~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)
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;
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v3 10/12] net: stmmac: replace the int_snapshot_en field with a flag
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
` (8 preceding siblings ...)
2023-07-10 8:59 ` [PATCH net-next v3 09/12] net: stmmac: replace the ext_snapshot_en " Bartosz Golaszewski
@ 2023-07-10 8:59 ` Bartosz Golaszewski
2023-07-10 9:00 ` [PATCH net-next v3 11/12] net: stmmac: replace the rx_clk_runs_in_lpi " Bartosz Golaszewski
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 8:59 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski, Andrew Halaney
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
---
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/net/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;
- priv->plat->int_snapshot_en = 1;
+ priv->plat->flags |= STMMAC_FLAG_INT_SNAPSHOT_EN;
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 = 0;
+ priv->plat->flags &= ~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 = 0;
+ priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
return -ETIMEDOUT;
}
@@ -395,7 +395,7 @@ static int intel_crosststamp(ktime_t *device,
}
system->cycles *= intel_priv->crossts_adj;
- priv->plat->int_snapshot_en = 0;
+ priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
return 0;
}
@@ -609,7 +609,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
plat->ext_snapshot_num = AUX_SNAPSHOT0;
plat->crosststamp = intel_crosststamp;
- plat->int_snapshot_en = 0;
+ plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
/* Setup MSI vector offset specific to Intel mGbE controller */
plat->msi_mac_vec = 29;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/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 *priv)
u64 ptp_time;
int i;
- 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)
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;
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v3 11/12] net: stmmac: replace the rx_clk_runs_in_lpi field with a flag
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
` (9 preceding siblings ...)
2023-07-10 8:59 ` [PATCH net-next v3 10/12] net: stmmac: replace the int_snapshot_en " Bartosz Golaszewski
@ 2023-07-10 9:00 ` Bartosz Golaszewski
2023-07-10 9:00 ` [PATCH net-next v3 12/12] net: stmmac: replace the en_tx_lpi_clockgating " Bartosz Golaszewski
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 9:00 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski, Andrew Halaney
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
---
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/drivers/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 *pdev)
if (of_property_read_bool(np, "snps,tso"))
plat_dat->flags |= STMMAC_FLAG_TSO_EN;
if (of_device_is_compatible(np, "qcom,qcs404-ethqos"))
- plat_dat->rx_clk_runs_in_lpi = 1;
+ plat_dat->flags |= STMMAC_FLAG_RX_CLK_RUNS_IN_LPI;
if (data->has_integrated_pcs)
plat_dat->flags |= STMMAC_FLAG_HAS_INTEGRATED_PCS;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/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 =
- phy_init_eee(phy, !priv->plat->rx_clk_runs_in_lpi) >= 0;
+ phy_init_eee(phy, !(priv->plat->flags &
+ STMMAC_FLAG_RX_CLK_RUNS_IN_LPI)) >= 0;
priv->eee_enabled = stmmac_eee_init(priv);
priv->tx_lpi_enabled = 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)
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;
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v3 12/12] net: stmmac: replace the en_tx_lpi_clockgating field with a flag
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
` (10 preceding siblings ...)
2023-07-10 9:00 ` [PATCH net-next v3 11/12] net: stmmac: replace the rx_clk_runs_in_lpi " Bartosz Golaszewski
@ 2023-07-10 9:00 ` Bartosz Golaszewski
2023-07-12 3:21 ` [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Jakub Kicinski
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Bartosz Golaszewski @ 2023-07-10 9:00 UTC (permalink / raw)
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, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski, Andrew Halaney
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 ++--
include/linux/stmmac.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 2d68a6e84b0e..efe85b086abe 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -421,7 +421,7 @@ static int stmmac_enable_eee_mode(struct stmmac_priv *priv)
/* Check and enter in LPI mode */
if (!priv->tx_path_in_lpi_mode)
stmmac_set_eee_mode(priv, priv->hw,
- priv->plat->en_tx_lpi_clockgating);
+ priv->plat->flags & STMMAC_FLAG_EN_TX_LPI_CLOCKGATING);
return 0;
}
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 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 =
of_property_read_bool(np, "snps,force_sf_dma_mode");
- plat->en_tx_lpi_clockgating =
- of_property_read_bool(np, "snps,en-tx-lpi-clockgating");
+ if (of_property_read_bool(np, "snps,en-tx-lpi-clockgating"))
+ plat->flags |= STMMAC_FLAG_EN_TX_LPI_CLOCKGATING;
/* Set the maxmtu to a default of JUMBO_LEN in case the
* parameter is not present in the device tree.
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index c3769dad8238..ef67dba775d0 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -215,6 +215,7 @@ struct dwmac4_addrs {
#define STMMAC_FLAG_EXT_SNAPSHOT_EN BIT(8)
#define STMMAC_FLAG_INT_SNAPSHOT_EN BIT(9)
#define STMMAC_FLAG_RX_CLK_RUNS_IN_LPI BIT(10)
+#define STMMAC_FLAG_EN_TX_LPI_CLOCKGATING BIT(11)
struct plat_stmmacenet_data {
int bus_id;
@@ -280,7 +281,6 @@ struct plat_stmmacenet_data {
int has_gmac4;
int rss_en;
int mac_port_sel_speed;
- bool en_tx_lpi_clockgating;
int has_xgmac;
u8 vlan_fail_q;
unsigned int eee_usecs_rate;
--
2.39.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
` (11 preceding siblings ...)
2023-07-10 9:00 ` [PATCH net-next v3 12/12] net: stmmac: replace the en_tx_lpi_clockgating " Bartosz Golaszewski
@ 2023-07-12 3:21 ` Jakub Kicinski
2023-07-13 10:11 ` Simon Horman
2023-07-14 4:00 ` patchwork-bot+netdevbpf
14 siblings, 0 replies; 16+ messages in thread
From: Jakub Kicinski @ 2023-07-12 3:21 UTC (permalink / raw)
To: Giuseppe Cavallaro
Cc: Bartosz Golaszewski, Alexandre Torgue, Jose Abreu,
David S . Miller, Eric Dumazet, 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, netdev,
linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski
On Mon, 10 Jul 2023 10:59:49 +0200 Bartosz Golaszewski wrote:
> As suggested by Jose Abreu: let's drop all 12 boolean fields in
> plat_stmmacenet_data and replace them with a common bitfield.
Peppe, please take a look.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
` (12 preceding siblings ...)
2023-07-12 3:21 ` [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Jakub Kicinski
@ 2023-07-13 10:11 ` Simon Horman
2023-07-14 4:00 ` patchwork-bot+netdevbpf
14 siblings, 0 replies; 16+ messages in thread
From: Simon Horman @ 2023-07-13 10:11 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: 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,
netdev, linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, Bartosz Golaszewski
On Mon, Jul 10, 2023 at 10:59:49AM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> As suggested by Jose Abreu: let's drop all 12 boolean fields in
> plat_stmmacenet_data and replace them with a common bitfield.
Reviewed-by: Simon Horman <simon.horman@corigine.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
` (13 preceding siblings ...)
2023-07-13 10:11 ` Simon Horman
@ 2023-07-14 4:00 ` patchwork-bot+netdevbpf
14 siblings, 0 replies; 16+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-07-14 4:00 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: peppe.cavallaro, alexandre.torgue, joabreu, davem, edumazet,
kuba, pabeni, mcoquelin.stm32, vkoul, bhupesh.sharma, wens,
jernej.skrabec, samuel, thierry.reding, jonathanh,
richardcochran, matthias.bgg, angelogioacchino.delregno, netdev,
linux-stm32, linux-arm-kernel, linux-kernel, linux-sunxi,
linux-tegra, linux-mediatek, bartosz.golaszewski
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 10 Jul 2023 10:59:49 +0200 you wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> As suggested by Jose Abreu: let's drop all 12 boolean fields in
> plat_stmmacenet_data and replace them with a common bitfield.
>
> v2 -> v3:
> - fix build on intel platforms even more
> - collect review tags from Andrew
>
> [...]
Here is the summary with links:
- [net-next,v3,01/12] net: stmmac: replace the has_integrated_pcs field with a flag
https://git.kernel.org/netdev/net-next/c/d26979f1cef7
- [net-next,v3,02/12] net: stmmac: replace the sph_disable field with a flag
https://git.kernel.org/netdev/net-next/c/309efe6eb499
- [net-next,v3,03/12] net: stmmac: replace the use_phy_wol field with a flag
https://git.kernel.org/netdev/net-next/c/fd1d62d80ebc
- [net-next,v3,04/12] net: stmmac: replace the has_sun8i field with a flag
https://git.kernel.org/netdev/net-next/c/d8daff284e30
- [net-next,v3,05/12] net: stmmac: replace the tso_en field with a flag
https://git.kernel.org/netdev/net-next/c/68861a3bcc1c
- [net-next,v3,06/12] net: stmmac: replace the serdes_up_after_phy_linkup field with a flag
https://git.kernel.org/netdev/net-next/c/efe92571bfc3
- [net-next,v3,07/12] net: stmmac: replace the vlan_fail_q_en field with a flag
https://git.kernel.org/netdev/net-next/c/fc02152bdbb2
- [net-next,v3,08/12] net: stmmac: replace the multi_msi_en field with a flag
https://git.kernel.org/netdev/net-next/c/956c3f09b9c4
- [net-next,v3,09/12] net: stmmac: replace the ext_snapshot_en field with a flag
https://git.kernel.org/netdev/net-next/c/aa5513f5d95f
- [net-next,v3,10/12] net: stmmac: replace the int_snapshot_en field with a flag
https://git.kernel.org/netdev/net-next/c/621ba7ad7891
- [net-next,v3,11/12] net: stmmac: replace the rx_clk_runs_in_lpi field with a flag
https://git.kernel.org/netdev/net-next/c/743dd1db85f4
- [net-next,v3,12/12] net: stmmac: replace the en_tx_lpi_clockgating field with a flag
https://git.kernel.org/netdev/net-next/c/9d0c0d5ebd63
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2023-07-14 4:00 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-10 8:59 [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 01/12] net: stmmac: replace the has_integrated_pcs field with a flag Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 02/12] net: stmmac: replace the sph_disable " Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 03/12] net: stmmac: replace the use_phy_wol " Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 04/12] net: stmmac: replace the has_sun8i " Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 05/12] net: stmmac: replace the tso_en " Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 06/12] net: stmmac: replace the serdes_up_after_phy_linkup " Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 07/12] net: stmmac: replace the vlan_fail_q_en " Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 08/12] net: stmmac: replace the multi_msi_en " Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 09/12] net: stmmac: replace the ext_snapshot_en " Bartosz Golaszewski
2023-07-10 8:59 ` [PATCH net-next v3 10/12] net: stmmac: replace the int_snapshot_en " Bartosz Golaszewski
2023-07-10 9:00 ` [PATCH net-next v3 11/12] net: stmmac: replace the rx_clk_runs_in_lpi " Bartosz Golaszewski
2023-07-10 9:00 ` [PATCH net-next v3 12/12] net: stmmac: replace the en_tx_lpi_clockgating " Bartosz Golaszewski
2023-07-12 3:21 ` [PATCH net-next v3 00/12] net: stmmac: replace boolean fields in plat_stmmacenet_data with flags Jakub Kicinski
2023-07-13 10:11 ` Simon Horman
2023-07-14 4:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).