Thread (22 messages) 22 messages, 4 authors, 2021-02-11

Re: [PATCH] dmaengine: qcom: bam_dma: Add LOCK and UNLOCK flag bit support

From: Vinod Koul <vkoul@kernel.org>
Date: 2021-02-01 06:48:43
Also in: linux-arm-msm, linux-doc, lkml

On 01-02-21, 11:52, mdalam@codeaurora.org wrote:
On 2021-02-01 11:35, Vinod Koul wrote:
quoted
On 27-01-21, 23:56, mdalam@codeaurora.org wrote:
quoted
quoted
  The actual LOCK/UNLOCK flag should be set on hardware command
descriptor.
  so this flag setting should be done in DMA engine driver. The user
of the
DMA
  driver like (in case of IPQ5018) Crypto can use flag
"DMA_PREP_LOCK" &
"DMA_PREP_UNLOCK"
  while preparing CMD descriptor before submitting to the DMA
engine. In DMA
engine driver
  we are checking these flasgs on CMD descriptor and setting actual
LOCK/UNLOCK flag on hardware
  descriptor.

I am not sure I comprehend this yet.. when is that we would need to do
this... is this for each txn submitted to dmaengine.. or something
else..
 Its not for each transaction submitted to dmaengine. We have to set this
only
 once on CMD descriptor. So when A53 crypto driver need to change the crypto
configuration
 then first it will lock the all other pipes using setting the LOCK flag bit
on CMD
 descriptor and then it can start the transaction , on data descriptor this
flag will
 not get set once all transaction will be completed the A53 crypto driver
release the lock on
 all other pipes using UNLOCK flag on CMD descriptor. So LOCK/UNLOCK will be
only once and not for
 the each transaction.
Okay so why cant the bam driver check cmd descriptor and do lock/unlock
as below, why do we need users to do this.

        if (flags & DMA_PREP_CMD) {
                do_lock_bam();

The point here is that this seems to be internal to dma and should be
handled by dma driver.

Also if we do this, it needs to be done for specific platforms..

Thanks

-- 
~Vinod
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help