[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <593d5f9d-0629-f01d-4c67-112fc088bb4b@ti.com>
Date: Wed, 23 Sep 2020 10:48:36 +0300
From: Peter Ujfalusi <peter.ujfalusi@...com>
To: Christoph Hellwig <hch@...radead.org>
CC: <herbert@...dor.apana.org.au>, <t-kristo@...com>,
<davem@...emloft.net>, <linux-crypto@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <j-keerthy@...com>
Subject: Re: [PATCH] crypto: sa2ul: Fix DMA mapping API usage
On 23/09/2020 9.02, Christoph Hellwig wrote:
> On Mon, Sep 21, 2020 at 02:38:46PM +0300, Peter Ujfalusi wrote:
>> Make sure that we call the dma_unmap_sg on the correct scatterlist on
>> completion with the correct sg_nents.
>>
>> We also should be calling dma_sync_sg_for_device() on the tx buffer before
>> giving it to the DMA and the dma_sync_sg_for_cpu() should be called on the
>> scatterlist we received the data back.
>
> You might want to look into using struct sg_table and the DMA mapping
> helpers using it to simplify this a bit.
It would have simplified it a bit further if the dma_map_sgtable() would
have saved the dir we used when mapping (and then dma_unmap_sgtable()
would use the stored dir) and had a bool to tell that the mapping was
successful.
I'll send v2 with the use of sg_table in a bit after running some tests
to make sure it is working as expected. It is passing the extended boot
time tests on j721e.
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Powered by blists - more mailing lists