All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] ARM: imx6: build pm-imx6q.c independently of CONFIG_PM
@ 2014-02-18  2:35 Shawn Guo
  2014-02-19  0:04 ` Olof Johansson
  2014-02-25 19:46 ` Arnd Bergmann
  0 siblings, 2 replies; 5+ messages in thread
From: Shawn Guo @ 2014-02-18  2:35 UTC (permalink / raw)
  To: linux-arm-kernel

When building a kernel image with only CONFIG_CPU_IDLE but no CONFIG_PM,
we will get the following link error.

  LD      init/built-in.o
arch/arm/mach-imx/built-in.o: In function `imx6q_enter_wait':
platform-spi_imx.c:(.text+0x25c0): undefined reference to `imx6q_set_lpm'
platform-spi_imx.c:(.text+0x25d4): undefined reference to `imx6q_set_lpm'
arch/arm/mach-imx/built-in.o: In function `imx6q_cpuidle_init':
platform-spi_imx.c:(.init.text+0x75d4): undefined reference to `imx6q_set_chicken_bit'
make[1]: *** [vmlinux] Error 1

Since pm-imx6q.c has been a collection of library functions that access
CCM low-power registers used by not only suspend but also cpuidle and
other drivers, let's build pm-imx6q.c independently of CONFIG_PM to fix
above error.

Reported-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: stable at vger.kernel.org
Acked-by: Christian Gmeiner <christian.gmeiner@gmail.com>
---
Kevin, Olof, Arnd,

Please apply this fix for v3.14.  Thanks.

Shawn

 arch/arm/mach-imx/Makefile |    2 --
 arch/arm/mach-imx/common.h |    4 +---
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index befcaf5..ec41964 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -101,11 +101,9 @@ obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
 obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o
 obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o
 
-ifeq ($(CONFIG_PM),y)
 obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o
 # i.MX6SL reuses i.MX6Q code
 obj-$(CONFIG_SOC_IMX6SL) += pm-imx6q.o headsmp.o
-endif
 
 # i.MX5 based machines
 obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index 59c3b9b..baf439d 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -144,13 +144,11 @@ void imx6q_set_chicken_bit(void);
 void imx_cpu_die(unsigned int cpu);
 int imx_cpu_kill(unsigned int cpu);
 
-#ifdef CONFIG_PM
 void imx6q_pm_init(void);
 void imx6q_pm_set_ccm_base(void __iomem *base);
+#ifdef CONFIG_PM
 void imx5_pm_init(void);
 #else
-static inline void imx6q_pm_init(void) {}
-static inline void imx6q_pm_set_ccm_base(void __iomem *base) {}
 static inline void imx5_pm_init(void) {}
 #endif
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH RESEND] ARM: imx6: build pm-imx6q.c independently of CONFIG_PM
  2014-02-18  2:35 [PATCH RESEND] ARM: imx6: build pm-imx6q.c independently of CONFIG_PM Shawn Guo
@ 2014-02-19  0:04 ` Olof Johansson
  2014-02-25 19:46 ` Arnd Bergmann
  1 sibling, 0 replies; 5+ messages in thread
From: Olof Johansson @ 2014-02-19  0:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 18, 2014 at 10:35:05AM +0800, Shawn Guo wrote:
> When building a kernel image with only CONFIG_CPU_IDLE but no CONFIG_PM,
> we will get the following link error.
> 
>   LD      init/built-in.o
> arch/arm/mach-imx/built-in.o: In function `imx6q_enter_wait':
> platform-spi_imx.c:(.text+0x25c0): undefined reference to `imx6q_set_lpm'
> platform-spi_imx.c:(.text+0x25d4): undefined reference to `imx6q_set_lpm'
> arch/arm/mach-imx/built-in.o: In function `imx6q_cpuidle_init':
> platform-spi_imx.c:(.init.text+0x75d4): undefined reference to `imx6q_set_chicken_bit'
> make[1]: *** [vmlinux] Error 1
> 
> Since pm-imx6q.c has been a collection of library functions that access
> CCM low-power registers used by not only suspend but also cpuidle and
> other drivers, let's build pm-imx6q.c independently of CONFIG_PM to fix
> above error.
> 
> Reported-by: Lucas Stach <l.stach@pengutronix.de>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: stable at vger.kernel.org
> Acked-by: Christian Gmeiner <christian.gmeiner@gmail.com>
> ---
> Kevin, Olof, Arnd,
> 
> Please apply this fix for v3.14.  Thanks.

Applied, thanks.


-Olof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH RESEND] ARM: imx6: build pm-imx6q.c independently of CONFIG_PM
  2014-02-18  2:35 [PATCH RESEND] ARM: imx6: build pm-imx6q.c independently of CONFIG_PM Shawn Guo
  2014-02-19  0:04 ` Olof Johansson
@ 2014-02-25 19:46 ` Arnd Bergmann
  2014-02-26  7:28   ` Shawn Guo
  1 sibling, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2014-02-25 19:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 18 February 2014, Shawn Guo wrote:
> When building a kernel image with only CONFIG_CPU_IDLE but no CONFIG_PM,
> we will get the following link error.
> 

I seem to need more changes on top of this, to allow building with neither
CPU_IDLE nor PM enabled. Can you verify that?

	Arnd

commit 6a434aea44d8a250f8ee2205be9bc429b140b663
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Mon Feb 24 22:19:50 2014 +0100

    ARM: imx: more CONFIG_PM fixes
    
    This lets us build the imx code in more configurations.
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index a3fcd9c..a367675 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -147,15 +147,13 @@ int imx_cpu_kill(unsigned int cpu);
 
 void imx6q_pm_init(void);
 void imx6q_pm_set_ccm_base(void __iomem *base);
-#ifdef CONFIG_PM
-void imx6_suspend(void __iomem *ocram_vbase);
 void imx6dl_pm_init(void);
 void imx6sl_pm_init(void);
+#ifdef CONFIG_PM
+void imx6_suspend(void __iomem *ocram_vbase);
 void imx5_pm_init(void);
 #else
 static inline void imx6_suspend(void __iomem *ocram_vbase) {}
-static inline void imx6dl_pm_init(void) {}
-static inline void imx6sl_pm_init(void) {}
 static inline void imx5_pm_init(void) {}
 #endif
 
diff --git a/arch/arm/mach-imx/pm-imx6q.c b/arch/arm/mach-imx/pm-imx6q.c
index bb69943..5fea999 100644
--- a/arch/arm/mach-imx/pm-imx6q.c
+++ b/arch/arm/mach-imx/pm-imx6q.c
@@ -521,10 +521,12 @@ static void __init imx6_pm_common_init(const struct imx6_pm_socdata
 
 	WARN_ON(!ccm_base);
 
-	ret = imx6q_ocram_suspend_init(socdata);
-	if (ret)
-		pr_warn("%s: failed to initialize ocram suspend %d!\n",
-			__func__, ret);
+	if (IS_ENABLED(CONFIG_ARM_CPU_SUSPEND)) {
+		ret = imx6q_ocram_suspend_init(socdata);
+		if (ret)
+			pr_warn("%s: failed to initialize ocram suspend %d!\n",
+				__func__, ret);
+	}
 
 	/*
 	 * This is for SW workaround step #1 of ERR007265, see comments

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH RESEND] ARM: imx6: build pm-imx6q.c independently of CONFIG_PM
  2014-02-25 19:46 ` Arnd Bergmann
@ 2014-02-26  7:28   ` Shawn Guo
  2014-02-26  9:20     ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Shawn Guo @ 2014-02-26  7:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 25, 2014 at 08:46:03PM +0100, Arnd Bergmann wrote:
> On Tuesday 18 February 2014, Shawn Guo wrote:
> > When building a kernel image with only CONFIG_CPU_IDLE but no CONFIG_PM,
> > we will get the following link error.
> > 
> 
> I seem to need more changes on top of this, to allow building with neither
> CPU_IDLE nor PM enabled. Can you verify that?

The error is only seen on the linux-next, and partially caused by the
resolution for the conflict between this patch and the ones I queued for
3.15.  I'm rebasing my imx-soc-3.15 branch to 3.14-rc4, so that the
conflict can be solved on my branch in a cleaner way, which will help
fix the error here.  So hopefully, in the next build of linux-next, the
error will disappear.

Shawn

> 
> 	Arnd
> 
> commit 6a434aea44d8a250f8ee2205be9bc429b140b663
> Author: Arnd Bergmann <arnd@arndb.de>
> Date:   Mon Feb 24 22:19:50 2014 +0100
> 
>     ARM: imx: more CONFIG_PM fixes
>     
>     This lets us build the imx code in more configurations.
>     
>     Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
> index a3fcd9c..a367675 100644
> --- a/arch/arm/mach-imx/common.h
> +++ b/arch/arm/mach-imx/common.h
> @@ -147,15 +147,13 @@ int imx_cpu_kill(unsigned int cpu);
>  
>  void imx6q_pm_init(void);
>  void imx6q_pm_set_ccm_base(void __iomem *base);
> -#ifdef CONFIG_PM
> -void imx6_suspend(void __iomem *ocram_vbase);
>  void imx6dl_pm_init(void);
>  void imx6sl_pm_init(void);
> +#ifdef CONFIG_PM
> +void imx6_suspend(void __iomem *ocram_vbase);
>  void imx5_pm_init(void);
>  #else
>  static inline void imx6_suspend(void __iomem *ocram_vbase) {}
> -static inline void imx6dl_pm_init(void) {}
> -static inline void imx6sl_pm_init(void) {}
>  static inline void imx5_pm_init(void) {}
>  #endif
>  
> diff --git a/arch/arm/mach-imx/pm-imx6q.c b/arch/arm/mach-imx/pm-imx6q.c
> index bb69943..5fea999 100644
> --- a/arch/arm/mach-imx/pm-imx6q.c
> +++ b/arch/arm/mach-imx/pm-imx6q.c
> @@ -521,10 +521,12 @@ static void __init imx6_pm_common_init(const struct imx6_pm_socdata
>  
>  	WARN_ON(!ccm_base);
>  
> -	ret = imx6q_ocram_suspend_init(socdata);
> -	if (ret)
> -		pr_warn("%s: failed to initialize ocram suspend %d!\n",
> -			__func__, ret);
> +	if (IS_ENABLED(CONFIG_ARM_CPU_SUSPEND)) {
> +		ret = imx6q_ocram_suspend_init(socdata);
> +		if (ret)
> +			pr_warn("%s: failed to initialize ocram suspend %d!\n",
> +				__func__, ret);
> +	}
>  
>  	/*
>  	 * This is for SW workaround step #1 of ERR007265, see comments

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH RESEND] ARM: imx6: build pm-imx6q.c independently of CONFIG_PM
  2014-02-26  7:28   ` Shawn Guo
@ 2014-02-26  9:20     ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2014-02-26  9:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 26 February 2014 15:28:35 Shawn Guo wrote:
> 
> The error is only seen on the linux-next, and partially caused by the
> resolution for the conflict between this patch and the ones I queued for
> 3.15.  I'm rebasing my imx-soc-3.15 branch to 3.14-rc4, so that the
> conflict can be solved on my branch in a cleaner way, which will help
> fix the error here.  So hopefully, in the next build of linux-next, the
> error will disappear.

Ok, thanks a lot!

	Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-26  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-18  2:35 [PATCH RESEND] ARM: imx6: build pm-imx6q.c independently of CONFIG_PM Shawn Guo
2014-02-19  0:04 ` Olof Johansson
2014-02-25 19:46 ` Arnd Bergmann
2014-02-26  7:28   ` Shawn Guo
2014-02-26  9:20     ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.