FAILED: patch "[PATCH] net: macb: Reinitialize tx/rx queue pointer registers and rx" failed to apply to 6.1-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 718d0766ce4c7634ce62fa78b526ea7263487edd
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026032002-habitual-dolly-4a11@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 718d0766ce4c7634ce62fa78b526ea7263487edd Mon Sep 17 00:00:00 2001
From: Kevin Hao <[email protected]>
Date: Thu, 12 Mar 2026 16:13:59 +0800
Subject: [PATCH] net: macb: Reinitialize tx/rx queue pointer registers and rx
ring during resume
On certain platforms, such as AMD Versal boards, the tx/rx queue pointer registers are cleared after suspend, and the rx queue pointer register is also disabled during suspend if WOL is enabled. Previously, we assumed that these registers would be restored by macb_mac_link_up(). However, in commit bf9cf80cab81, macb_init_buffers() was moved from macb_mac_link_up() to macb_open(). Therefore, we should call macb_init_buffers() to reinitialize the tx/rx queue pointer registers during resume.
Due to the reset of these two registers, we also need to adjust the tx/rx rings accordingly. The tx ring will be handled by gem_shuffle_tx_rings() in macb_mac_link_up(), so we only need to initialize the rx ring here.
drivers/net/ethernet/cadence/macb_main.c +10 -0
@@ -5952,8 +5952,18 @@ static int __maybe_unused macb_resume(struct device *dev)rtnl_unlock (); } +if (!(bp->caps &MACB_CAPS_MACB_IS_EMAC )) +macb_init_buffers (bp); +for (q =0 , queue = bp->queues; q < bp->num_queues; ++q, ++queue) { +if (!(bp->caps &MACB_CAPS_MACB_IS_EMAC )) { +if (macb_is_gem (bp)) +gem_init_rx_ring (queue); +else +macb_init_rx_ring (queue); + } +napi_enable (&queue->napi_rx);napi_enable (&queue->napi_tx); }
Sasha Levin
maintainerPATCH 1/3 net: macb: queue tie-off or disable during WOL suspend
From: Vineeth Karumanchi <[email protected]>
[ Upstream commit 759cc793ebfc2d1a02f357ae97e5dcdcd63f758f ]
When GEM is used as a wake device, it is not mandatory for the RX DMA to be active. The RX engine in IP only needs to receive and identify a wake packet through an interrupt. The wake packet is of no further significance; hence, it is not required to be copied into memory. By disabling RX DMA during suspend, we can avoid unnecessary DMA processing of any incoming traffic.
During suspend, perform either of the below operations:
- tie-off/dummy descriptor: Disable unused queues by connecting them to a looped descriptor chain without free slots.
- queue disable: The newer IP version allows disabling individual queues.
Stable-dep-of: 718d0766ce4c ("net: macb: Reinitialize tx/rx queue pointer registers and rx ring during resume")
--- drivers/net/ethernet/cadence/macb.h | 7 +++ drivers/net/ethernet/cadence/macb_main.c | 60 ++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 3 deletions(-)
drivers/net/ethernet/cadence/macb.h +7 -0
@@ -636,6 +636,10 @@#define GEM_T2OFST_OFFSET 0/* offset value */ #define GEM_T2OFST_SIZE 7 +/* Bitfields in queue pointer registers */ +#define MACB_QUEUE_DISABLE_OFFSET 0/* disable queue */ +#define MACB_QUEUE_DISABLE_SIZE 1 +/* Offset for screener type 2 compare values (T2CMPOFST). * Note the offset is applied after the specified point, * e.g. GEM_T2COMPOFST_ETYPE denotes the EtherType field, so an offset
@@ -722,6 +726,7 @@#define MACB_CAPS_NEEDS_RSTONUBR 0x00000100#define MACB_CAPS_MIIONRGMII 0x00000200#define MACB_CAPS_NEED_TSUCLK 0x00000400 +#define MACB_CAPS_QUEUE_DISABLE 0x00000800#define MACB_CAPS_PCS 0x01000000#define MACB_CAPS_HIGH_SPEED 0x02000000#define MACB_CAPS_CLK_HW_CHG 0x04000000
@@ -1254,6 +1259,8 @@ struct macb {u32 (*macb_reg_readl)(struct macb *bp,int offset);void (*macb_reg_writel)(struct macb *bp,int offset,u32 value); +struct macb_dma_desc *rx_ring_tieoff; +dma_addr_t rx_ring_tieoff_dma;size_t rx_buffer_size;unsigned int rx_ring_size;
drivers/net/ethernet/cadence/macb_main.c +57 -3
110 lines not on this page · raw message
Signature · 1 line
2.51.0
Sasha Levin
maintainerPATCH 2/3 net: macb: Introduce gem_init_rx_ring()
From: Kevin Hao <[email protected]>
[ Upstream commit 1a7124ecd655bcaf1845197fe416aa25cff4c3ea ]
Extract the initialization code for the GEM RX ring into a new function. This change will be utilized in a subsequent patch. No functional changes are introduced.
Stable-dep-of: 718d0766ce4c ("net: macb: Reinitialize tx/rx queue pointer registers and rx ring during resume")
--- drivers/net/ethernet/cadence/macb_main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/net/ethernet/cadence/macb_main.c +9 -4
@@ -2546,6 +2546,14 @@ static void macb_init_tieoff(struct macb *bp) desc->ctrl =0 ; } +static void gem_init_rx_ring (struct macb_queue *queue) +{ + queue->rx_tail =0 ; + queue->rx_prepared_head =0 ; + +gem_rx_refill (queue); +} +static void gem_init_rings (struct macb *bp) {struct macb_queue *queue;
@@ -2563,10 +2571,7 @@ static void gem_init_rings(struct macb *bp) queue->tx_head =0 ; queue->tx_tail =0 ; - queue->rx_tail =0 ; - queue->rx_prepared_head =0 ; - -gem_rx_refill (queue); +gem_init_rx_ring (queue); }macb_init_tieoff (bp);
Signature · 1 line
2.51.0
Sasha Levin
maintainerPATCH 3/3 net: macb: Reinitialize tx/rx queue pointer registers and rx ring during resume
In reply to Sasha LevinFrom: Kevin Hao <[email protected]>
[ Upstream commit 718d0766ce4c7634ce62fa78b526ea7263487edd ]
On certain platforms, such as AMD Versal boards, the tx/rx queue pointer registers are cleared after suspend, and the rx queue pointer register is also disabled during suspend if WOL is enabled. Previously, we assumed that these registers would be restored by macb_mac_link_up(). However, in commit bf9cf80cab81, macb_init_buffers() was moved from macb_mac_link_up() to macb_open(). Therefore, we should call macb_init_buffers() to reinitialize the tx/rx queue pointer registers during resume.
Due to the reset of these two registers, we also need to adjust the tx/rx rings accordingly. The tx ring will be handled by gem_shuffle_tx_rings() in macb_mac_link_up(), so we only need to initialize the rx ring here.
--- drivers/net/ethernet/cadence/macb_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/ethernet/cadence/macb_main.c +10 -0
@@ -5294,8 +5294,18 @@ static int __maybe_unused macb_resume(struct device *dev)rtnl_unlock (); } +if (!(bp->caps &MACB_CAPS_MACB_IS_EMAC )) +macb_init_buffers (bp); +for (q =0 , queue = bp->queues; q < bp->num_queues; ++q, ++queue) { +if (!(bp->caps &MACB_CAPS_MACB_IS_EMAC )) { +if (macb_is_gem (bp)) +gem_init_rx_ring (queue); +else +macb_init_rx_ring (queue); + } +napi_enable (&queue->napi_rx);napi_enable (&queue->napi_tx); }
Signature · 1 line
2.51.0