From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Romain Perier <romain.perier@free-electrons.com>
Cc: Arnaud Ebalard <arno@natisbad.org>,
"David S. Miller" <davem@davemloft.net>,
linux-crypto@vger.kernel.org,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Gregory Clement <gregory.clement@free-electrons.com>
Subject: Re: [PATCH] crypto: marvell - Update cache with input sg only when it is unmapped
Date: Mon, 25 Jul 2016 14:33:39 +0200 [thread overview]
Message-ID: <20160725143339.53f747f6@bbrezillon> (raw)
In-Reply-To: <1469195184-4700-1-git-send-email-romain.perier@free-electrons.com>
On Fri, 22 Jul 2016 15:46:24 +0200
Romain Perier <romain.perier@free-electrons.com> wrote:
> So far, the cache of the ahash requests was updated from the 'complete'
> operation. This complete operation is called from mv_cesa_tdma_process
> before the cleanup operation, which means that the content of req->src
> can be read and copied when it is still mapped. This commit fixes the
> issue by moving this cache update from mv_cesa_ahash_complete to
> mv_cesa_ahash_req_cleanup, so the copy is done once the sglist is
> unmapped.
>
> Fixes: 1bf6682cb31d ("crypto: marvell - Add a complete operation for..")
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
> drivers/crypto/marvell/hash.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/crypto/marvell/hash.c b/drivers/crypto/marvell/hash.c
> index c35912b..82e0f4e6 100644
> --- a/drivers/crypto/marvell/hash.c
> +++ b/drivers/crypto/marvell/hash.c
> @@ -315,12 +315,6 @@ static void mv_cesa_ahash_complete(struct crypto_async_request *req)
> for (i = 0; i < digsize / 4; i++)
> creq->state[i] = readl_relaxed(engine->regs + CESA_IVDIG(i));
>
> - if (creq->cache_ptr)
> - sg_pcopy_to_buffer(ahashreq->src, creq->src_nents,
> - creq->cache,
> - creq->cache_ptr,
> - ahashreq->nbytes - creq->cache_ptr);
> -
> if (creq->last_req) {
> /*
> * Hardware's MD5 digest is in little endian format, but
> @@ -365,6 +359,12 @@ static void mv_cesa_ahash_req_cleanup(struct crypto_async_request *req)
> mv_cesa_ahash_last_cleanup(ahashreq);
>
> mv_cesa_ahash_cleanup(ahashreq);
> +
> + if (creq->cache_ptr)
> + sg_pcopy_to_buffer(ahashreq->src, creq->src_nents,
> + creq->cache,
> + creq->cache_ptr,
> + ahashreq->nbytes - creq->cache_ptr);
> }
>
> static const struct mv_cesa_req_ops mv_cesa_ahash_req_ops = {
next prev parent reply other threads:[~2016-07-25 12:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-22 13:46 [PATCH] crypto: marvell - Update cache with input sg only when it is unmapped Romain Perier
2016-07-25 12:33 ` Boris Brezillon [this message]
2016-07-28 5:21 ` Herbert Xu
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=20160725143339.53f747f6@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=andrew@lunn.ch \
--cc=arno@natisbad.org \
--cc=davem@davemloft.net \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=linux-crypto@vger.kernel.org \
--cc=romain.perier@free-electrons.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=thomas.petazzoni@free-electrons.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