Skip to contentSkip to conversation

mtd: rawnand: omap2: Prevent invalid configuration and build error

PATCH Applied Roger Quadros 4 participants 6 messages Jan 18, 2022 – Feb 19, 2022

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

PATCH 1/1 mtd: rawnand: omap2: Prevent invalid configuration and build error

We need to select MEMORY as well otherwise OMAP_GPMC will not be built. For simplicity let's select MEMORY and OMAP_GPMC unconditionally as this driver depends on OMAP_GPMC driver and uses symbols from there.

Fixes dbcb124acebd ("mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3")
---
 drivers/mtd/nand/raw/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/nand/raw/Kconfig +2 -1
index 20408b7db540..d986ab4e4c35 100644
@@ -42,7 +42,8 @@ config MTD_NAND_OMAP2
 	tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
 	depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
 	depends on HAS_IOMEM
-	select OMAP_GPMC if ARCH_K3
+	select MEMORY
+	select OMAP_GPMC
 	help
 	  Support for NAND flash on Texas Instruments OMAP2, OMAP3, OMAP4
 	  and Keystone platforms.
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Roger Quadros

We need to select MEMORY as well otherwise OMAP_GPMC will not be built. For simplicity let's select MEMORY and OMAP_GPMC unconditionally as this driver depends on OMAP_GPMC driver and uses symbols from there.

Fixes dbcb124acebd ("mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3")
---
 drivers/mtd/nand/raw/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Best regards,
Krzysztof

maintainer Applied
#2 lore raw
In reply to Roger Quadros
Quoted 8 lines · Roger Quadros

We need to select MEMORY as well otherwise OMAP_GPMC will not be built. For simplicity let's select MEMORY and OMAP_GPMC unconditionally as this driver depends on OMAP_GPMC driver and uses symbols from there.

Fixes dbcb124acebd ("mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3")

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

maintainer
#3 lore raw

[email protected] wrote on Sun, 23 Jan 2022 16:23:01 +0100:

Quoted 11 lines · Roger Quadros
Quoted 8 lines

We need to select MEMORY as well otherwise OMAP_GPMC will not be built. For simplicity let's select MEMORY and OMAP_GPMC unconditionally as this driver depends on OMAP_GPMC driver and uses symbols from there.

Fixes dbcb124acebd ("mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3")

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Pushed on mtd/fixes, actually.

#4 lore raw
In reply to Roger Quadros
Quoted 7 lines · Roger Quadros

We need to select MEMORY as well otherwise OMAP_GPMC will not be built. For simplicity let's select MEMORY and OMAP_GPMC unconditionally as this driver depends on OMAP_GPMC driver and uses symbols from there.

Fixes dbcb124acebd ("mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3")

This patch ignores OMAP_GPMC dependencies and results in:

WARNING: unmet direct dependencies detected for OMAP_GPMC
Depends on [n]: MEMORY [=y] && OF_ADDRESS [=n]
Selected by [m]:
- MTD_NAND_OMAP2 [=m] && MTD [=m] && MTD_RAW_NAND [=m] && (ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST [=y]) && HAS_IOMEM [=y]

when configuring sparc64:allmodconfig, and in the following build failure when trying to build that image.

Building sparc64:allmodconfig ... failed
--------------
Error log:
<stdin>:1517:2: warning: #warning syscall clone3 not implemented [-Wcpp]
sparc64-linux-ld: drivers/memory/omap-gpmc.o: in function `gpmc_probe_generic_child':
omap-gpmc.c:(.text.unlikely+0x14c4): undefined reference to `of_platform_device_create'

Guenter

Quoted 21 lines
---
 drivers/mtd/nand/raw/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/nand/raw/Kconfig +2 -1
index 20408b7db540..d986ab4e4c35 100644
@@ -42,7 +42,8 @@ config MTD_NAND_OMAP2
 	tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
 	depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
 	depends on HAS_IOMEM
-	select OMAP_GPMC if ARCH_K3
+	select MEMORY
+	select OMAP_GPMC
 	help
 	  Support for NAND flash on Texas Instruments OMAP2, OMAP3, OMAP4
 	  and Keystone platforms.
Signature · 1 line
2.17.1
#5 lore raw

Hi,

Quoted 32 lines · Guenter Roeck
Quoted 7 lines · Roger Quadros

We need to select MEMORY as well otherwise OMAP_GPMC will not be built. For simplicity let's select MEMORY and OMAP_GPMC unconditionally as this driver depends on OMAP_GPMC driver and uses symbols from there.

Fixes dbcb124acebd ("mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3")

This patch ignores OMAP_GPMC dependencies and results in:

WARNING: unmet direct dependencies detected for OMAP_GPMC
Depends on [n]: MEMORY [=y] && OF_ADDRESS [=n]
Selected by [m]:
- MTD_NAND_OMAP2 [=m] && MTD [=m] && MTD_RAW_NAND [=m] && (ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST [=y]) && HAS_IOMEM [=y]

when configuring sparc64:allmodconfig, and in the following build failure when trying to build that image.

Building sparc64:allmodconfig ... failed
--------------
Error log:
<stdin>:1517:2: warning: #warning syscall clone3 not implemented [-Wcpp]
sparc64-linux-ld: drivers/memory/omap-gpmc.o: in function `gpmc_probe_generic_child':
omap-gpmc.c:(.text.unlikely+0x14c4): undefined reference to `of_platform_device_create'

Guenter

Quoted 4 lines
---
 drivers/mtd/nand/raw/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 11 lines

drivers/mtd/nand/raw/Kconfig config MTD_NAND_OMAP2 · line 46

Quoted 11 lines
drivers/mtd/nand/raw/Kconfig +2 -1
index 20408b7db540..d986ab4e4c35 100644
@@ -42,7 +42,8 @@ config MTD_NAND_OMAP2
 	tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
 	depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
 	depends on HAS_IOMEM
-	select OMAP_GPMC if ARCH_K3
+	select MEMORY
+	select OMAP_GPMC

I think selecting these was a bad idea in the first place. I'll send out a patch to remove the selects. This driver should depend on them instead.

We will figure out how to enable OMAP_GPMC for K3 architecture some other way.

Quoted 6 lines
Quoted 6 lines
drivers/mtd/nand/raw/Kconfig +0 -0
 	help
 	  Support for NAND flash on Texas Instruments OMAP2, OMAP3, OMAP4
 	  and Keystone platforms.
Signature · 1 line
2.17.1

cheers,
-roger