On 01-02-21, 11:52, mdalam@xxxxxxxxxxxxxx wrote: > On 2021-02-01 11:35, Vinod Koul wrote: > > On 27-01-21, 23:56, mdalam@xxxxxxxxxxxxxx wrote: > > > 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