Skip to content

Commit 38cf478

Browse files
meehienfrank-w
authored andcommitted
net: ethernet: mtk_eth_soc: log DMA hangs discarded by the forced-reset gate
Commit 049c428 ("net: ethernet: mtk_eth_soc: support forced reset control") gates the hang-triggered SER behind eth->reset.force, which defaults to off. mtk_hw_reset_monitor_work() still evaluates mtk_hw_check_dma_hang() every second, but when the gate is closed a positive detection is discarded without a trace: the DMA engine stays in whatever state tripped three consecutive hang checks, and nothing in the log records that it happened. Upstream schedules the recovery unconditionally here, so the gate is a deliberate semantic deviation; keep it, but emit a ratelimited error when a detection is dropped so that degraded-DMA states can be correlated with traffic symptoms from the log alone. No functional change when no hang is detected or when forced reset is enabled. Signed-off-by: Mihai Ordean <research@mihaiordean.com>
1 parent cc5e92b commit 38cf478

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4644,8 +4644,13 @@ static void mtk_hw_reset_monitor_work(struct work_struct *work)
46444644
goto out;
46454645

46464646
/* DMA stuck checks */
4647-
if (mtk_hw_check_dma_hang(eth) && atomic_read(&eth->reset.force))
4648-
schedule_work(&eth->pending_work);
4647+
if (mtk_hw_check_dma_hang(eth)) {
4648+
if (atomic_read(&eth->reset.force))
4649+
schedule_work(&eth->pending_work);
4650+
else
4651+
dev_err_ratelimited(eth->dev,
4652+
"DMA hang detected, automatic recovery is disabled (echo 2 > /sys/kernel/debug/mtketh/reset to enable)\n");
4653+
}
46494654

46504655
out:
46514656
schedule_delayed_work(&eth->reset.monitor_work,

0 commit comments

Comments
 (0)