Skip to contentSkip to conversation

linux-next: build failure after merge of the crypto tree

PATCH In review Stephen Rothwell 5 participants 10 messages May 22, 2023 – Jun 6, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the crypto tree, today's linux-next build (x86_64 allmodconfig) failed like this:

drivers/tty/serial/amba-pl011.c: In function 'pl011_sgbuf_init':
drivers/tty/serial/amba-pl011.c:379:30: error: implicit declaration of function 'phys_to_page'; did you mean 'pfn_to_page'? [-Werror=implicit-function-declaration]

  379 |         sg_set_page(&sg->sg, phys_to_page(dma_addr),
      |                              ^~~~~~~~~~~~
      |                              pfn_to_page
drivers/tty/serial/amba-pl011.c:379:30: error: passing argument 2 of 'sg_set_page' makes pointer from integer without a cast [-Werror=int-conversion]
  379 |         sg_set_page(&sg->sg, phys_to_page(dma_addr),
      |                              ^~~~~~~~~~~~~~~~~~~~~~
      |                              |
      |                              int
In file included from include/linux/kfifo.h:42,
                 from include/linux/tty_port.h:5,
                 from include/linux/tty.h:12,
                 from drivers/tty/serial/amba-pl011.c:25:

include/linux/scatterlist.h:136:69: note: expected 'struct page *' but argument is of type 'int'
136 | static inline void sg_set_page(struct scatterlist *sg, struct page *page,
| ~~~~~~~~~~~~~^~~~

Caused by commit

42ef0e944b01 ("crypto: starfive - Add crypto engine support")

I applied the following patch for today.

From: Stephen Rothwell <[email protected]>
Date: Mon, 22 May 2023 10:47:38 +1000
Subject: [PATCH] fixup for "crypto: starfive - Add crypto engine support"

---
 drivers/crypto/starfive/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/starfive/Kconfig +1 -1
index be58d1473523..8795b2fddb4e 100644
@@ -4,7 +4,7 @@
 
 config CRYPTO_DEV_JH7110
 	tristate "StarFive JH7110 cryptographic engine driver"
-	depends on SOC_STARFIVE || COMPILE_TEST
+	depends on SOC_STARFIVE
 	select CRYPTO_ENGINE
 	select CRYPTO_HMAC
 	select CRYPTO_SHA256
Signature · 5 lines
2.39.2

-- 
Cheers,
Stephen Rothwell
maintainer
#1 lore raw
Quoted 4 lines · Stephen Rothwell

Hi all,

After merging the crypto tree, today's linux-next build (x86_64 allmodconfig) failed like this:

Sorry, a fix is pending and will be pushed out soon.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#2 lore raw

Hi Herbert,

Quoted 7 lines · On Mon, 22 May 2023 13:15:20 +0800 Herbert Xu <[email protected]>…
Quoted 3 lines · Stephen Rothwell

After merging the crypto tree, today's linux-next build (x86_64 allmodconfig) failed like this:

Sorry, a fix is pending and will be pushed out soon.

That did not fix it :-(

My fix up patch is now:

From: Stephen Rothwell <[email protected]>
Date: Tue, 23 May 2023 10:31:28 +1000
Subject: [PATCH] fixup for "crypto: starfive - Add crypto engine support"

---
 drivers/crypto/starfive/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/starfive/Kconfig +1 -1
index 908c162ba79a..2a15d51534b9 100644
@@ -4,7 +4,7 @@
 
 config CRYPTO_DEV_JH7110
 	tristate "StarFive JH7110 cryptographic engine driver"
-	depends on (SOC_STARFIVE || COMPILE_TEST) && DMADEVICES
+	depends on SOC_STARFIVE && DMADEVICES
 	select CRYPTO_ENGINE
 	select CRYPTO_HMAC
 	select CRYPTO_SHA256
Signature · 5 lines
2.39.2

-- 
Cheers,
Stephen Rothwell
maintainer
#3 lore raw

PATCH 1/1 crypto: starfive - Depend on AMBA_PL08X instead of selecting it

Quoted 2 lines · Stephen Rothwell

That did not fix it :-(

OK, this patch should fix it:

---8<---
A platform option like AMBA should never be selected by a driver. Use a dependency instead.

Also remove the depenency on DMADEVICES because the driver builds just fine without it. Instead add a dependency on HAS_DMA for dma mapping support.

drivers/crypto/starfive/Kconfig +2 -3
index 908c162ba79a..59002abcc0ad 100644
@@ -4,14 +4,13 @@
 
 config CRYPTO_DEV_JH7110
 	tristate "StarFive JH7110 cryptographic engine driver"
-	depends on (SOC_STARFIVE || COMPILE_TEST) && DMADEVICES
+	depends on SOC_STARFIVE || AMBA_PL08X || COMPILE_TEST
+	depends on HAS_DMA
 	select CRYPTO_ENGINE
 	select CRYPTO_HMAC
 	select CRYPTO_SHA256
 	select CRYPTO_SHA512
 	select CRYPTO_SM3_GENERIC
-	select ARM_AMBA
-	select AMBA_PL08X
 	help
 	  Support for StarFive JH7110 crypto hardware acceleration engine.
 	  This module provides acceleration for public key algo,
Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Reviewed-by on v1 1/1
#4 lore raw

Re: [PATCH] crypto: starfive - Depend on AMBA_PL08X instead of selecting it

Quoted 9 lines · Herbert Xu
Quoted 2 lines · Stephen Rothwell

That did not fix it :-(

OK, this patch should fix it:

---8<---
A platform option like AMBA should never be selected by a driver. Use a dependency instead.

Randy submitted a patch to change the driver to not conflict with the arch symbols:
https://lore.kernel.org/all/[email protected]/

The corresponding change here makes sense to me,

@StarFive folks, you will need to go and submit a patch for arch/riscv/Kconfig.socs that selects ARM_AMBA for your platform.

Quoted 13 lines

Also remove the depenency on DMADEVICES because the driver builds just fine without it. Instead add a dependency on HAS_DMA for dma mapping support.

drivers/crypto/starfive/Kconfig +0 -0
index 908c162ba79a..59002abcc0ad 100644

drivers/crypto/starfive/Kconfig line 7

Quoted 5 lines
drivers/crypto/starfive/Kconfig +1 -1
@@ -4,14 +4,13 @@
 
 config CRYPTO_DEV_JH7110
 	tristate "StarFive JH7110 cryptographic engine driver"
-	depends on (SOC_STARFIVE || COMPILE_TEST) && DMADEVICES
+	depends on SOC_STARFIVE || AMBA_PL08X || COMPILE_TEST

While we are changing everything, would you mind doing s/SOC/ARCH/ here? I didn't notice that while the series was being reviewed. Otherwise, I'll send you a patch for it.

Cheers,
Conor.

maintainer
#5 lore raw

Re: [PATCH] crypto: starfive - Depend on AMBA_PL08X instead of selecting it

Quoted 15 lines · Conor Dooley
Quoted 9 lines · Herbert Xu
Quoted 2 lines · Stephen Rothwell

That did not fix it :-(

OK, this patch should fix it:

---8<---
A platform option like AMBA should never be selected by a driver. Use a dependency instead.

Randy submitted a patch to change the driver to not conflict with the arch symbols:
https://lore.kernel.org/all/[email protected]/

Quoted 6 lines

The corresponding change here makes sense to me,

@StarFive folks, you will need to go and submit a patch for arch/riscv/Kconfig.socs that selects ARM_AMBA for your platform.

Sure, I'll submit a patch for this.

Thanks
Jia Jie

#6 lore raw

Re: [PATCH] crypto: starfive - Depend on AMBA_PL08X instead of selecting it

In reply to Herbert Xu

Hi Herbert,

Quoted 6 lines · On Tue, 23 May 2023 10:33:38 +0800 Herbert Xu <[email protected]>…
Quoted 2 lines · Stephen Rothwell

That did not fix it :-(

OK, this patch should fix it:

That seems to have fixed it, thanks.

Signature · 2 lines
Cheers,
Stephen Rothwell
#7 lore raw

Re: [PATCH] crypto: starfive - Depend on AMBA_PL08X instead of selecting it

In reply to Herbert Xu

Hi Herbert,

Quoted 8 lines · Herbert Xu
Quoted 1 line · Stephen Rothwell

That did not fix it :-(

OK, this patch should fix it:

---8<---
A platform option like AMBA should never be selected by a driver. Use a dependency instead.

FTR:

arch/arm/mach-s3c/Kconfig.s3c64xx=config S3C64XX_PL080
arch/arm/mach-s3c/Kconfig.s3c64xx- def_bool DMADEVICES
arch/arm/mach-s3c/Kconfig.s3c64xx: select AMBA_PL08X

Quoted 20 lines

Also remove the depenency on DMADEVICES because the driver builds just fine without it. Instead add a dependency on HAS_DMA for dma mapping support.

drivers/crypto/starfive/Kconfig +2 -1
index 908c162ba79a..59002abcc0ad 100644
@@ -4,14 +4,13 @@
 
 config CRYPTO_DEV_JH7110
        tristate "StarFive JH7110 cryptographic engine driver"
-       depends on (SOC_STARFIVE || COMPILE_TEST) && DMADEVICES
+       depends on SOC_STARFIVE || AMBA_PL08X || COMPILE_TEST
+       depends on HAS_DMA

drivers/crypto/starfive/Kconfig line 16

Quoted 10 lines
drivers/crypto/starfive/Kconfig +0 -2
        select CRYPTO_ENGINE
        select CRYPTO_HMAC
        select CRYPTO_SHA256
        select CRYPTO_SHA512
        select CRYPTO_SM3_GENERIC
-       select ARM_AMBA
-       select AMBA_PL08X
        help
          Support for StarFive JH7110 crypto hardware acceleration engine.
          This module provides acceleration for public key algo,

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
maintainer
#8 lore raw

Re: [PATCH] crypto: starfive - Depend on AMBA_PL08X instead of selecting it

Quoted 10 lines · Geert Uytterhoeven
Quoted 4 lines

---8<---
A platform option like AMBA should never be selected by a driver. Use a dependency instead.

FTR:

arch/arm/mach-s3c/Kconfig.s3c64xx=config S3C64XX_PL080
arch/arm/mach-s3c/Kconfig.s3c64xx- def_bool DMADEVICES
arch/arm/mach-s3c/Kconfig.s3c64xx: select AMBA_PL08X

Well that isn't a driver I think so it might be OK?

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#9 lore raw

Re: [PATCH] crypto: starfive - Depend on AMBA_PL08X instead of selecting it

Hi Herbert,

Quoted 6 lines · Herbert Xu
Quoted 5 lines · Geert Uytterhoeven
Quoted 4 lines

---8<---
A platform option like AMBA should never be selected by a driver. Use a dependency instead.

Quoted 7 lines
Quoted 5 lines

FTR:

arch/arm/mach-s3c/Kconfig.s3c64xx=config S3C64XX_PL080
arch/arm/mach-s3c/Kconfig.s3c64xx- def_bool DMADEVICES
arch/arm/mach-s3c/Kconfig.s3c64xx: select AMBA_PL08X

Well that isn't a driver I think so it might be OK?

Thanks, please ignore ;-)

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds