]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 May 2025 12:12:16 +0000 (14:12 +0200)
commit1d60c0781c1bbeaa1196b0d8aad5c435f06cb7c4
treede6c5f41ad28d2dc69e9e126b0a0ed38101b9e70
parent4e132f56bc64ac0475026077ad2a6a14c754ece3
net: cadence: macb: Fix a possible deadlock in macb_halt_tx.

[ Upstream commit c92d6089d8ad7d4d815ebcedee3f3907b539ff1f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/cadence/macb_main.c