diff mbox

mach-ks8695/Kconfig: Make MACH_KS8695 depends on PCI

Message ID 1375693624-21548-1-git-send-email-manjunath.goudar@linaro.org
State New
Headers show

Commit Message

manjunath.goudar@linaro.org Aug. 5, 2013, 9:07 a.m. UTC
From: root <root@si-cspbld63.lge.net>

This patch adds a Kconfig dependency on MACH_KS8695,MACH_CM* or MACH_IM*
being available before PCI can be enabled. Without this patch,build system
can lead to issues. This was discovered during randconfig testing,
without PCI if any one of MACH_KS8695,MACH_CM* or MACH_IM* being enabled,
leading to the following error:

LD      init/built-in.o
arch/arm/mach-ks8695/built-in.o: In function `og_register_pci':
arch/arm/mach-ks8695/board-og.c:47:undefined reference to `ks8695_init_pci'
make: *** [vmlinux] Error 1

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Deepak Saxena <dsaxena@linaro.org>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: linux-arm-kernel@lists.infradead.org
---
 arch/arm/mach-ks8695/Kconfig | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Viresh Kumar Aug. 5, 2013, 9:17 a.m. UTC | #1
On 5 August 2013 14:37, Manjunath Goudar <manjunath.goudar@linaro.org> wrote:
> From: root <root@si-cspbld63.lge.net>

:)

> This patch adds a Kconfig dependency on MACH_KS8695,MACH_CM* or MACH_IM*
> being available before PCI can be enabled. Without this patch,build system

Add Space after ','

> can lead to issues. This was discovered during randconfig testing,
> without PCI if any one of MACH_KS8695,MACH_CM* or MACH_IM* being enabled,

Same here.

> leading to the following error:
>
> LD      init/built-in.o
> arch/arm/mach-ks8695/built-in.o: In function `og_register_pci':
> arch/arm/mach-ks8695/board-og.c:47:undefined reference to `ks8695_init_pci'
> make: *** [vmlinux] Error 1
>
> Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Deepak Saxena <dsaxena@linaro.org>
> Cc: Greg Ungerer <gerg@uclinux.org>
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>  arch/arm/mach-ks8695/Kconfig | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/mach-ks8695/Kconfig b/arch/arm/mach-ks8695/Kconfig
> index a545976..29d7d9f 100644
> --- a/arch/arm/mach-ks8695/Kconfig
> +++ b/arch/arm/mach-ks8695/Kconfig
> @@ -5,6 +5,7 @@ menu "Kendin/Micrel KS8695 Implementations"
>  config MACH_KS8695
>         bool "KS8695 development board"
>         select MIGHT_HAVE_PCI
> +       depends on PCI

You need both PCI and MIGHT_HAVE_PCI? Don't know but it looks
like defconfig is missing PCI stuff.. and MIGHT_HAVE_PCI is enough
here?
manjunath.goudar@linaro.org Aug. 5, 2013, 10:31 a.m. UTC | #2
On 5 August 2013 14:47, Viresh Kumar <viresh.kumar@linaro.org> wrote:

> On 5 August 2013 14:37, Manjunath Goudar <manjunath.goudar@linaro.org>
> wrote:
> > From: root <root@si-cspbld63.lge.net>
>
> :)
>
> > This patch adds a Kconfig dependency on MACH_KS8695,MACH_CM* or MACH_IM*
> > being available before PCI can be enabled. Without this patch,build
> system
>
> Add Space after ','
>
> > can lead to issues. This was discovered during randconfig testing,
> > without PCI if any one of MACH_KS8695,MACH_CM* or MACH_IM* being enabled,
>
> Same here.
>
> > leading to the following error:
> >
> > LD      init/built-in.o
> > arch/arm/mach-ks8695/built-in.o: In function `og_register_pci':
> > arch/arm/mach-ks8695/board-og.c:47:undefined reference to
> `ks8695_init_pci'
> > make: *** [vmlinux] Error 1
> >
> > Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Deepak Saxena <dsaxena@linaro.org>
> > Cc: Greg Ungerer <gerg@uclinux.org>
> > Cc: linux-arm-kernel@lists.infradead.org
> > ---
> >  arch/arm/mach-ks8695/Kconfig | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/arch/arm/mach-ks8695/Kconfig b/arch/arm/mach-ks8695/Kconfig
> > index a545976..29d7d9f 100644
> > --- a/arch/arm/mach-ks8695/Kconfig
> > +++ b/arch/arm/mach-ks8695/Kconfig
> > @@ -5,6 +5,7 @@ menu "Kendin/Micrel KS8695 Implementations"
> >  config MACH_KS8695
> >         bool "KS8695 development board"
> >         select MIGHT_HAVE_PCI
> > +       depends on PCI
>
> You need both PCI and MIGHT_HAVE_PCI? Don't know but it looks
> like defconfig is missing PCI stuff.. and MIGHT_HAVE_PCI is enough
> here?


 PCI is needed here because board-og.c file depends on pci.o.

 We are only selecting MIGHT_HAVE_PCI not setting dependence.

Thanks
Manjunath Goudar
Russell King - ARM Linux Aug. 5, 2013, 10:59 a.m. UTC | #3
On Mon, Aug 05, 2013 at 02:37:04PM +0530, Manjunath Goudar wrote:
> From: root <root@si-cspbld63.lge.net>
> 
> This patch adds a Kconfig dependency on MACH_KS8695,MACH_CM* or MACH_IM*
> being available before PCI can be enabled. Without this patch,build system
> can lead to issues. This was discovered during randconfig testing,
> without PCI if any one of MACH_KS8695,MACH_CM* or MACH_IM* being enabled,
> leading to the following error:
> 
> LD      init/built-in.o
> arch/arm/mach-ks8695/built-in.o: In function `og_register_pci':
> arch/arm/mach-ks8695/board-og.c:47:undefined reference to `ks8695_init_pci'
> make: *** [vmlinux] Error 1

This looks wrong.

> diff --git a/arch/arm/mach-ks8695/Kconfig b/arch/arm/mach-ks8695/Kconfig
> index a545976..29d7d9f 100644
> --- a/arch/arm/mach-ks8695/Kconfig
> +++ b/arch/arm/mach-ks8695/Kconfig
> @@ -5,6 +5,7 @@ menu "Kendin/Micrel KS8695 Implementations"
>  config MACH_KS8695
>  	bool "KS8695 development board"
>  	select MIGHT_HAVE_PCI
> +	depends on PCI

So, to be able to select PCI, MIGHT_HAVE_PCI needs to be enabled.  That's
selected by enabling MACH_KS8695, but now you make MACH_KS8695 depend on
PCI.  That sounds to me like a circular dependency.
Greg Ungerer Aug. 6, 2013, 2:07 a.m. UTC | #4
Hi Manjunath,

On 05/08/13 20:31, Manjunath Goudar wrote:
> On 5 August 2013 14:47, Viresh Kumar <viresh.kumar@linaro.org <mailto:viresh.kumar@linaro.org>> wrote:
> 
>     On 5 August 2013 14:37, Manjunath Goudar <manjunath.goudar@linaro.org <mailto:manjunath.goudar@linaro.org>> wrote:
>     > From: root <root@si-cspbld63.lge.net <mailto:root@si-cspbld63.lge.net>>
> 
>     :)
> 
>     > This patch adds a Kconfig dependency on MACH_KS8695,MACH_CM* or MACH_IM*
>     > being available before PCI can be enabled. Without this patch,build system
> 
>     Add Space after ','
> 
>     > can lead to issues. This was discovered during randconfig testing,
>     > without PCI if any one of MACH_KS8695,MACH_CM* or MACH_IM* being enabled,
> 
>     Same here.
> 
>     > leading to the following error:
>     >
>     > LD      init/built-in.o
>     > arch/arm/mach-ks8695/built-in.o: In function `og_register_pci':
>     > arch/arm/mach-ks8695/board-og.c:47:undefined reference to `ks8695_init_pci'
>     > make: *** [vmlinux] Error 1
>     >
>     > Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org <mailto:manjunath.goudar@linaro.org>>
>     > Cc: Arnd Bergmann <arnd@arndb.de <mailto:arnd@arndb.de>>
>     > Cc: Deepak Saxena <dsaxena@linaro.org <mailto:dsaxena@linaro.org>>
>     > Cc: Greg Ungerer <gerg@uclinux.org <mailto:gerg@uclinux.org>>
>     > Cc: linux-arm-kernel@lists.infradead.org <mailto:linux-arm-kernel@lists.infradead.org>
>     > ---
>     >  arch/arm/mach-ks8695/Kconfig | 5 +++++
>     >  1 file changed, 5 insertions(+)
>     >
>     > diff --git a/arch/arm/mach-ks8695/Kconfig b/arch/arm/mach-ks8695/Kconfig
>     > index a545976..29d7d9f 100644
>     > --- a/arch/arm/mach-ks8695/Kconfig
>     > +++ b/arch/arm/mach-ks8695/Kconfig
>     > @@ -5,6 +5,7 @@ menu "Kendin/Micrel KS8695 Implementations"
>     >  config MACH_KS8695
>     >         bool "KS8695 development board"
>     >         select MIGHT_HAVE_PCI
>     > +       depends on PCI
> 
>     You need both PCI and MIGHT_HAVE_PCI? Don't know but it looks
>     like defconfig is missing PCI stuff.. and MIGHT_HAVE_PCI is enough
>     here?
> 
> 
>  PCI is needed here because board-og.c file depends on pci.o.

It shouldn't though, thus the original use of MIGHT_HAVE_PCI.
The board-og.c machine code supports a number of boards, some of
which don't have a PCI bus (that is they use the KS8695 CPU that
doesn't contain the PCI bus silicon).

I think you want a fix that makes the pci support code in this file
conditional on CONFIG_PCI.

Regards
Greg
manjunath.goudar@linaro.org Aug. 6, 2013, 10:43 a.m. UTC | #5
On 6 August 2013 07:37, Greg Ungerer <gerg@uclinux.org> wrote:

> Hi Manjunath,
>
> On 05/08/13 20:31, Manjunath Goudar wrote:
> > On 5 August 2013 14:47, Viresh Kumar <viresh.kumar@linaro.org <mailto:
> viresh.kumar@linaro.org>> wrote:
> >
> >     On 5 August 2013 14:37, Manjunath Goudar <
> manjunath.goudar@linaro.org <mailto:manjunath.goudar@linaro.org>> wrote:
> >     > From: root <root@si-cspbld63.lge.net <mailto:
> root@si-cspbld63.lge.net>>
> >
> >     :)
> >
> >     > This patch adds a Kconfig dependency on MACH_KS8695,MACH_CM* or
> MACH_IM*
> >     > being available before PCI can be enabled. Without this
> patch,build system
> >
> >     Add Space after ','
> >
> >     > can lead to issues. This was discovered during randconfig testing,
> >     > without PCI if any one of MACH_KS8695,MACH_CM* or MACH_IM* being
> enabled,
> >
> >     Same here.
> >
> >     > leading to the following error:
> >     >
> >     > LD      init/built-in.o
> >     > arch/arm/mach-ks8695/built-in.o: In function `og_register_pci':
> >     > arch/arm/mach-ks8695/board-og.c:47:undefined reference to
> `ks8695_init_pci'
> >     > make: *** [vmlinux] Error 1
> >     >
> >     > Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org<mailto:
> manjunath.goudar@linaro.org>>
> >     > Cc: Arnd Bergmann <arnd@arndb.de <mailto:arnd@arndb.de>>
> >     > Cc: Deepak Saxena <dsaxena@linaro.org <mailto:dsaxena@linaro.org>>
> >     > Cc: Greg Ungerer <gerg@uclinux.org <mailto:gerg@uclinux.org>>
> >     > Cc: linux-arm-kernel@lists.infradead.org <mailto:
> linux-arm-kernel@lists.infradead.org>
> >     > ---
> >     >  arch/arm/mach-ks8695/Kconfig | 5 +++++
> >     >  1 file changed, 5 insertions(+)
> >     >
> >     > diff --git a/arch/arm/mach-ks8695/Kconfig
> b/arch/arm/mach-ks8695/Kconfig
> >     > index a545976..29d7d9f 100644
> >     > --- a/arch/arm/mach-ks8695/Kconfig
> >     > +++ b/arch/arm/mach-ks8695/Kconfig
> >     > @@ -5,6 +5,7 @@ menu "Kendin/Micrel KS8695 Implementations"
> >     >  config MACH_KS8695
> >     >         bool "KS8695 development board"
> >     >         select MIGHT_HAVE_PCI
> >     > +       depends on PCI
> >
> >     You need both PCI and MIGHT_HAVE_PCI? Don't know but it looks
> >     like defconfig is missing PCI stuff.. and MIGHT_HAVE_PCI is enough
> >     here?
> >
> >
> >  PCI is needed here because board-og.c file depends on pci.o.
>
> It shouldn't though, thus the original use of MIGHT_HAVE_PCI.
> The board-og.c machine code supports a number of boards, some of
> which don't have a PCI bus (that is they use the KS8695 CPU that
> doesn't contain the PCI bus silicon).
>
> I think you want a fix that makes the pci support code in this file
> conditional on CONFIG_PCI.
>
> You are suggesting me,as below

 +#ifdef CONFIG_PCI
        ks8695_init_pci(&og_pci);
+#endif

Regards
> Greg
>
>
>
> Thanks
Manjunath Goudar
Greg Ungerer Aug. 7, 2013, 7:25 a.m. UTC | #6
Hi Manjunath,

On 06/08/13 20:43, Manjunath Goudar wrote:
> On 6 August 2013 07:37, Greg Ungerer <gerg@uclinux.org <mailto:gerg@uclinux.org>> wrote:
>     On 05/08/13 20:31, Manjunath Goudar wrote:
>     > On 5 August 2013 14:47, Viresh Kumar <viresh.kumar@linaro.org <mailto:viresh.kumar@linaro.org> <mailto:viresh.kumar@linaro.org <mailto:viresh.kumar@linaro.org>>> wrote:
>     >
>     >     On 5 August 2013 14:37, Manjunath Goudar <manjunath.goudar@linaro.org <mailto:manjunath.goudar@linaro.org> <mailto:manjunath.goudar@linaro.org <mailto:manjunath.goudar@linaro.org>>> wrote:
>     >     > From: root <root@si-cspbld63.lge.net <mailto:root@si-cspbld63.lge.net> <mailto:root@si-cspbld63.lge.net <mailto:root@si-cspbld63.lge.net>>>
>     >
>     >     :)
>     >
>     >     > This patch adds a Kconfig dependency on MACH_KS8695,MACH_CM* or MACH_IM*
>     >     > being available before PCI can be enabled. Without this patch,build system
>     >
>     >     Add Space after ','
>     >
>     >     > can lead to issues. This was discovered during randconfig testing,
>     >     > without PCI if any one of MACH_KS8695,MACH_CM* or MACH_IM* being enabled,
>     >
>     >     Same here.
>     >
>     >     > leading to the following error:
>     >     >
>     >     > LD      init/built-in.o
>     >     > arch/arm/mach-ks8695/built-in.o: In function `og_register_pci':
>     >     > arch/arm/mach-ks8695/board-og.c:47:undefined reference to `ks8695_init_pci'
>     >     > make: *** [vmlinux] Error 1
>     >     >
>     >     > Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org <mailto:manjunath.goudar@linaro.org> <mailto:manjunath.goudar@linaro.org <mailto:manjunath.goudar@linaro.org>>>
>     >     > Cc: Arnd Bergmann <arnd@arndb.de <mailto:arnd@arndb.de> <mailto:arnd@arndb.de <mailto:arnd@arndb.de>>>
>     >     > Cc: Deepak Saxena <dsaxena@linaro.org <mailto:dsaxena@linaro.org> <mailto:dsaxena@linaro.org <mailto:dsaxena@linaro.org>>>
>     >     > Cc: Greg Ungerer <gerg@uclinux.org <mailto:gerg@uclinux.org> <mailto:gerg@uclinux.org <mailto:gerg@uclinux.org>>>
>     >     > Cc: linux-arm-kernel@lists.infradead.org <mailto:linux-arm-kernel@lists.infradead.org> <mailto:linux-arm-kernel@lists.infradead.org <mailto:linux-arm-kernel@lists.infradead.org>>
>     >     > ---
>     >     >  arch/arm/mach-ks8695/Kconfig | 5 +++++
>     >     >  1 file changed, 5 insertions(+)
>     >     >
>     >     > diff --git a/arch/arm/mach-ks8695/Kconfig b/arch/arm/mach-ks8695/Kconfig
>     >     > index a545976..29d7d9f 100644
>     >     > --- a/arch/arm/mach-ks8695/Kconfig
>     >     > +++ b/arch/arm/mach-ks8695/Kconfig
>     >     > @@ -5,6 +5,7 @@ menu "Kendin/Micrel KS8695 Implementations"
>     >     >  config MACH_KS8695
>     >     >         bool "KS8695 development board"
>     >     >         select MIGHT_HAVE_PCI
>     >     > +       depends on PCI
>     >
>     >     You need both PCI and MIGHT_HAVE_PCI? Don't know but it looks
>     >     like defconfig is missing PCI stuff.. and MIGHT_HAVE_PCI is enough
>     >     here?
>     >
>     >
>     >  PCI is needed here because board-og.c file depends on pci.o.
> 
>     It shouldn't though, thus the original use of MIGHT_HAVE_PCI.
>     The board-og.c machine code supports a number of boards, some of
>     which don't have a PCI bus (that is they use the KS8695 CPU that
>     doesn't contain the PCI bus silicon).
> 
>     I think you want a fix that makes the pci support code in this file
>     conditional on CONFIG_PCI.
> 
> You are suggesting me,as below
> 
>  +#ifdef CONFIG_PCI      
>         ks8695_init_pci(&og_pci);
> +#endif

Yes, in this case I think you will need something like this.

Regards
Greg
diff mbox

Patch

diff --git a/arch/arm/mach-ks8695/Kconfig b/arch/arm/mach-ks8695/Kconfig
index a545976..29d7d9f 100644
--- a/arch/arm/mach-ks8695/Kconfig
+++ b/arch/arm/mach-ks8695/Kconfig
@@ -5,6 +5,7 @@  menu "Kendin/Micrel KS8695 Implementations"
 config MACH_KS8695
 	bool "KS8695 development board"
 	select MIGHT_HAVE_PCI
+	depends on PCI
 	help
 	  Say 'Y' here if you want your kernel to run on the original
 	  Kendin-Micrel KS8695 development board.
@@ -53,6 +54,7 @@  config MACH_CM4002
 config MACH_CM4008
 	bool "OpenGear CM4008"
 	select MIGHT_HAVE_PCI
+	depends on PCI
 	help
 	  Say 'Y' here if you want your kernel to support the OpenGear
 	  CM4008 Console Server. See http://www.opengear.com for more
@@ -61,6 +63,7 @@  config MACH_CM4008
 config MACH_CM41xx
 	bool "OpenGear CM41xx"
 	select MIGHT_HAVE_PCI
+	depends on PCI
 	help
 	  Say 'Y' here if you want your kernel to support the OpenGear
 	  CM4016 or CM4048 Console Servers. See http://www.opengear.com for
@@ -69,6 +72,7 @@  config MACH_CM41xx
 config MACH_IM4004
 	bool "OpenGear IM4004"
 	select MIGHT_HAVE_PCI
+	depends on PCI
 	help
 	  Say 'Y' here if you want your kernel to support the OpenGear
 	  IM4004 Secure Access Server. See http://www.opengear.com for
@@ -77,6 +81,7 @@  config MACH_IM4004
 config MACH_IM42xx
 	bool "OpenGear IM42xx"
 	select MIGHT_HAVE_PCI
+	depends on PCI
 	help
 	  Say 'Y' here if you want your kernel to support the OpenGear
 	  IM4216 or IM4248 Console Servers. See http://www.opengear.com for