Skip to content

Commit 898ec89

Browse files
davejiangvinodkoul
authored andcommitted
dmaengine: ioat: stop mod_timer from resurrecting deleted timer in __cleanup()
User reports observing timer event report channel halted but no error observed in CHANERR register. The driver finished self-test and released channel resources. Debug shows that __cleanup() can call mod_timer() after the timer has been deleted and thus resurrect the timer. While harmless, it causes suprious error message to be emitted. Use mod_timer_pending() call to prevent deleted timer from being resurrected. Fixes: 3372de5 ("dmaengine: ioatdma: removal of dma_v3.c and relevant ioat3 references") Signed-off-by: Dave Jiang <[email protected]> Link: https://lore.kernel.org/r/166360672197.3851724.17040290563764838369.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <[email protected]>
1 parent b9d2140 commit 898ec89

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/dma/ioat/dma.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ static void __cleanup(struct ioatdma_chan *ioat_chan, dma_addr_t phys_complete)
656656
if (active - i == 0) {
657657
dev_dbg(to_dev(ioat_chan), "%s: cancel completion timeout\n",
658658
__func__);
659-
mod_timer(&ioat_chan->timer, jiffies + IDLE_TIMEOUT);
659+
mod_timer_pending(&ioat_chan->timer, jiffies + IDLE_TIMEOUT);
660660
}
661661

662662
/* microsecond delay by sysfs variable per pending descriptor */
@@ -682,7 +682,7 @@ static void ioat_cleanup(struct ioatdma_chan *ioat_chan)
682682

683683
if (chanerr &
684684
(IOAT_CHANERR_HANDLE_MASK | IOAT_CHANERR_RECOVER_MASK)) {
685-
mod_timer(&ioat_chan->timer, jiffies + IDLE_TIMEOUT);
685+
mod_timer_pending(&ioat_chan->timer, jiffies + IDLE_TIMEOUT);
686686
ioat_eh(ioat_chan);
687687
}
688688
}
@@ -879,7 +879,7 @@ static void check_active(struct ioatdma_chan *ioat_chan)
879879
}
880880

881881
if (test_and_clear_bit(IOAT_CHAN_ACTIVE, &ioat_chan->state))
882-
mod_timer(&ioat_chan->timer, jiffies + IDLE_TIMEOUT);
882+
mod_timer_pending(&ioat_chan->timer, jiffies + IDLE_TIMEOUT);
883883
}
884884

885885
static void ioat_reboot_chan(struct ioatdma_chan *ioat_chan)

0 commit comments

Comments
 (0)