summaryrefslogtreecommitdiffstats
path: root/drivers/dma/ioat/dma_v2.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2010-03-04 05:21:10 +0100
committerDan Williams <dan.j.williams@intel.com>2010-03-04 05:21:10 +0100
commitaa75db0080603bae27961c0502812dfd0f522bb3 (patch)
tree3e7fbb0ef4415c9f36107a81378f00bba6db9440 /drivers/dma/ioat/dma_v2.c
parentioat2: kill pending flag (diff)
downloadlinux-aa75db0080603bae27961c0502812dfd0f522bb3.tar.xz
linux-aa75db0080603bae27961c0502812dfd0f522bb3.zip
ioat: close potential BUG_ON race in the descriptor cleanup path
Since ioat_cleanup_preamble() and the update of the last completed descriptor are not synchronized there is a chance that two cleanup threads can see descriptors to clean. If the first cleans up all pending descriptors then the second will trigger the BUG_ON. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/ioat/dma_v2.c')
-rw-r--r--drivers/dma/ioat/dma_v2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c
index c6e4531fe524..01ed1cfd3eb6 100644
--- a/drivers/dma/ioat/dma_v2.c
+++ b/drivers/dma/ioat/dma_v2.c
@@ -158,7 +158,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
seen_current = true;
}
ioat->tail += i;
- BUG_ON(!seen_current); /* no active descs have written a completion? */
+ BUG_ON(active && !seen_current); /* no active descs have written a completion? */
chan->last_completion = phys_complete;
if (ioat->head == ioat->tail) {