summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorjiaheng.fan <jiaheng.fan@nxp.com>2017-04-13 10:16:49 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-09-25 07:25:39 (GMT)
commitb2368051bf542dc0bf3336b00fdd017ce0e7b0c1 (patch)
tree9c250a9ea09d4d353bad94300a3f023bc42ce299 /drivers/dma
parent8b89ee16ebd1cb705c9a7b37d9e6d1eb0d1a498b (diff)
downloadlinux-b2368051bf542dc0bf3336b00fdd017ce0e7b0c1.tar.xz
dma: fsl-qdma: workaround for ERR010812
ERR010812: Enqueue rejection occurs as a results of the lack of processing by the consumer of the command descriptors in the status queue. This may be due to the size of the status queue, i.e. too small, to account for the delay in reacting to an exceeded queue threshold or other means of determining a non-empty status queue. While increasing the status queue size may alleviate the occurrence of enqueue rejections, it is not a complete solution. qDMA supports flow control (XOFF) flowing from the status queue to the command queue(s) producing traffic. This flow control is initiated when and enter XOFF watermark is triggered as defined by register SQCCMR. Setting this to the recommended value in the register description will guarantee that no enqueue rejections will ever occur. Signed-off-by: jiaheng.fan <jiaheng.fan@nxp.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/fsl-qdma.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c
index 8179b9a..cd5e065 100644
--- a/drivers/dma/fsl-qdma.c
+++ b/drivers/dma/fsl-qdma.c
@@ -62,6 +62,7 @@
#define FSL_QDMA_CQDSCR2 0xa0c
#define FSL_QDMA_CQIER 0xa10
#define FSL_QDMA_CQEDR 0xa14
+#define FSL_QDMA_SQCCMR 0xa20
#define FSL_QDMA_SQICR_ICEN
@@ -75,6 +76,7 @@
#define FSL_QDMA_BSQICR_ICST(x) ((x) << 16)
#define FSL_QDMA_CQIER_MEIE 0x80000000
#define FSL_QDMA_CQIER_TEIE 0x1
+#define FSL_QDMA_SQCCMR_ENTER_WM 0x200000
#define FSL_QDMA_QUEUE_MAX 8
@@ -815,6 +817,13 @@ static int fsl_qdma_reg_init(struct fsl_qdma_engine *fsl_qdma)
}
/*
+ * Workaround for erratum: ERR010812.
+ * We must enable XOFF to avoid the enqueue rejection occurs.
+ * Setting SQCCMR ENTER_WM to 0x20.
+ */
+ qdma_writel(fsl_qdma, FSL_QDMA_SQCCMR_ENTER_WM,
+ block + FSL_QDMA_SQCCMR);
+ /*
* Initialize status queue registers to point to the first
* command descriptor in memory.
* Dequeue Pointer Address Registers