linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] marvell/cesa - Fix sparse warnings breaks driver
@ 2021-01-18  9:18 Sven Auhagen
  2021-01-20  5:26 ` Herbert Xu
  0 siblings, 1 reply; 5+ messages in thread
From: Sven Auhagen @ 2021-01-18  9:18 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto

Hi Herbert,

your patch crypto: marvell/cesa - Fix sparse warnings unfortunately
breaks the cesa driver.

I am using it on my Armada 388 board and with that patch
applied the self test stalls indefinitely.

I tried to find out which part of the patch but it seems
all of the different changes have beaking side effects.

Removing the swab is a breaking change as well as
introducing the dst_dma and src_dma variables.

Also on my 5.10 Kernel the hash tests are failing now
but this also happens when I remove your patch:

[    6.859791] alg: ahash: mv-hmac-md5 test failed (wrong result) on test vector 0, cfg="init+update+final aligned buffer"
[    6.883144] alg: ahash: mv-hmac-sha1 test failed (wrong result) on test vector 0, cfg="init+update+final aligned buffer"
[    6.923069] alg: ahash: mv-hmac-sha256 test failed (wrong result) on test vector 0, cfg="init+update+final aligned buffer"

You might need to revert the patch.

Let me know if I can debug it in any way.

Best
Sven


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

* Re: [BUG] marvell/cesa - Fix sparse warnings breaks driver
  2021-01-18  9:18 [BUG] marvell/cesa - Fix sparse warnings breaks driver Sven Auhagen
@ 2021-01-20  5:26 ` Herbert Xu
  2021-01-20  5:40   ` [PATCH] crypto: marvel/cesa - Fix tdma descriptor on 64-bit Herbert Xu
  2021-01-20  6:17   ` [BUG] marvell/cesa - Fix sparse warnings breaks driver Sven Auhagen
  0 siblings, 2 replies; 5+ messages in thread
From: Herbert Xu @ 2021-01-20  5:26 UTC (permalink / raw)
  To: Sven Auhagen; +Cc: linux-crypto

On Mon, Jan 18, 2021 at 10:18:08AM +0100, Sven Auhagen wrote:
>
> Also on my 5.10 Kernel the hash tests are failing now
> but this also happens when I remove your patch:
> 
> [    6.859791] alg: ahash: mv-hmac-md5 test failed (wrong result) on test vector 0, cfg="init+update+final aligned buffer"
> [    6.883144] alg: ahash: mv-hmac-sha1 test failed (wrong result) on test vector 0, cfg="init+update+final aligned buffer"
> [    6.923069] alg: ahash: mv-hmac-sha256 test failed (wrong result) on test vector 0, cfg="init+update+final aligned buffer"

Are these errors with or without my patch?

Is your machine big-endian or little-endian?

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] 5+ messages in thread

* [PATCH] crypto: marvel/cesa - Fix tdma descriptor on 64-bit
  2021-01-20  5:26 ` Herbert Xu
@ 2021-01-20  5:40   ` Herbert Xu
  2021-01-20 10:51     ` Sven Auhagen
  2021-01-20  6:17   ` [BUG] marvell/cesa - Fix sparse warnings breaks driver Sven Auhagen
  1 sibling, 1 reply; 5+ messages in thread
From: Herbert Xu @ 2021-01-20  5:40 UTC (permalink / raw)
  To: Sven Auhagen; +Cc: linux-crypto

On Wed, Jan 20, 2021 at 04:26:29PM +1100, Herbert Xu wrote:
>
> Is your machine big-endian or little-endian?

Does this patch fix your problem?

---8<---
The patch that added src_dma/dst_dma to struct mv_cesa_tdma_desc
is broken on 64-bit systems as the size of the descriptor has been
changed.  This patch fixes it by using u32 instead of dma_addr_t.

Fixes: e62291c1d9f4 ("crypto: marvell/cesa - Fix sparse warnings")
Reported-by: Sven Auhagen <sven.auhagen@voleatech.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/drivers/crypto/marvell/cesa/cesa.h b/drivers/crypto/marvell/cesa/cesa.h
index fabfaaccca87..fa56b45620c7 100644
--- a/drivers/crypto/marvell/cesa/cesa.h
+++ b/drivers/crypto/marvell/cesa/cesa.h
@@ -300,11 +300,11 @@ struct mv_cesa_tdma_desc {
 	__le32 byte_cnt;
 	union {
 		__le32 src;
-		dma_addr_t src_dma;
+		u32 src_dma;
 	};
 	union {
 		__le32 dst;
-		dma_addr_t dst_dma;
+		u32 dst_dma;
 	};
 	__le32 next_dma;
 
-- 
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 related	[flat|nested] 5+ messages in thread

* Re: [BUG] marvell/cesa - Fix sparse warnings breaks driver
  2021-01-20  5:26 ` Herbert Xu
  2021-01-20  5:40   ` [PATCH] crypto: marvel/cesa - Fix tdma descriptor on 64-bit Herbert Xu
@ 2021-01-20  6:17   ` Sven Auhagen
  1 sibling, 0 replies; 5+ messages in thread
From: Sven Auhagen @ 2021-01-20  6:17 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-crypto

On Wed, Jan 20, 2021 at 04:26:29PM +1100, Herbert Xu wrote:
> On Mon, Jan 18, 2021 at 10:18:08AM +0100, Sven Auhagen wrote:
> >
> > Also on my 5.10 Kernel the hash tests are failing now
> > but this also happens when I remove your patch:
> > 
> > [    6.859791] alg: ahash: mv-hmac-md5 test failed (wrong result) on test vector 0, cfg="init+update+final aligned buffer"
> > [    6.883144] alg: ahash: mv-hmac-sha1 test failed (wrong result) on test vector 0, cfg="init+update+final aligned buffer"
> > [    6.923069] alg: ahash: mv-hmac-sha256 test failed (wrong result) on test vector 0, cfg="init+update+final aligned buffer"
> 
> Are these errors with or without my patch?

Without the patch.
With the patch the tests never finish and the entire
system hangs.

> 
> Is your machine big-endian or little-endian?
> 

It is armhf so little-endian.

Best
Sven

> Thanks,
> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: https://eur03.safelinks.protection.outlook.com/?url=http:%2F%2Fgondor.apana.org.au%2F~herbert%2F&amp;data=04%7C01%7Csven.auhagen%40voleatech.de%7C0e9b8c37f9ec46a6cb7608d8bd03f50a%7Cb82a99f679814a7295344d35298f847b%7C0%7C0%7C637467172009606124%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=rVPM0bynvNOKPxE3nYbEtloPcS5tSJBJh1KyDNCem5g%3D&amp;reserved=0
> PGP Key: https://eur03.safelinks.protection.outlook.com/?url=http:%2F%2Fgondor.apana.org.au%2F~herbert%2Fpubkey.txt&amp;data=04%7C01%7Csven.auhagen%40voleatech.de%7C0e9b8c37f9ec46a6cb7608d8bd03f50a%7Cb82a99f679814a7295344d35298f847b%7C0%7C0%7C637467172009606124%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=TpNGCvaGo9yXH%2B9L82lkrH3EmbhCUwWxrCgY%2FNkXTVM%3D&amp;reserved=0

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

* Re: [PATCH] crypto: marvel/cesa - Fix tdma descriptor on 64-bit
  2021-01-20  5:40   ` [PATCH] crypto: marvel/cesa - Fix tdma descriptor on 64-bit Herbert Xu
@ 2021-01-20 10:51     ` Sven Auhagen
  0 siblings, 0 replies; 5+ messages in thread
From: Sven Auhagen @ 2021-01-20 10:51 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-crypto

On Wed, Jan 20, 2021 at 04:40:45PM +1100, Herbert Xu wrote:
> On Wed, Jan 20, 2021 at 04:26:29PM +1100, Herbert Xu wrote:
> >
> > Is your machine big-endian or little-endian?
> 
> Does this patch fix your problem?

Yes, it fixes the problem and also the failing hash test.

Thanks and best
Sven

> 
> ---8<---
> The patch that added src_dma/dst_dma to struct mv_cesa_tdma_desc
> is broken on 64-bit systems as the size of the descriptor has been
> changed.  This patch fixes it by using u32 instead of dma_addr_t.
> 
> Fixes: e62291c1d9f4 ("crypto: marvell/cesa - Fix sparse warnings")
> Reported-by: Sven Auhagen <sven.auhagen@voleatech.de>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> 
> diff --git a/drivers/crypto/marvell/cesa/cesa.h b/drivers/crypto/marvell/cesa/cesa.h
> index fabfaaccca87..fa56b45620c7 100644
> --- a/drivers/crypto/marvell/cesa/cesa.h
> +++ b/drivers/crypto/marvell/cesa/cesa.h
> @@ -300,11 +300,11 @@ struct mv_cesa_tdma_desc {
>  	__le32 byte_cnt;
>  	union {
>  		__le32 src;
> -		dma_addr_t src_dma;
> +		u32 src_dma;
>  	};
>  	union {
>  		__le32 dst;
> -		dma_addr_t dst_dma;
> +		u32 dst_dma;
>  	};
>  	__le32 next_dma;
>  
> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: https://eur03.safelinks.protection.outlook.com/?url=http:%2F%2Fgondor.apana.org.au%2F~herbert%2F&amp;data=04%7C01%7Csven.auhagen%40voleatech.de%7Ca0b247450d1b4580bc8408d8bd05f397%7Cb82a99f679814a7295344d35298f847b%7C0%7C0%7C637467180564502107%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=HN3G1xs2oayGqA7gCAuPe57Fshkjci1ObQIz7PouXC8%3D&amp;reserved=0
> PGP Key: https://eur03.safelinks.protection.outlook.com/?url=http:%2F%2Fgondor.apana.org.au%2F~herbert%2Fpubkey.txt&amp;data=04%7C01%7Csven.auhagen%40voleatech.de%7Ca0b247450d1b4580bc8408d8bd05f397%7Cb82a99f679814a7295344d35298f847b%7C0%7C0%7C637467180564512065%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=6VdTmXDuV4ed5p%2B8ATbjpn%2BObkSqBFyqjkRYPod8sC4%3D&amp;reserved=0

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

end of thread, other threads:[~2021-01-20 12:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18  9:18 [BUG] marvell/cesa - Fix sparse warnings breaks driver Sven Auhagen
2021-01-20  5:26 ` Herbert Xu
2021-01-20  5:40   ` [PATCH] crypto: marvel/cesa - Fix tdma descriptor on 64-bit Herbert Xu
2021-01-20 10:51     ` Sven Auhagen
2021-01-20  6:17   ` [BUG] marvell/cesa - Fix sparse warnings breaks driver Sven Auhagen

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).