Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: <herbert@gondor.apana.org.au>, <t-kristo@ti.com>,
	<davem@davemloft.net>, <linux-crypto@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <j-keerthy@ti.com>
Subject: Re: [PATCH] crypto: sa2ul: Fix DMA mapping API usage
Date: Wed, 23 Sep 2020 10:48:36 +0300	[thread overview]
Message-ID: <593d5f9d-0629-f01d-4c67-112fc088bb4b@ti.com> (raw)
In-Reply-To: <20200923060246.GA11550@infradead.org>



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


      reply	other threads:[~2020-09-23  7:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 11:38 [PATCH] crypto: sa2ul: Fix DMA mapping API usage Peter Ujfalusi
2020-09-23  6:02 ` Christoph Hellwig
2020-09-23  7:48   ` Peter Ujfalusi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=593d5f9d-0629-f01d-4c67-112fc088bb4b@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=davem@davemloft.net \
    --cc=hch@infradead.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=j-keerthy@ti.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=t-kristo@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox