diff mbox

[1/2] ARM: BCM: Do not select CONFIG_MTD_NAND_BRCMNAND

Message ID 1435422344-31059-2-git-send-email-f.fainelli@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Florian Fainelli June 27, 2015, 4:25 p.m. UTC
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.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 arch/arm/mach-bcm/Kconfig | 1 -
 1 file changed, 1 deletion(-)

Comments

Rafał Miłecki June 27, 2015, 9:39 p.m. UTC | #1
On 27 June 2015 at 18:25, Florian Fainelli <f.fainelli@gmail.com> wrote:
> 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?
Gregory Fong June 27, 2015, 11:01 p.m. UTC | #2
On Sat, Jun 27, 2015 at 2:39 PM, Rafa? Mi?ecki <zajec5@gmail.com> wrote:
> On 27 June 2015 at 18:25, Florian Fainelli <f.fainelli@gmail.com> wrote:
>> 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.
Florian Fainelli June 28, 2015, 1:40 a.m. UTC | #3
Le 06/27/15 16:01, Gregory Fong a écrit :
> On Sat, Jun 27, 2015 at 2:39 PM, Rafa? Mi?ecki <zajec5@gmail.com> wrote:
>> On 27 June 2015 at 18:25, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>> 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.

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!
Rafał Miłecki June 28, 2015, 7:19 a.m. UTC | #4
On 28 June 2015 at 01:01, Gregory Fong <gregory.0xf0@gmail.com> wrote:
> On Sat, Jun 27, 2015 at 2:39 PM, Rafa? Mi?ecki <zajec5@gmail.com> wrote:
>> On 27 June 2015 at 18:25, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>> 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.

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

Thanks for explaining, sorry for the noise, it looks fine!
Brian Norris July 6, 2015, 9:01 p.m. UTC | #5
On Sat, Jun 27, 2015 at 09:25:43AM -0700, Florian Fainelli wrote:
> 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.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

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

Acked-by: Brian Norris <computersforpeace@gmail.com>

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

> ---
>  arch/arm/mach-bcm/Kconfig | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
> index e9184feffc4e..0ac9e4b3b265 100644
> --- a/arch/arm/mach-bcm/Kconfig
> +++ b/arch/arm/mach-bcm/Kconfig
> @@ -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
diff mbox

Patch

diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index e9184feffc4e..0ac9e4b3b265 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -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