Skip to contentSkip to conversation

dmaengine: fsl-qdma: Add qDMA controller driver for Layerscape SoCs

PATCH Superseded Vinod Koul 1 participant 1 message Jun 5, 2018 dmaengine

v5 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Vinod Koul

author maintainer
#0 lore raw

PATCH v5 2/6 dmaengine: fsl-qdma: Add qDMA controller driver for Layerscape SoCs

Quoted 25 lines · Wen He
Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
Quoted 16 lines
Quoted 6 lines
Quoted 6 lines
(quoted diff) +6 -0
+static void fsl_qdma_issue_pending(struct dma_chan *chan) {
+	struct fsl_qdma_chan *fsl_chan = to_fsl_qdma_chan(chan);
+	struct fsl_qdma_queue *fsl_queue = fsl_chan->queue;
+	unsigned long flags;
+
+	spin_lock_irqsave(&fsl_queue->queue_lock, flags);
Quoted 9 lines

Review

Quoted 5 lines
(quoted diff) +5 -0
+	spin_lock(&fsl_chan->vchan.lock);
+	if (vchan_issue_pending(&fsl_chan->vchan))
+		fsl_qdma_enqueue_desc(fsl_chan);
+	spin_unlock(&fsl_chan->vchan.lock);
+	spin_unlock_irqrestore(&fsl_queue->queue_lock, flags);

why do we need two locks, and since you are doing vchan why should you add your own lock on top

Quoted 3 lines

Yes, we need two locks.
As you know, the QDMA support multiple virtualized blocks for multi-core

support.

Quoted 1 line

so we need to make sure that muliti-core access issues.

but why cant you use vchan lock for all?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

We can't only use vchan lock for all. otherwise enqueue action will be

interrupted.

I think it is possible to use only vchan lock

I tried that if I use only vchan lock then qdma will be can't work. Do you have a other good idea?

can you explain the scenario...