linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] crypto: aspeed: fix build module error
@ 2022-09-05  2:54 Neal Liu
  2022-09-05 11:04 ` Herbert Xu
  2022-09-06  4:53 ` Herbert Xu
  0 siblings, 2 replies; 7+ messages in thread
From: Neal Liu @ 2022-09-05  2:54 UTC (permalink / raw)
  To: Herbert Xu, David S . Miller, Joel Stanley, Andrew Jeffery
  Cc: linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel,
	BMC-SW, kernel test robot, Sudip Mukherjee

If CONFIG_MODULES=y and CONFIG_CRYPTO_DEV_ASPEED=m,
build modpost would be failed.

Error messages:
  ERROR: modpost: "aspeed_register_hace_hash_algs"
  [drivers/crypto/aspeed/aspeed_crypto.ko] undefined!
  ERROR: modpost: "aspeed_unregister_hace_hash_algs"
  [drivers/crypto/aspeed/aspeed_crypto.ko] undefined!

Change build sequence to fix this.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
v2: Remove redundant obj- lines.

 drivers/crypto/aspeed/Makefile | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/aspeed/Makefile b/drivers/crypto/aspeed/Makefile
index 421e2ca9c53e..3be78cec0ecb 100644
--- a/drivers/crypto/aspeed/Makefile
+++ b/drivers/crypto/aspeed/Makefile
@@ -1,9 +1,6 @@
+hace-hash-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_HASH) := aspeed-hace.o aspeed-hace-hash.o
+hace-crypto-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_CRYPTO) := aspeed-hace.o aspeed-hace-crypto.o
+
 obj-$(CONFIG_CRYPTO_DEV_ASPEED) += aspeed_crypto.o
-aspeed_crypto-objs := aspeed-hace.o	\
-		      $(hace-hash-y)	\
+aspeed_crypto-objs := $(hace-hash-y)	\
 		      $(hace-crypto-y)
-
-obj-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_HASH) += aspeed-hace-hash.o
-hace-hash-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_HASH) := aspeed-hace-hash.o
-obj-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_CRYPTO) += aspeed-hace-crypto.o
-hace-crypto-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_CRYPTO) := aspeed-hace-crypto.o
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] crypto: aspeed: fix build module error
  2022-09-05  2:54 [PATCH v2] crypto: aspeed: fix build module error Neal Liu
@ 2022-09-05 11:04 ` Herbert Xu
  2022-09-06  2:21   ` Neal Liu
  2022-09-06  4:53 ` Herbert Xu
  1 sibling, 1 reply; 7+ messages in thread
From: Herbert Xu @ 2022-09-05 11:04 UTC (permalink / raw)
  To: Neal Liu
  Cc: David S . Miller, Joel Stanley, Andrew Jeffery, linux-aspeed,
	linux-crypto, linux-arm-kernel, linux-kernel, BMC-SW,
	kernel test robot, Sudip Mukherjee

On Mon, Sep 05, 2022 at 10:54:33AM +0800, Neal Liu wrote:
>
> diff --git a/drivers/crypto/aspeed/Makefile b/drivers/crypto/aspeed/Makefile
> index 421e2ca9c53e..3be78cec0ecb 100644
> --- a/drivers/crypto/aspeed/Makefile
> +++ b/drivers/crypto/aspeed/Makefile
> @@ -1,9 +1,6 @@
> +hace-hash-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_HASH) := aspeed-hace.o aspeed-hace-hash.o
> +hace-crypto-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_CRYPTO) := aspeed-hace.o aspeed-hace-crypto.o
> +
>  obj-$(CONFIG_CRYPTO_DEV_ASPEED) += aspeed_crypto.o
> -aspeed_crypto-objs := aspeed-hace.o	\
> -		      $(hace-hash-y)	\
> +aspeed_crypto-objs := $(hace-hash-y)	\
>  		      $(hace-crypto-y)

Does this still build if both HASH and CRYPTO are off?

I think this it's best if you do:

hace-hash-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_HASH) := aspeed-hace-hash.o
hace-crypto-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_CRYPTO) := aspeed-hace-crypto.o

obj-$(CONFIG_CRYPTO_DEV_ASPEED) += aspeed_crypto.o
aspeed_crypto-objs := aspeed-hace.o	\
		      $(hace-hash-y)	\
		      $(hace-crypto-y)

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH v2] crypto: aspeed: fix build module error
  2022-09-05 11:04 ` Herbert Xu
@ 2022-09-06  2:21   ` Neal Liu
  2022-09-16 10:42     ` Herbert Xu
  0 siblings, 1 reply; 7+ messages in thread
From: Neal Liu @ 2022-09-06  2:21 UTC (permalink / raw)
  To: Herbert Xu
  Cc: David S . Miller, Joel Stanley, Andrew Jeffery, linux-aspeed,
	linux-crypto, linux-arm-kernel, linux-kernel, BMC-SW,
	kernel test robot, Sudip Mukherjee

> -----Original Message-----
> From: Herbert Xu <herbert@gondor.apana.org.au>
> Sent: Monday, September 5, 2022 7:04 PM
> To: Neal Liu <neal_liu@aspeedtech.com>
> Cc: David S . Miller <davem@davemloft.net>; Joel Stanley <joel@jms.id.au>;
> Andrew Jeffery <andrew@aj.id.au>; linux-aspeed@lists.ozlabs.org;
> linux-crypto@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; BMC-SW <BMC-SW@aspeedtech.com>; kernel
> test robot <lkp@intel.com>; Sudip Mukherjee
> <sudipm.mukherjee@gmail.com>
> Subject: Re: [PATCH v2] crypto: aspeed: fix build module error
> 
> On Mon, Sep 05, 2022 at 10:54:33AM +0800, Neal Liu wrote:
> >
> > diff --git a/drivers/crypto/aspeed/Makefile
> > b/drivers/crypto/aspeed/Makefile index 421e2ca9c53e..3be78cec0ecb
> > 100644
> > --- a/drivers/crypto/aspeed/Makefile
> > +++ b/drivers/crypto/aspeed/Makefile
> > @@ -1,9 +1,6 @@
> > +hace-hash-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_HASH) := aspeed-hace.o
> > +aspeed-hace-hash.o
> > +hace-crypto-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_CRYPTO) :=
> aspeed-hace.o
> > +aspeed-hace-crypto.o
> > +
> >  obj-$(CONFIG_CRYPTO_DEV_ASPEED) += aspeed_crypto.o
> > -aspeed_crypto-objs := aspeed-hace.o	\
> > -		      $(hace-hash-y)	\
> > +aspeed_crypto-objs := $(hace-hash-y)	\
> >  		      $(hace-crypto-y)
> 
> Does this still build if both HASH and CRYPTO are off?
> 
> I think this it's best if you do:
> 
> hace-hash-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_HASH) :=
> aspeed-hace-hash.o
> hace-crypto-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_CRYPTO) :=
> aspeed-hace-crypto.o
> 
> obj-$(CONFIG_CRYPTO_DEV_ASPEED) += aspeed_crypto.o
> aspeed_crypto-objs := aspeed-hace.o	\
> 		      $(hace-hash-y)	\
> 		      $(hace-crypto-y)
> 

aspeed-hace.o effects only if either hace-hash-y or hace-crypto-y.
If we put aspeed-hace.o in aspeed_crypto-objs, but hace-hash-y and hace-crypto-y are empty, apseed-hace.o is just an useless driver which might still occupy system resources.

For this patch, you're right it would still build if both HASH & CRYPTO are off. But no driver would be run up.
That's why I revise it from your suggestion to this patch.
Thanks.

> 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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] crypto: aspeed: fix build module error
  2022-09-05  2:54 [PATCH v2] crypto: aspeed: fix build module error Neal Liu
  2022-09-05 11:04 ` Herbert Xu
@ 2022-09-06  4:53 ` Herbert Xu
  1 sibling, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2022-09-06  4:53 UTC (permalink / raw)
  To: Neal Liu
  Cc: David S . Miller, Joel Stanley, Andrew Jeffery, linux-aspeed,
	linux-crypto, linux-arm-kernel, linux-kernel, BMC-SW,
	kernel test robot, Sudip Mukherjee

On Mon, Sep 05, 2022 at 10:54:33AM +0800, Neal Liu wrote:
> If CONFIG_MODULES=y and CONFIG_CRYPTO_DEV_ASPEED=m,
> build modpost would be failed.
> 
> Error messages:
>   ERROR: modpost: "aspeed_register_hace_hash_algs"
>   [drivers/crypto/aspeed/aspeed_crypto.ko] undefined!
>   ERROR: modpost: "aspeed_unregister_hace_hash_algs"
>   [drivers/crypto/aspeed/aspeed_crypto.ko] undefined!
> 
> Change build sequence to fix this.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
> Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> ---
> v2: Remove redundant obj- lines.
> 
>  drivers/crypto/aspeed/Makefile | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] crypto: aspeed: fix build module error
  2022-09-06  2:21   ` Neal Liu
@ 2022-09-16 10:42     ` Herbert Xu
  2022-09-16 17:21       ` Dhananjay Phadke
  0 siblings, 1 reply; 7+ messages in thread
From: Herbert Xu @ 2022-09-16 10:42 UTC (permalink / raw)
  To: Neal Liu
  Cc: David S . Miller, Joel Stanley, Andrew Jeffery, linux-aspeed,
	linux-crypto, linux-arm-kernel, linux-kernel, BMC-SW,
	kernel test robot, Sudip Mukherjee

On Tue, Sep 06, 2022 at 02:21:20AM +0000, Neal Liu wrote:
>
> > Does this still build if both HASH and CRYPTO are off?
> > 
> > I think this it's best if you do:
> > 
> > hace-hash-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_HASH) :=
> > aspeed-hace-hash.o
> > hace-crypto-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_CRYPTO) :=
> > aspeed-hace-crypto.o
> > 
> > obj-$(CONFIG_CRYPTO_DEV_ASPEED) += aspeed_crypto.o
> > aspeed_crypto-objs := aspeed-hace.o	\
> > 		      $(hace-hash-y)	\
> > 		      $(hace-crypto-y)
> > 
> 
> aspeed-hace.o effects only if either hace-hash-y or hace-crypto-y.
> If we put aspeed-hace.o in aspeed_crypto-objs, but hace-hash-y and hace-crypto-y are empty, apseed-hace.o is just an useless driver which might still occupy system resources.

Apparently it doesn't build after all, at least not on m68k.

So please either adopt my suggestion above, or come up with another
way of preventing the build failure on m68k with both HASH and CRYPTO
disabled.

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] crypto: aspeed: fix build module error
  2022-09-16 10:42     ` Herbert Xu
@ 2022-09-16 17:21       ` Dhananjay Phadke
  2022-09-19  6:36         ` Neal Liu
  0 siblings, 1 reply; 7+ messages in thread
From: Dhananjay Phadke @ 2022-09-16 17:21 UTC (permalink / raw)
  To: Herbert Xu, Neal Liu
  Cc: BMC-SW, kernel test robot, linux-aspeed, linux-kernel,
	Sudip Mukherjee, linux-crypto, David S . Miller,
	linux-arm-kernel

On 9/16/2022 3:42 AM, Herbert Xu wrote:
>>> Does this still build if both HASH and CRYPTO are off?
>>>
>>> I think this it's best if you do:
>>>
>>> hace-hash-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_HASH) :=
>>> aspeed-hace-hash.o
>>> hace-crypto-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_CRYPTO) :=
>>> aspeed-hace-crypto.o
>>>
>>> obj-$(CONFIG_CRYPTO_DEV_ASPEED) += aspeed_crypto.o
>>> aspeed_crypto-objs := aspeed-hace.o	\
>>> 		      $(hace-hash-y)	\
>>> 		      $(hace-crypto-y)
>>>
>> aspeed-hace.o effects only if either hace-hash-y or hace-crypto-y.
>> If we put aspeed-hace.o in aspeed_crypto-objs, but hace-hash-y and hace-crypto-y are empty, apseed-hace.o is just an useless driver which might still occupy system resources.
> Apparently it doesn't build after all, at least not on m68k.
> 
> So please either adopt my suggestion above, or come up with another
> way of preventing the build failure on m68k with both HASH and CRYPTO
> disabled.

Curious why compiled on m68k? It's embedded controller in ARM based
Aspeed SoCs. And there's "depends on ARCH_ASPEED" in Kconfig, need
some additional dependencies?

Regards,
Dhananjay

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH v2] crypto: aspeed: fix build module error
  2022-09-16 17:21       ` Dhananjay Phadke
@ 2022-09-19  6:36         ` Neal Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Neal Liu @ 2022-09-19  6:36 UTC (permalink / raw)
  To: Dhananjay Phadke, Herbert Xu
  Cc: kernel test robot, linux-aspeed, linux-kernel, Sudip Mukherjee,
	linux-crypto, David S . Miller, linux-arm-kernel

> >>> Does this still build if both HASH and CRYPTO are off?
> >>>
> >>> I think this it's best if you do:
> >>>
> >>> hace-hash-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_HASH) :=
> >>> aspeed-hace-hash.o
> >>> hace-crypto-$(CONFIG_CRYPTO_DEV_ASPEED_HACE_CRYPTO) :=
> >>> aspeed-hace-crypto.o
> >>>
> >>> obj-$(CONFIG_CRYPTO_DEV_ASPEED) += aspeed_crypto.o
> >>> aspeed_crypto-objs := aspeed-hace.o	\
> >>> 		      $(hace-hash-y)	\
> >>> 		      $(hace-crypto-y)
> >>>
> >> aspeed-hace.o effects only if either hace-hash-y or hace-crypto-y.
> >> If we put aspeed-hace.o in aspeed_crypto-objs, but hace-hash-y and
> hace-crypto-y are empty, apseed-hace.o is just an useless driver which might
> still occupy system resources.
> > Apparently it doesn't build after all, at least not on m68k.
> >
> > So please either adopt my suggestion above, or come up with another
> > way of preventing the build failure on m68k with both HASH and CRYPTO
> > disabled.
> 
> Curious why compiled on m68k? It's embedded controller in ARM based
> Aspeed SoCs. And there's "depends on ARCH_ASPEED" in Kconfig, need some
> additional dependencies?

The reason is because the compile test is enabled.
Check this:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=31b39755e32568b43c80814c5e13d7b1ab796d73

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-09-19  6:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05  2:54 [PATCH v2] crypto: aspeed: fix build module error Neal Liu
2022-09-05 11:04 ` Herbert Xu
2022-09-06  2:21   ` Neal Liu
2022-09-16 10:42     ` Herbert Xu
2022-09-16 17:21       ` Dhananjay Phadke
2022-09-19  6:36         ` Neal Liu
2022-09-06  4:53 ` 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).