diff mbox

[2/6] ARM: omap: allow building omap44xx without SMP

Message ID CAMQu2gw0x6saWrK-M3teu49tJDGvS8RhGrVSh6JTs5DEy+22pA@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Santosh Shilimkar Aug. 22, 2012, 3:36 p.m. UTC
On Wed, Aug 22, 2012 at 8:43 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> The new omap4 cpuidle implementation currently requires
> ARCH_NEEDS_CPU_IDLE_COUPLED, which only works on SMP.
>
> This patch makes it possible to build a non-SMP kernel
> for that platform. This is not normally desired for
> end-users but can be useful for testing.
>
> Without this patch, building rand-0y2jSKT results in:
>
> drivers/cpuidle/coupled.c: In function 'cpuidle_coupled_poke':
> drivers/cpuidle/coupled.c:317:3: error: implicit declaration of function '__smp_call_function_single' [-Werror=implicit-function-declaration]
>
> It's not clear if this patch is the best solution for
> the problem at hand. I have made sure that we can now
> build the kernel in all configurations, but that does
> not mean it will actually work on an OMAP44xx.
>
Am not sure either about the subject patch.

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/Kconfig       |    2 +-
>  arch/arm/mach-omap2/cpuidle44xx.c |    3 ++-
>  include/linux/cpuidle.h           |    4 ++++
>  3 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
> index dd2db02..66a8be3 100644
> --- a/arch/arm/mach-omap2/Kconfig
> +++ b/arch/arm/mach-omap2/Kconfig
> @@ -62,7 +62,7 @@ config ARCH_OMAP4
>         select PM_OPP if PM
>         select USB_ARCH_HAS_EHCI if USB_SUPPORT
>         select ARM_CPU_SUSPEND if PM
> -       select ARCH_NEEDS_CPU_IDLE_COUPLED
> +       select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
>
>  config SOC_OMAP5
>         bool "TI OMAP5"
> diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
> index ee05e19..288bee6 100644
> --- a/arch/arm/mach-omap2/cpuidle44xx.c
> +++ b/arch/arm/mach-omap2/cpuidle44xx.c
> @@ -238,8 +238,9 @@ int __init omap4_idle_init(void)
>         for_each_cpu(cpu_id, cpu_online_mask) {
>                 dev = &per_cpu(omap4_idle_dev, cpu_id);
>                 dev->cpu = cpu_id;
> +#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
>                 dev->coupled_cpus = *cpu_online_mask;
> -
> +#endif

Was just thinking whether we should just take care of it at
core cpuidle level itself. Will below be enough to kill the build
error what you mentioned in the change log ?


Regards
Santosh

Comments

Arnd Bergmann Aug. 22, 2012, 5:22 p.m. UTC | #1
On Wednesday 22 August 2012, Shilimkar, Santosh wrote:

> Was just thinking whether we should just take care of it at
> core cpuidle level itself. Will below be enough to kill the build
> error what you mentioned in the change log ?
> 
> diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
> index 2c9bf26..df34534 100644
> --- a/drivers/cpuidle/coupled.c
> +++ b/drivers/cpuidle/coupled.c
> @@ -314,7 +314,9 @@ static void cpuidle_coupled_poke(int cpu)
>         struct call_single_data *csd = &per_cpu(cpuidle_coupled_poke_cb, cpu);
> 
>         if (!cpumask_test_and_set_cpu(cpu, &cpuidle_coupled_poked_mask))
> +#ifdef CONFIG_SMP
>                 __smp_call_function_single(cpu, csd, 0);
> +#endif
>  }
> 

That would work, but isn't the entire concept of the cpuidle-coupled driver
dependent on SMP? If this driver makes no sense on UP, I think we should
not attempt to build it.

	Arnd
Santosh Shilimkar Aug. 23, 2012, 7:05 a.m. UTC | #2
On Wed, Aug 22, 2012 at 10:52 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Wednesday 22 August 2012, Shilimkar, Santosh wrote:
>
> > Was just thinking whether we should just take care of it at
> > core cpuidle level itself. Will below be enough to kill the build
> > error what you mentioned in the change log ?
> >
> > diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
> > index 2c9bf26..df34534 100644
> > --- a/drivers/cpuidle/coupled.c
> > +++ b/drivers/cpuidle/coupled.c
> > @@ -314,7 +314,9 @@ static void cpuidle_coupled_poke(int cpu)
> >         struct call_single_data *csd = &per_cpu(cpuidle_coupled_poke_cb,
> > cpu);
> >
> >         if (!cpumask_test_and_set_cpu(cpu, &cpuidle_coupled_poked_mask))
> > +#ifdef CONFIG_SMP
> >                 __smp_call_function_single(cpu, csd, 0);
> > +#endif
> >  }
> >
>
> That would work, but isn't the entire concept of the cpuidle-coupled
> driver
> dependent on SMP? If this driver makes no sense on UP, I think we should
> not attempt to build it.
>
I see your point but alternate patch is pushing down the fix to the low
level driver and that means you end up patching more drivers when they
use COUPLE idle infrastructure. That was the only reason I was thinking
of suppressing the error at the source.

Since it is just for the random builds and actually doesn't impact the real
functionality as such, I am fine with your proposed patch too.

Regards
santosh
Arnd Bergmann Aug. 23, 2012, 12:12 p.m. UTC | #3
On Thursday 23 August 2012, Shilimkar, Santosh wrote:
> I see your point but alternate patch is pushing down the fix to the low
> level driver and that means you end up patching more drivers when they
> use COUPLE idle infrastructure. That was the only reason I was thinking
> of suppressing the error at the source.
> 
> Since it is just for the random builds and actually doesn't impact the real
> functionality as such, I am fine with your proposed patch too.

Ok. It would be nice of course to test if this actually works on uniprocessor
configurations.

	Arnd
Santosh Shilimkar Aug. 23, 2012, 1 p.m. UTC | #4
On Thu, Aug 23, 2012 at 5:42 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Thursday 23 August 2012, Shilimkar, Santosh wrote:
> > I see your point but alternate patch is pushing down the fix to the low
> > level driver and that means you end up patching more drivers when they
> > use COUPLE idle infrastructure. That was the only reason I was thinking
> > of suppressing the error at the source.
> >
> > Since it is just for the random builds and actually doesn't impact the
> > real
> > functionality as such, I am fine with your proposed patch too.
>
> Ok. It would be nice of course to test if this actually works on
> uniprocessor
> configurations.
>
Have tested the patch and it does boot with UP build on OMAP.

Acked-tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Arnd Bergmann Aug. 23, 2012, 1:32 p.m. UTC | #5
On Thursday 23 August 2012, Shilimkar, Santosh wrote:
> 
> On Thu, Aug 23, 2012 at 5:42 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > On Thursday 23 August 2012, Shilimkar, Santosh wrote:
> > > I see your point but alternate patch is pushing down the fix to the low
> > > level driver and that means you end up patching more drivers when they
> > > use COUPLE idle infrastructure. That was the only reason I was thinking
> > > of suppressing the error at the source.
> > >
> > > Since it is just for the random builds and actually doesn't impact the
> > > real
> > > functionality as such, I am fine with your proposed patch too.
> >
> > Ok. It would be nice of course to test if this actually works on
> > uniprocessor
> > configurations.
> >
> Have tested the patch and it does boot with UP build on OMAP.
> 
> Acked-tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

Ok, thanks a lot!

	Arnd
diff mbox

Patch

diff --git a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
index 2c9bf26..df34534 100644
--- a/drivers/cpuidle/coupled.c
+++ b/drivers/cpuidle/coupled.c
@@ -314,7 +314,9 @@  static void cpuidle_coupled_poke(int cpu)
        struct call_single_data *csd = &per_cpu(cpuidle_coupled_poke_cb, cpu);

        if (!cpumask_test_and_set_cpu(cpu, &cpuidle_coupled_poked_mask))
+#ifdef CONFIG_SMP
                __smp_call_function_single(cpu, csd, 0);
+#endif
 }

 /**