[PATCH net-next] net: macb: fix build of TX stall watchdog by replacing undefined netdev_warn_ratelimited

Lukasz Raczylo posted 1 patch 4 weeks ago
drivers/net/ethernet/cadence/macb_main.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
[PATCH net-next] net: macb: fix build of TX stall watchdog by replacing undefined netdev_warn_ratelimited
Posted by Lukasz Raczylo 4 weeks ago
netdev_warn_ratelimited() does not exist in this kernel -- neither
mainline net-next nor raspberrypi/linux rpi-6.18.y define a
netdev_*_ratelimited() family.  I confused it with the existing
net_warn_ratelimited() / pr_warn_ratelimited() macros when
authoring v2 patch 3 of the macb silent TX stall series, and the
result fails to build with implicit-function-declaration.

Replace with the standard `if (printk_ratelimit()) netdev_warn(...)`
pattern.  Same semantics intended by v2 patch 3 (bounded log noise,
retains the netdev prefix in the message); works in every kernel
version.

Fixes the build of patch 3/3 of:

  https://lore.kernel.org/netdev/20260514215459.36109-1-lukasz@raczylo.com/T/

Caught by an independent build test on the Talos Linux Pi 5 build
(John Laur / johnlaur on GitHub), reported at:

  https://github.com/siderolabs/sbc-raspberrypi/issues/91#issuecomment-4456874307

Signed-off-by: Lukasz Raczylo <lukasz@raczylo.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -2057,10 +2057,11 @@ static void macb_tx_stall_watchdog(struct work_struct *work)
 	spin_unlock_irqrestore(&queue->tx_ptr_lock, flags);

 	if (stalled) {
-		netdev_warn_ratelimited(bp->dev,
-					"TX stall detected on queue %u (tail=%u head=%u); re-kicking TSTART\n",
-					(unsigned int)(queue - bp->queues),
-					cur_tail, cur_head);
+		if (printk_ratelimit())
+			netdev_warn(bp->dev,
+				    "TX stall detected on queue %u (tail=%u head=%u); re-kicking TSTART\n",
+				    (unsigned int)(queue - bp->queues),
+				    cur_tail, cur_head);
 		macb_tx_restart(queue);
 	}

--
2.54.0
Re: [PATCH net-next] net: macb: fix build of TX stall watchdog by replacing undefined netdev_warn_ratelimited
Posted by Andrew Lunn 3 weeks, 6 days ago
On Fri, May 15, 2026 at 10:53:36AM +0100, Lukasz Raczylo wrote:
> netdev_warn_ratelimited() does not exist in this kernel -- neither
> mainline net-next nor raspberrypi/linux rpi-6.18.y define a
> netdev_*_ratelimited() family.  I confused it with the existing
> net_warn_ratelimited() / pr_warn_ratelimited() macros when
> authoring v2 patch 3 of the macb silent TX stall series, and the
> result fails to build with implicit-function-declaration.
> 
> Replace with the standard `if (printk_ratelimit()) netdev_warn(...)`
> pattern.  Same semantics intended by v2 patch 3 (bounded log noise,
> retains the netdev prefix in the message); works in every kernel
> version.
> 
> Fixes the build of patch 3/3 of:

What you should do is reply to patch 3/3 and say

self NACK

and explain why it is broken.

Then wait 24 hours, and send a new version of the patch series, with
patch 3/3 fixed.

    Andrew

---
pw-bot: cr