From 0a4cceb161dfcb232aa9f5d8664e017c2590e0d9 Mon Sep 17 00:00:00 2001 From: cem Date: Sat, 13 Feb 2016 02:55:45 +0000 Subject: ioat(4): Recheck status register on zero-descriptor wakeups Errors that halt the channel don't necessarily result in a completion update, apparently. Sponsored by: EMC / Isilon Storage Division --- sys/dev/ioat/ioat.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'sys') diff --git a/sys/dev/ioat/ioat.c b/sys/dev/ioat/ioat.c index 956e8d1..3215c6f 100644 --- a/sys/dev/ioat/ioat.c +++ b/sys/dev/ioat/ioat.c @@ -630,8 +630,14 @@ ioat_process_events(struct ioat_softc *ioat) CTR0(KTR_IOAT, __func__); - if (status == ioat->last_seen) + if (status == ioat->last_seen) { + /* + * If we landed in process_events and nothing has been + * completed, check for a timeout due to channel halt. + */ + comp_update = ioat_get_chansts(ioat); goto out; + } while (1) { desc = ioat_get_ring_entry(ioat, ioat->tail); @@ -661,8 +667,10 @@ out: ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); mtx_unlock(&ioat->cleanup_lock); - ioat_putn(ioat, completed, IOAT_ACTIVE_DESCR_REF); - wakeup(&ioat->tail); + if (completed != 0) { + ioat_putn(ioat, completed, IOAT_ACTIVE_DESCR_REF); + wakeup(&ioat->tail); + } if (!is_ioat_halted(comp_update)) return; -- cgit v1.1