Skip to contentSkip to conversation

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

PATCH Superseded Vinod Koul 1 participant 1 message May 21, 2018 dmaengine

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Vinod Koul

author
#0 lore raw

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

Quoted 24 lines · Wen He
Quoted 24 lines
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

+u64 pre_addr, pre_queue;

why do we have a global?

Let's us see qDMA that how is works?

First, the status notification for DMA jobs are reported back to the status

queue.

Quoted 3 lines

Status information is carried within the command descriptor status/command field, bits 120-127. The command descriptor dequeue pointer advances only after the transaction has completed and the status

information field has been updated.

Quoted 4 lines

Then, the command descriptor address field wiil pointer to the command descriptor in its original format. It is the responsibity of the address of the status queue consumer to deallocate buffers as needed when

the command descriptor address pointer is non-zero.

Quoted 2 lines

More details of the Status Queue can be found in QorIQ Layerscape Soc

datasheet.

Quoted 4 lines

So, these variable is used to record latest value that command descriptor queue and status field.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Every time variables value is zero when set these variable to local, that's not

what I want.

Why not store them in driver context?

okay, maybe I should remove these variable to private struct?

Yes that would be better

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+			memset(sg_block->virt_addr, 0,
+					FSL_QDMA_EXPECT_SG_ENTRY_NUM * 16);

why FSL_QDMA_EXPECT_SG_ENTRY_NUM * 16? and not what you

allocated?

Quoted 2 lines
Quoted 1 line
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

see line 497.
The sg_pool buffer size created is FSL_QDMA_EXPECT_SG_ENTRY_NUM *

16.

Please document this

Add comment to this?

yup, explaining where 16 is coming from