linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: atmel: Add capability case for the 0x600 SHA and AES IP versions
@ 2022-12-07 13:59 Sergiu Moga
  2022-12-08 10:56 ` Nicolas Ferre
  2022-12-30 15:03 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Sergiu Moga @ 2022-12-07 13:59 UTC (permalink / raw)
  To: herbert, davem, nicolas.ferre, alexandre.belloni, claudiu.beznea
  Cc: linux-crypto, linux-arm-kernel, linux-kernel, Sergiu Moga

In order for the driver to be made aware of the capabilities of the SHA
and AES IP versions 0x600 , such as those present on the SAM9X60 SoC's,
add a corresponding switch case to the capability method of the respective
drivers. Without this, besides the capabilities not being correctly set,
the self tests may hang since the driver is endlessly waiting for a
completion to be set by a never occurring DMA interrupt handler.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
---
 drivers/crypto/atmel-aes.c | 1 +
 drivers/crypto/atmel-sha.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index 886bf258544c..063394cfa874 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -2510,6 +2510,7 @@ static void atmel_aes_get_cap(struct atmel_aes_dev *dd)
 	/* keep only major version number */
 	switch (dd->hw_version & 0xff0) {
 	case 0x700:
+	case 0x600:
 	case 0x500:
 		dd->caps.has_dualbuff = 1;
 		dd->caps.has_cfb64 = 1;
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index ca4b01926d1b..00be792e605c 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -2509,6 +2509,7 @@ static void atmel_sha_get_cap(struct atmel_sha_dev *dd)
 	/* keep only major version number */
 	switch (dd->hw_version & 0xff0) {
 	case 0x700:
+	case 0x600:
 	case 0x510:
 		dd->caps.has_dma = 1;
 		dd->caps.has_dualbuff = 1;
-- 
2.34.1


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

* Re: [PATCH] crypto: atmel: Add capability case for the 0x600 SHA and AES IP versions
  2022-12-07 13:59 [PATCH] crypto: atmel: Add capability case for the 0x600 SHA and AES IP versions Sergiu Moga
@ 2022-12-08 10:56 ` Nicolas Ferre
  2022-12-30 15:03 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Ferre @ 2022-12-08 10:56 UTC (permalink / raw)
  To: Sergiu Moga, herbert, davem, alexandre.belloni, claudiu.beznea
  Cc: linux-crypto, linux-arm-kernel, linux-kernel

On 07/12/2022 at 14:59, Sergiu Moga wrote:
> In order for the driver to be made aware of the capabilities of the SHA
> and AES IP versions 0x600 , such as those present on the SAM9X60 SoC's,
> add a corresponding switch case to the capability method of the respective
> drivers. Without this, besides the capabilities not being correctly set,
> the self tests may hang since the driver is endlessly waiting for a
> completion to be set by a never occurring DMA interrupt handler.
> 
> Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Thanks Sergiu, best regards,
   Nicolas

> ---
>   drivers/crypto/atmel-aes.c | 1 +
>   drivers/crypto/atmel-sha.c | 1 +
>   2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
> index 886bf258544c..063394cfa874 100644
> --- a/drivers/crypto/atmel-aes.c
> +++ b/drivers/crypto/atmel-aes.c
> @@ -2510,6 +2510,7 @@ static void atmel_aes_get_cap(struct atmel_aes_dev *dd)
>   	/* keep only major version number */
>   	switch (dd->hw_version & 0xff0) {
>   	case 0x700:
> +	case 0x600:
>   	case 0x500:
>   		dd->caps.has_dualbuff = 1;
>   		dd->caps.has_cfb64 = 1;
> diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
> index ca4b01926d1b..00be792e605c 100644
> --- a/drivers/crypto/atmel-sha.c
> +++ b/drivers/crypto/atmel-sha.c
> @@ -2509,6 +2509,7 @@ static void atmel_sha_get_cap(struct atmel_sha_dev *dd)
>   	/* keep only major version number */
>   	switch (dd->hw_version & 0xff0) {
>   	case 0x700:
> +	case 0x600:
>   	case 0x510:
>   		dd->caps.has_dma = 1;
>   		dd->caps.has_dualbuff = 1;

-- 
Nicolas Ferre


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

* Re: [PATCH] crypto: atmel: Add capability case for the 0x600 SHA and AES IP versions
  2022-12-07 13:59 [PATCH] crypto: atmel: Add capability case for the 0x600 SHA and AES IP versions Sergiu Moga
  2022-12-08 10:56 ` Nicolas Ferre
@ 2022-12-30 15:03 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2022-12-30 15:03 UTC (permalink / raw)
  To: Sergiu Moga
  Cc: davem, nicolas.ferre, alexandre.belloni, claudiu.beznea,
	linux-crypto, linux-arm-kernel, linux-kernel

On Wed, Dec 07, 2022 at 03:59:55PM +0200, Sergiu Moga wrote:
> In order for the driver to be made aware of the capabilities of the SHA
> and AES IP versions 0x600 , such as those present on the SAM9X60 SoC's,
> add a corresponding switch case to the capability method of the respective
> drivers. Without this, besides the capabilities not being correctly set,
> the self tests may hang since the driver is endlessly waiting for a
> completion to be set by a never occurring DMA interrupt handler.
> 
> Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
> ---
>  drivers/crypto/atmel-aes.c | 1 +
>  drivers/crypto/atmel-sha.c | 1 +
>  2 files changed, 2 insertions(+)

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

end of thread, other threads:[~2022-12-30 15:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-07 13:59 [PATCH] crypto: atmel: Add capability case for the 0x600 SHA and AES IP versions Sergiu Moga
2022-12-08 10:56 ` Nicolas Ferre
2022-12-30 15:03 ` 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).