From 227fdb2fe6f9d3dcc337b91acb1237582899b0d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Lebrun?= Date: Wed, 12 Aug 2026 10:03:21 +0200 Subject: [PATCH] net: macb: refuse set_ringparam on EMAC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EMAC has never supported changing ring sizes: RX is hardcoded to 9 and TX is the tiniest ring buffer you can imagine. Make sure the operation fails early rather than silently succeed and storing values in bp->configured_{rx,tx}_ring_size that are never read in the EMAC case. Signed-off-by: Théo Lebrun Link: https://patch.msgid.link/20260812-macb-context-v9-7-7ddbf5f715e0@bootlin.com Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/cadence/macb_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index af351d30adab..1476bce77f34 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -3687,6 +3687,9 @@ static int macb_set_ringparam(struct net_device *netdev, u32 new_rx_size, new_tx_size; unsigned int reset = 0; + if (bp->caps & MACB_CAPS_MACB_IS_EMAC) + return -EOPNOTSUPP; + if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) return -EINVAL;