[PATCH net-next v5 01/14] Revert "net: macb: Clean up the .usrio settings in macb_config instances"

Conor Dooley
2026-03-25T16:28:56Z

Commit 0ae998c4efd69 ("net: macb: Clean up the .usrio settings in
macb_config instances") was a misguided attempt to clean up the driver
that actually just propagated problematic code. The default for usrio is
actually no usrio, and already there are issues with people using the
problematically named "macb_default_usrio" on platforms where the usrio
does not have this so-called default behaviour. usrio is platform
specific and using the default at91 usrio settings should be opt-in
only. Revert the "cleanup" patch.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
drivers/net/ethernet/cadence/macb_main.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 1cb49252abf5a..a48160da6e672 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -5513,31 +5513,37 @@ static const struct macb_config fu540_c000_config = {
.clk_init = fu540_c000_clk_init,
.init = fu540_c000_init,
.jumbo_max_len = 10240,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config at91sam9260_config = {
.caps = MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config sama5d3macb_config = {
.caps = MACB_CAPS_SG_DISABLED |
MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config pc302gem_config = {
.caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE,
.dma_burst_length = 16,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config sama5d2_config = {
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO,
.dma_burst_length = 16,
.jumbo_max_len = 10240,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config sama5d29_config = {
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config sama5d3_config = {
@@ -5545,21 +5551,25 @@ static const struct macb_config sama5d3_config = {
MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO,
.dma_burst_length = 16,
.jumbo_max_len = 10240,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config sama5d4_config = {
.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
.dma_burst_length = 4,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config emac_config = {
.caps = MACB_CAPS_NEEDS_RSTONUBR | MACB_CAPS_MACB_IS_EMAC,
.clk_init = at91ether_clk_init,
.init = at91ether_init,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config np4_config = {
.caps = MACB_CAPS_USRIO_DISABLED,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config zynqmp_config = {
@@ -5569,12 +5579,14 @@ static const struct macb_config zynqmp_config = {
.dma_burst_length = 16,
.init = init_reset_optional,
.jumbo_max_len = 10240,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config zynq_config = {
.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_NO_GIGABIT_HALF |
MACB_CAPS_NEEDS_RSTONUBR,
.dma_burst_length = 16,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config mpfs_config = {
@@ -5583,6 +5595,7 @@ static const struct macb_config mpfs_config = {
MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
.init = init_reset_optional,
+ .usrio = &macb_default_usrio,
.max_tx_length = 4040, /* Cadence Erratum 1686 */
.jumbo_max_len = 4040,
};
@@ -5611,6 +5624,7 @@ static const struct macb_config versal_config = {
.dma_burst_length = 16,
.init = init_reset_optional,
.jumbo_max_len = 10240,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config eyeq5_config = {
@@ -5620,6 +5634,7 @@ static const struct macb_config eyeq5_config = {
.dma_burst_length = 16,
.init = eyeq5_init,
.jumbo_max_len = 10240,
+ .usrio = &macb_default_usrio,
};

static const struct macb_config raspberrypi_rp1_config = {
@@ -5628,6 +5643,7 @@ static const struct macb_config raspberrypi_rp1_config = {
MACB_CAPS_GEM_HAS_PTP |
MACB_CAPS_EEE,
.dma_burst_length = 16,
+ .usrio = &macb_default_usrio,
.jumbo_max_len = 10240,
};

@@ -5675,6 +5691,7 @@ static const struct macb_config default_gem_config = {
MACB_CAPS_JUMBO |
MACB_CAPS_GEM_HAS_PTP,
.dma_burst_length = 16,
+ .usrio = &macb_default_usrio,
.jumbo_max_len = 10240,
};

@@ -5761,7 +5778,7 @@ static int macb_probe(struct platform_device *pdev)
bp->wol = 0;
device_set_wakeup_capable(&pdev->dev, 1);

- bp->usrio = macb_config->usrio ? : &macb_default_usrio;
+ bp->usrio = macb_config->usrio;

/* By default we set to partial store and forward mode for zynqmp.
* Disable if not set in devicetree.
--
2.53.0