net: macb: refuse set_ringparam on EMAC

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 <theo.lebrun@bootlin.com>
Link: https://patch.msgid.link/20260812-macb-context-v9-7-7ddbf5f715e0@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Théo Lebrun
2026-08-12 10:03:21 +02:00
committed by Jakub Kicinski
parent 5262eab946
commit 227fdb2fe6

View File

@@ -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;