[v2,27/30] dma/dpaa: improve silent mode support

Message ID 20240722115843.1830105-28-g.singh@nxp.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series NXP DMA driver fixes and Enhancements |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Gagandeep Singh July 22, 2024, 11:58 a.m. UTC
From: Jun Yang <jun.yang@nxp.com>

Don't save eq context in silent mode, check HW status only to
identify if queue is full.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
---
 drivers/dma/dpaa/dpaa_qdma.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/dma/dpaa/dpaa_qdma.c b/drivers/dma/dpaa/dpaa_qdma.c
index 5d91ad2d70..8f5b6c6ea5 100644
--- a/drivers/dma/dpaa/dpaa_qdma.c
+++ b/drivers/dma/dpaa/dpaa_qdma.c
@@ -586,9 +586,13 @@  static int
 fsl_qdma_enqueue_desc_to_ring(struct fsl_qdma_queue *fsl_queue,
 	int is_burst)
 {
+	struct fsl_qdma_engine *fsl_qdma = fsl_queue->engine;
 	uint16_t i, num = fsl_queue->pending_num, idx, start, dq;
 	int ret, dq_cnt;
 
+	if (fsl_qdma->is_silent)
+		return 0;
+
 	num = is_burst ? fsl_queue->pending_num : 1;
 
 	fsl_queue->desc_in_hw[fsl_queue->ci] = num;
@@ -697,7 +701,7 @@  fsl_qdma_enqueue_overflow(struct fsl_qdma_queue *fsl_queue)
 
 	check_num = 0;
 overflow_check:
-	if (unlikely(s_hw_err_check)) {
+	if (fsl_qdma->is_silent || unlikely(s_hw_err_check)) {
 		reg = qdma_readl_be(block +
 			 FSL_QDMA_BCQSR(fsl_queue->queue_id));
 		overflow = (reg & FSL_QDMA_BCQSR_QF_XOFF_BE) ?
@@ -707,8 +711,14 @@  fsl_qdma_enqueue_overflow(struct fsl_qdma_queue *fsl_queue)
 			QDMA_QUEUE_CR_WM) ? 1 : 0;
 	}
 
-	if (likely(!overflow))
+	if (likely(!overflow)) {
 		return 0;
+	} else if (fsl_qdma->is_silent) {
+		check_num++;
+		if (check_num < 1000)
+			goto overflow_check;
+		return -ENOSPC;
+	}
 
 	DPAA_QDMA_DP_DEBUG("TC%d/Q%d submitted(%"PRIu64")-completed(%"PRIu64") >= %d",
 		fsl_queue->block_id, fsl_queue->queue_id,