]> xenbits.xensource.com Git - people/liuw/freebsd.git/commitdiff
ioat: When queueing operations, assert the submit lock
authorcem <cem@FreeBSD.org>
Sat, 24 Oct 2015 23:45:21 +0000 (23:45 +0000)
committercem <cem@FreeBSD.org>
Sat, 24 Oct 2015 23:45:21 +0000 (23:45 +0000)
Callers should have acquired this lock when they invoked ioat_acquire()
before issuing operations.  Assert it is held.

Sponsored by: EMC / Isilon Storage Division

sys/dev/ioat/ioat.c

index cd372eee25a04f36010ae97252f33bf84420844e..4a5dde3395186b3ace321ddd0d2102b7afee2e9d 100644 (file)
@@ -641,6 +641,7 @@ ioat_null(bus_dmaengine_t dmaengine, bus_dmaengine_callback_t callback_fn,
                flags & ~DMA_ALL_FLAGS));
 
        ioat = to_ioat_softc(dmaengine);
+       mtx_assert(&ioat->submit_lock, MA_OWNED);
 
        if (ioat_reserve_space_and_lock(ioat, 1) != 0)
                return (NULL);
@@ -681,6 +682,7 @@ ioat_copy(bus_dmaengine_t dmaengine, bus_addr_t dst,
                flags & ~DMA_ALL_FLAGS));
 
        ioat = to_ioat_softc(dmaengine);
+       mtx_assert(&ioat->submit_lock, MA_OWNED);
 
        if (len > ioat->max_xfer_size) {
                ioat_log_message(0, "%s: max_xfer_size = %d, requested = %d\n",