Skip to content

Commit 1309ebf

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 f05b4fb commit 1309ebf

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
@@ -4648,8 +4648,13 @@ static void mtk_hw_reset_monitor_work(struct work_struct *work)
46484648
goto out;
46494649

46504650
/* DMA stuck checks */
4651-
if (mtk_hw_check_dma_hang(eth) && atomic_read(&eth->reset.force))
4652-
schedule_work(&eth->pending_work);
4651+
if (mtk_hw_check_dma_hang(eth)) {
4652+
if (atomic_read(&eth->reset.force))
4653+
schedule_work(&eth->pending_work);
4654+
else
4655+
dev_err_ratelimited(eth->dev,
4656+
"DMA hang detected, automatic recovery is disabled (echo 2 > /sys/kernel/debug/mtketh/reset to enable)\n");
4657+
}
46534658

46544659
out:
46554660
schedule_delayed_work(&eth->reset.monitor_work,

0 commit comments

Comments
 (0)