Skip to contentSkip to conversation

ARM: BCM: Do not select MTD_NAND_BRCMNAND

PATCH New Florian Fainelli 5 participants 9 messages Jun 27, 2015 – Jul 6, 2015

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

cover ARM: BCM: Do not select MTD_NAND_BRCMNAND

Hi Arnd, Kevin, Olof,

This two patches fix a linking failure when ARCH_BCM_IPROC is selected for the BRCMNAND driver since we end-up selecting this driver without its proper depdendencies. Instead do not do this select driver which is user-selectable, but add it to the multi_v7_defconfig.

Let me know if you would prefer a pull request for this rather than individual patches. Thanks!

Florian Fainelli (2):
ARM: BCM: Do not select CONFIG_MTD_NAND_BRCMNAND
ARM: multi_v7_defconfig: Enable BRCMNAND driver

 arch/arm/configs/multi_v7_defconfig | 1 +
 arch/arm/mach-bcm/Kconfig           | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/2 ARM: BCM: Do not select CONFIG_MTD_NAND_BRCMNAND

This reverts 7dc95b40f599293aedf30432749ad25b51549041 ("ARM: BCM: Enable NAND support for iProc SoCs") since it creates an unmet dependency for MTD_NAND_BRCMNAND which depends on MTD and MTD_NAND, this results in the following build failure for brcmnand:

LD init/built-in.o
drivers/built-in.o: In function `brcmnand_remove':
/home/fainelli/dev/linux/drivers/mtd/nand/brcmnand/brcmnand.c:2234:
undefined reference to nand_release' drivers/built-in.o: In function brcmnand_init_cs':
/home/fainelli/dev/linux/drivers/mtd/nand/brcmnand/brcmnand.c:1933:
undefined reference to `nand_scan_ident' /home/fainelli/dev/linux/drivers/mtd/nand/brcmnand/brcmnand.c:1958:
undefined reference to `nand_scan_tail'
Makefile:931: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

Instead, select this driver an all dependencies on the multi_v7_defconfig.

---
 arch/arm/mach-bcm/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-bcm/Kconfig +0 -1
index e9184feffc4e..0ac9e4b3b265 100644
@@ -19,7 +19,6 @@ config ARCH_BCM_IPROC
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_AMBA
 	select PINCTRL
-	select MTD_NAND_BRCMNAND
 	help
 	  This enables support for systems based on Broadcom IPROC architected SoCs.
 	  The IPROC complex contains one or more ARM CPUs along with common
Signature · 1 line
2.1.0
#2 lore raw

PATCH 1/2 ARM: BCM: Do not select CONFIG_MTD_NAND_BRCMNAND

Quoted 4 lines · Florian Fainelli

This reverts 7dc95b40f599293aedf30432749ad25b51549041 ("ARM: BCM: Enable NAND support for iProc SoCs") since it creates an unmet dependency for MTD_NAND_BRCMNAND which depends on MTD and MTD_NAND, this results in the following build failure for brcmnand:

This commit message doesn't make too much sense to me. If MTD_NAND_BRCMNAND really depends on MTD and MTD_NAND then there couldn't be this problem you described.

Maybe MTD_NAND_BRCMNAND is *missing* that dependency?

#3 lore raw

PATCH 1/2 ARM: BCM: Do not select CONFIG_MTD_NAND_BRCMNAND

Quoted 11 lines · Rafa? Mi?ecki
Quoted 4 lines · Florian Fainelli

This reverts 7dc95b40f599293aedf30432749ad25b51549041 ("ARM: BCM: Enable NAND support for iProc SoCs") since it creates an unmet dependency for MTD_NAND_BRCMNAND which depends on MTD and MTD_NAND, this results in the following build failure for brcmnand:

This commit message doesn't make too much sense to me. If MTD_NAND_BRCMNAND really depends on MTD and MTD_NAND then there couldn't be this problem you described.

Maybe MTD_NAND_BRCMNAND is *missing* that dependency?

Per Documentation/kbuild/kconfig-language.txt: "select will force a symbol to a value without visiting the dependencies. By abusing select you are able to select a symbol FOO even if FOO depends on BAR that is not set."

I believe this is what is happening here.

#4 lore raw

PATCH 1/2 ARM: BCM: Do not select CONFIG_MTD_NAND_BRCMNAND

Le 06/27/15 16:01, Gregory Fong a ?crit :

Quoted 11 lines · Rafa? Mi?ecki
Quoted 10 lines · Florian Fainelli
Quoted 4 lines

This reverts 7dc95b40f599293aedf30432749ad25b51549041 ("ARM: BCM: Enable NAND support for iProc SoCs") since it creates an unmet dependency for MTD_NAND_BRCMNAND which depends on MTD and MTD_NAND, this results in the following build failure for brcmnand:

This commit message doesn't make too much sense to me. If MTD_NAND_BRCMNAND really depends on MTD and MTD_NAND then there couldn't be this problem you described.

Quoted 8 lines
Quoted 1 line

Maybe MTD_NAND_BRCMNAND is *missing* that dependency?

Per Documentation/kbuild/kconfig-language.txt: "select will force a symbol to a value without visiting the dependencies. By abusing select you are able to select a symbol FOO even if FOO depends on BAR that is not set."

I believe this is what is happening here.

Right, what is happening is actually that CONFIG_MTD gates CONFIG_MTD_NAND, using a if MTD statement, which only affects the user-selectability aspect of it, it does therefore only *implicitly* enforce a depdency CONFIG_MTD for CONFIG_MTD_NAND because all of this is user-selectable, so you need CONFIG_MTD to have CONFIG_MTD_NAND *apppear* as a selectable option first. The same is true for all NAND drivers, which are gated with an if MTD_NAND statement.

I could put that in the commit message and resubmit if this is deemed appropriate to understand what is being fixed here; I thought mentioning the unmet dependency would be enough though.

Thanks!

Signature · 1 line
Florian
#5 lore raw

PATCH 1/2 ARM: BCM: Do not select CONFIG_MTD_NAND_BRCMNAND

In reply to Gregory Fong
Quoted 11 lines · Gregory Fong
Quoted 10 lines · Rafa? Mi?ecki
Quoted 4 lines · Florian Fainelli

This reverts 7dc95b40f599293aedf30432749ad25b51549041 ("ARM: BCM: Enable NAND support for iProc SoCs") since it creates an unmet dependency for MTD_NAND_BRCMNAND which depends on MTD and MTD_NAND, this results in the following build failure for brcmnand:

This commit message doesn't make too much sense to me. If MTD_NAND_BRCMNAND really depends on MTD and MTD_NAND then there couldn't be this problem you described.

Quoted 8 lines
Quoted 1 line

Maybe MTD_NAND_BRCMNAND is *missing* that dependency?

Per Documentation/kbuild/kconfig-language.txt: "select will force a symbol to a value without visiting the dependencies. By abusing select you are able to select a symbol FOO even if FOO depends on BAR that is not set."

I believe this is what is happening here.

Oops, it seems I still don't know Kconfig well enough.

Thanks for explaining, sorry for the noise, it looks fine!

Signature · 1 line
Rafa?
#6 lore raw

PATCH 1/2 ARM: BCM: Do not select CONFIG_MTD_NAND_BRCMNAND

In reply to Florian Fainelli
Quoted 17 lines · Florian Fainelli

This reverts 7dc95b40f599293aedf30432749ad25b51549041 ("ARM: BCM: Enable NAND support for iProc SoCs") since it creates an unmet dependency for MTD_NAND_BRCMNAND which depends on MTD and MTD_NAND, this results in the following build failure for brcmnand:

LD init/built-in.o
drivers/built-in.o: In function `brcmnand_remove':
/home/fainelli/dev/linux/drivers/mtd/nand/brcmnand/brcmnand.c:2234:
undefined reference to nand_release' drivers/built-in.o: In function brcmnand_init_cs':
/home/fainelli/dev/linux/drivers/mtd/nand/brcmnand/brcmnand.c:1933:
undefined reference to `nand_scan_ident' /home/fainelli/dev/linux/drivers/mtd/nand/brcmnand/brcmnand.c:1958:
undefined reference to `nand_scan_tail'
Makefile:931: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

Quoted 4 lines

Instead, select this driver an all dependencies on the multi_v7_defconfig.

FWIW (I've been a bit disconnected this last week):

Drivers should not be select-ed like this. Thanks for the patch.

Quoted 16 lines
---
 arch/arm/mach-bcm/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-bcm/Kconfig +0 -1
index e9184feffc4e..0ac9e4b3b265 100644
@@ -19,7 +19,6 @@ config ARCH_BCM_IPROC
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_AMBA
 	select PINCTRL
-	select MTD_NAND_BRCMNAND
 	help
 	  This enables support for systems based on Broadcom IPROC architected SoCs.
 	  The IPROC complex contains one or more ARM CPUs along with common
#7 lore raw

PATCH 2/2 ARM: multi_v7_defconfig: Enable BRCMNAND driver

In reply to Florian Fainelli

The Broadcom NAND driver is used by brcmstb, bcm63xx, bcm5301x and Cygnus/iProc under mach-bcm, this is enough critical mass to enable it.

---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/multi_v7_defconfig +1 -0
index fd6a6d23bc20..6d83a1bf0c74 100644
@@ -169,6 +169,7 @@ CONFIG_MTD_BLOCK=y
 CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ATMEL=y
+CONFIG_MTD_NAND_BRCMNAND=y
 CONFIG_MTD_NAND_DAVINCI=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_UBI=y
Signature · 1 line
2.1.0
Applied
#8 lore raw

cover ARM: BCM: Do not select MTD_NAND_BRCMNAND

In reply to Florian Fainelli
Quoted 9 lines · Florian Fainelli

Hi Arnd, Kevin, Olof,

This two patches fix a linking failure when ARCH_BCM_IPROC is selected for the BRCMNAND driver since we end-up selecting this driver without its proper depdendencies. Instead do not do this select driver which is user-selectable, but add it to the multi_v7_defconfig.

Let me know if you would prefer a pull request for this rather than individual patches. Thanks!

Individual patches are fine.

I've picked these up for the arm-soc/late branch which I'll try to get in before -rc1, but if not it will make it for -rc2.

Thanks,

Kevin