Re: [PATCH v3 2/6] crypto/realtek: core functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Freitag, dem 06.01.2023 um 17:02 +0800 schrieb Herbert Xu:
> Markus Stockhausen <markus.stockhausen@xxxxxx> wrote:
> > 
> > +void rtcr_add_src_to_ring(struct rtcr_crypto_dev *cdev, int idx,
> > void *vaddr,
> > +                         int blocklen, int totallen)
> > +{
> > +       dma_addr_t dma = cdev->src_dma + idx * RTCR_SRC_DESC_SIZE;
> > +       struct rtcr_src_desc *src = &cdev->src_ring[idx];
> > +
> > +       src->len = totallen;
> > +       src->paddr = virt_to_phys(vaddr);
> > +       src->opmode = RTCR_SRC_OP_OWN_ASIC |
> > RTCR_SRC_OP_CALC_EOR(idx) | blocklen;
> > +
> > +       dma_sync_single_for_device(cdev->dev, dma,
> > RTCR_SRC_DESC_SIZE, DMA_BIDIRECTIONAL);
> 
> Why aren't there any calls to dma_sync_single_for_cpu if this is
> truly bidirectional?
> 
> Cheers,

Thanks, I need to check this again. CPU sets ownership bit in that
descriptor to OWNED_BY_ASIC and after processing we expect that engine
has set it back to OWNED_BY_CPU. So bidirectional operation is somehow
needed.

Markus




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux