]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: macb: remove illusion about TBQPH/RBQPH being per-queue
authorThéo Lebrun <theo.lebrun@bootlin.com>
Tue, 23 Sep 2025 16:00:24 +0000 (18:00 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 27 Sep 2025 00:54:50 +0000 (17:54 -0700)
commitfca3dc859b200ca4dcdd2124beaf3bb2ab80b0f7
tree842f09c439e6089c54440c595d28493d37c97ed2
parent9665aa15ef8bdf1fa596f9ff8162e9c5e00ac036
net: macb: remove illusion about TBQPH/RBQPH being per-queue

The MACB driver acts as if TBQPH/RBQPH are configurable on a per queue
basis; this is a lie. A single register configures the upper 32 bits of
each DMA descriptor buffers for all queues.

Concrete actions:

 - Drop GEM_TBQPH/GEM_RBQPH macros which have a queue index argument.
   Only use MACB_TBQPH/MACB_RBQPH constants.

 - Drop struct macb_queue->TBQPH/RBQPH fields.

 - In macb_init_buffers(): do a single write to TBQPH and RBQPH for all
   queues instead of a write per queue.

 - In macb_tx_error_task(): drop the write to TBQPH.

 - In macb_alloc_consistent(): if allocations give different upper
   32-bits, fail. Previously, it would have lead to silent memory
   corruption as queues would have used the upper 32 bits of the alloc
   from queue 0 and their own low 32 bits.

 - In macb_suspend(): if we use the tie off descriptor for suspend, do
   the write once for all queues instead of once per queue.

Fixes: fff8019a08b6 ("net: macb: Add 64 bit addressing support for GEM")
Fixes: ae1f2a56d273 ("net: macb: Added support for many RX queues")
Reviewed-by: Sean Anderson <sean.anderson@linux.dev>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250923-macb-fixes-v6-2-772d655cdeb6@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cadence/macb.h
drivers/net/ethernet/cadence/macb_main.c