LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2] crypto: omap-sham: Add the offset of sg page to vaddr
@ 2015-04-02 10:02 Lokesh Vutla
  2015-04-03 10:00 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Lokesh Vutla @ 2015-04-02 10:02 UTC (permalink / raw)
  To: herbert, linux-crypto
  Cc: linux-omap, linux-kernel, nsekhar, t-kristo, Lokesh Vutla

kmap_atomic() gives only the page address of the input page.
Driver should take care of adding the offset of the scatterlist
within the page to the returned page address.
omap-sham driver is not adding the offset to page and directly operates
on the return vale of kmap_atomic(), because of which the following
error comes when running crypto tests:

00000000: d9 a1 1b 7c aa 90 3b aa 11 ab cb 25 00 b8 ac bf
[    2.338169] 00000010: c1 39 cd ff 48 d0 a8 e2 2b fa 33 a1
[    2.344008] alg: hash: Chunking test 1 failed for omap-sha256

So adding the scatterlist offset to vaddr.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
- Tested on BBB. Logs below.
	Without this patch: http://pastebin.ubuntu.com/10722994/
	With this patch: http://pastebin.ubuntu.com/10722992/
 drivers/crypto/omap-sham.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index 21fd515..4d63e0d 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -640,6 +640,7 @@ static size_t omap_sham_append_sg(struct omap_sham_reqctx *ctx)
 
 	while (ctx->sg) {
 		vaddr = kmap_atomic(sg_page(ctx->sg));
+		vaddr += ctx->sg->offset;
 
 		count = omap_sham_append_buffer(ctx,
 				vaddr + ctx->offset,
-- 
1.9.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] crypto: omap-sham: Add the offset of sg page to vaddr
  2015-04-02 10:02 [PATCH v2] crypto: omap-sham: Add the offset of sg page to vaddr Lokesh Vutla
@ 2015-04-03 10:00 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2015-04-03 10:00 UTC (permalink / raw)
  To: Lokesh Vutla; +Cc: linux-crypto, linux-omap, linux-kernel, nsekhar, t-kristo

On Thu, Apr 02, 2015 at 03:32:45PM +0530, Lokesh Vutla wrote:
> kmap_atomic() gives only the page address of the input page.
> Driver should take care of adding the offset of the scatterlist
> within the page to the returned page address.
> omap-sham driver is not adding the offset to page and directly operates
> on the return vale of kmap_atomic(), because of which the following
> error comes when running crypto tests:
> 
> 00000000: d9 a1 1b 7c aa 90 3b aa 11 ab cb 25 00 b8 ac bf
> [    2.338169] 00000010: c1 39 cd ff 48 d0 a8 e2 2b fa 33 a1
> [    2.344008] alg: hash: Chunking test 1 failed for omap-sha256
> 
> So adding the scatterlist offset to vaddr.
> 
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

Patch applied.  Thanks!
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-03 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02 10:02 [PATCH v2] crypto: omap-sham: Add the offset of sg page to vaddr Lokesh Vutla
2015-04-03 10:00 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).