diff options
author | Dan Williams <dan.j.williams@intel.com> | 2010-03-03 23:21:10 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-03-03 23:21:10 -0500 |
commit | aa75db0080603bae27961c0502812dfd0f522bb3 (patch) | |
tree | 3e7fbb0ef4415c9f36107a81378f00bba6db9440 /drivers/dma/ioat/dma_v3.c | |
parent | 281befa5592b0c5f9a3856b5666c62ac66d3d9ee (diff) |
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_v3.c')
-rw-r--r-- | drivers/dma/ioat/dma_v3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c index bff48e8cffc4..39520f2f7da9 100644 --- a/drivers/dma/ioat/dma_v3.c +++ b/drivers/dma/ioat/dma_v3.c | |||
@@ -293,7 +293,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete) | |||
293 | } | 293 | } |
294 | } | 294 | } |
295 | ioat->tail += i; | 295 | ioat->tail += i; |
296 | BUG_ON(!seen_current); /* no active descs have written a completion? */ | 296 | BUG_ON(active && !seen_current); /* no active descs have written a completion? */ |
297 | chan->last_completion = phys_complete; | 297 | chan->last_completion = phys_complete; |
298 | if (ioat->head == ioat->tail) { | 298 | if (ioat->head == ioat->tail) { |
299 | dev_dbg(to_dev(chan), "%s: cancel completion timeout\n", | 299 | dev_dbg(to_dev(chan), "%s: cancel completion timeout\n", |