summaryrefslogtreecommitdiff
path: root/drivers/dma/ioat/dma.h
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2013-02-08 01:38:32 +0400
committerVinod Koul <vinod.koul@intel.com>2013-02-12 20:27:21 +0400
commit4dec23d7718e6f1f5e1773698d112025169e7d49 (patch)
tree2d39626f26b0b8cbbdcb246188ec5b2c7494fd8d /drivers/dma/ioat/dma.h
parentcfdf5b6cc5985014a7ce891093f4fd0ae2d27ca6 (diff)
downloadlinux-4dec23d7718e6f1f5e1773698d112025169e7d49.tar.xz
ioatdma: fix race between updating ioat->head and IOAT_COMPLETION_PENDING
There is a race that can hit during __cleanup() when the ioat->head pointer is incremented during descriptor submission. The __cleanup() can clear the PENDING flag when it does not see any active descriptors. This causes new submitted descriptors to be ignored because the COMPLETION_PENDING flag is cleared. This was introduced when code was adapted from ioatdma v1 to ioatdma v2. For v2 and v3, IOAT_COMPLETION_PENDING flag will be abandoned and a new flag IOAT_CHAN_ACTIVE will be utilized. This flag will also be protected under the prep_lock when being modified in order to avoid the race. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Dan Williams <djbw@fb.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/ioat/dma.h')
-rw-r--r--drivers/dma/ioat/dma.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index 5e8fe01ba69d..1020598b80d3 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -97,6 +97,7 @@ struct ioat_chan_common {
#define IOAT_KOBJ_INIT_FAIL 3
#define IOAT_RESHAPE_PENDING 4
#define IOAT_RUN 5
+ #define IOAT_CHAN_ACTIVE 6
struct timer_list timer;
#define COMPLETION_TIMEOUT msecs_to_jiffies(100)
#define IDLE_TIMEOUT msecs_to_jiffies(2000)