]> www.infradead.org Git - users/hch/misc.git/commit
net: cadence: macb: Fix a possible deadlock in macb_halt_tx.
authorMathieu Othacehe <othacehe@gnu.org>
Fri, 9 May 2025 12:19:35 +0000 (14:19 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 13 May 2025 01:39:38 +0000 (18:39 -0700)
commitc92d6089d8ad7d4d815ebcedee3f3907b539ff1f
tree380ed4f7246f473a2d7f35ec6b2c2cd0bd766848
parent4d64321c4f6faf90b5a3b9f52ee1e7e0eeeff00c
net: cadence: macb: Fix a possible deadlock in macb_halt_tx.

There is a situation where after THALT is set high, TGO stays high as
well. Because jiffies are never updated, as we are in a context with
interrupts disabled, we never exit that loop and have a deadlock.

That deadlock was noticed on a sama5d4 device that stayed locked for days.

Use retries instead of jiffies so that the timeout really works and we do
not have a deadlock anymore.

Fixes: e86cd53afc590 ("net/macb: better manage tx errors")
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250509121935.16282-1-othacehe@gnu.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cadence/macb_main.c