mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
ioat(4): Fix 'bogus completion_pending' KASSERT
Fix ioat_release to only set is_completion_pending if DMAs were actually queued. Otherwise, the spurious flag could trigger an assert in the reset path on INVARIANTS kernels. Reviewed by: bdrewery, Suraj Raju @ Isilon Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
26e287836b
commit
58a639b77c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=309338
@ -947,6 +947,7 @@ ioat_acquire(bus_dmaengine_t dmaengine)
|
||||
ioat = to_ioat_softc(dmaengine);
|
||||
mtx_lock(&ioat->submit_lock);
|
||||
CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx);
|
||||
ioat->acq_head = ioat->head;
|
||||
}
|
||||
|
||||
int
|
||||
@ -976,12 +977,15 @@ ioat_release(bus_dmaengine_t dmaengine)
|
||||
CTR4(KTR_IOAT, "%s channel=%u dispatch2 hw_head=%u head=%u", __func__,
|
||||
ioat->chan_idx, ioat->hw_head & UINT16_MAX, ioat->head);
|
||||
|
||||
ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, (uint16_t)ioat->hw_head);
|
||||
if (ioat->acq_head != ioat->head) {
|
||||
ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET,
|
||||
(uint16_t)ioat->hw_head);
|
||||
|
||||
if (!ioat->is_completion_pending) {
|
||||
ioat->is_completion_pending = TRUE;
|
||||
callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback,
|
||||
ioat);
|
||||
if (!ioat->is_completion_pending) {
|
||||
ioat->is_completion_pending = TRUE;
|
||||
callout_reset(&ioat->poll_timer, 1,
|
||||
ioat_poll_timer_callback, ioat);
|
||||
}
|
||||
}
|
||||
mtx_unlock(&ioat->submit_lock);
|
||||
}
|
||||
|
@ -483,6 +483,7 @@ struct ioat_softc {
|
||||
boolean_t resetting_cleanup; /* cleanup_lock */
|
||||
|
||||
uint32_t head;
|
||||
uint32_t acq_head;
|
||||
uint32_t tail;
|
||||
uint32_t hw_head;
|
||||
uint32_t ring_size_order;
|
||||
|
Loading…
Reference in New Issue
Block a user