diff mbox series

[-next] crypto: atmel - Fix randbuild error

Message ID 20191111133901.19164-1-yuehaibing@huawei.com (mailing list archive)
State Changes Requested
Delegated to: Herbert Xu
Headers show
Series [-next] crypto: atmel - Fix randbuild error | expand

Commit Message

Yue Haibing Nov. 11, 2019, 1:39 p.m. UTC
If CRYPTO_AUTHENC is m, CRYPTO_DEV_ATMEL_SHA is m, but
CRYPTO_DEV_ATMEL_AES is y, building will fails:

drivers/crypto/atmel-aes.o: In function `atmel_aes_authenc_init_tfm':
atmel-aes.c:(.text+0x670): undefined reference to `atmel_sha_authenc_get_reqsize'
atmel-aes.c:(.text+0x67a): undefined reference to `atmel_sha_authenc_spawn'
drivers/crypto/atmel-aes.o: In function `atmel_aes_authenc_setkey':
atmel-aes.c:(.text+0x7e5): undefined reference to `atmel_sha_authenc_setkey'

Fix this by moving the selection of CRYPTO_DEV_ATMEL_SHA under
CRYPTO_DEV_ATMEL_AES.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 89a82ef87e01 ("crypto: atmel-authenc - add support to...")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/crypto/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu Nov. 12, 2019, 2:13 a.m. UTC | #1
On Mon, Nov 11, 2019 at 09:39:01PM +0800, YueHaibing wrote:
> If CRYPTO_AUTHENC is m, CRYPTO_DEV_ATMEL_SHA is m, but
> CRYPTO_DEV_ATMEL_AES is y, building will fails:
> 
> drivers/crypto/atmel-aes.o: In function `atmel_aes_authenc_init_tfm':
> atmel-aes.c:(.text+0x670): undefined reference to `atmel_sha_authenc_get_reqsize'
> atmel-aes.c:(.text+0x67a): undefined reference to `atmel_sha_authenc_spawn'
> drivers/crypto/atmel-aes.o: In function `atmel_aes_authenc_setkey':
> atmel-aes.c:(.text+0x7e5): undefined reference to `atmel_sha_authenc_setkey'
> 
> Fix this by moving the selection of CRYPTO_DEV_ATMEL_SHA under
> CRYPTO_DEV_ATMEL_AES.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: 89a82ef87e01 ("crypto: atmel-authenc - add support to...")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

This patch shows that moving CRYPTO_AUTHENC over was just papering
over a real problem.  Applying your patch essentially makes SHA
the same option as AES.

What we should do instead is turn DEV_ATMEL_AUTHENC into a bool,
and then add these to DEV_ATMEL_AES:

	select CRYPTO_AUTHENC if CRYPTO_DEV_ATMEL_AUTHENC
	select CRYPTO_DEV_ATMEL_SHA if CRYPTO_DEV_ATMEL_AUTHENC

Could you please do this and repost?

Thanks,
Herbert Xu Nov. 12, 2019, 2:15 a.m. UTC | #2
On Tue, Nov 12, 2019 at 10:13:50AM +0800, Herbert Xu wrote:
>
> What we should do instead is turn DEV_ATMEL_AUTHENC into a bool,

Oh and DEV_ATMEL_AUTHENC should also depend on CRYPTO_DEV_ATMEL_AES
and lose all its selects.

Cheers,
Tudor Ambarus Nov. 12, 2019, 11:56 a.m. UTC | #3
On 11/12/2019 04:15 AM, Herbert Xu wrote:
> External E-Mail
> 
> 
> On Tue, Nov 12, 2019 at 10:13:50AM +0800, Herbert Xu wrote:
>>
>> What we should do instead is turn DEV_ATMEL_AUTHENC into a bool,
> 
> Oh and DEV_ATMEL_AUTHENC should also depend on CRYPTO_DEV_ATMEL_AES
> and lose all its selects.
> 

How about getting rid of CONFIG_CRYPTO_DEV_ATMEL_AUTHENC entirely?

ta
Tudor Ambarus Nov. 12, 2019, 12:16 p.m. UTC | #4
On 11/12/2019 01:56 PM, Tudor.Ambarus@microchip.com wrote:
> 
> 
> On 11/12/2019 04:15 AM, Herbert Xu wrote:
>> External E-Mail
>>
>>
>> On Tue, Nov 12, 2019 at 10:13:50AM +0800, Herbert Xu wrote:
>>>
>>> What we should do instead is turn DEV_ATMEL_AUTHENC into a bool,
>>
>> Oh and DEV_ATMEL_AUTHENC should also depend on CRYPTO_DEV_ATMEL_AES
>> and lose all its selects.
>>
> 
> How about getting rid of CONFIG_CRYPTO_DEV_ATMEL_AUTHENC entirely?
> 

mm, we can't do this because atmel-aes and atmel-sha are treated as two
separated entities.
diff mbox series

Patch

diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index c5cc04d..148605a 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -495,7 +495,6 @@  config CRYPTO_DEV_ATMEL_AUTHENC
 	tristate "Support for Atmel IPSEC/SSL hw accelerator"
 	depends on ARCH_AT91 || COMPILE_TEST
 	select CRYPTO_DEV_ATMEL_AES
-	select CRYPTO_DEV_ATMEL_SHA
 	help
 	  Some Atmel processors can combine the AES and SHA hw accelerators
 	  to enhance support of IPSEC/SSL.
@@ -509,6 +508,7 @@  config CRYPTO_DEV_ATMEL_AES
 	select CRYPTO_AEAD
 	select CRYPTO_AUTHENC
 	select CRYPTO_SKCIPHER
+	select CRYPTO_DEV_ATMEL_SHA
 	help
 	  Some Atmel processors have AES hw accelerator.
 	  Select this if you want to use the Atmel module for