Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1469881 > unrolled thread

Re: [PATCH] ARM: imx: add cpuidle support for i.mx6ul

Started byPeter Chen <hzpeterchen@gmail.com>
First post2016-08-25 09:10 +0200
Last post2016-08-26 07:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] ARM: imx: add cpuidle support for i.mx6ul Peter Chen <hzpeterchen@gmail.com> - 2016-08-25 09:10 +0200
    RE: [PATCH] ARM: imx: add cpuidle support for i.mx6ul Yongcai Huang <anson.huang@nxp.com> - 2016-08-26 07:20 +0200

#1469881 — Re: [PATCH] ARM: imx: add cpuidle support for i.mx6ul

FromPeter Chen <hzpeterchen@gmail.com>
Date2016-08-25 09:10 +0200
SubjectRe: [PATCH] ARM: imx: add cpuidle support for i.mx6ul
Message-ID<s9WXv-6bb-7@gated-at.bofh.it>
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
>  arch/arm/mach-imx/cpuidle-imx6sx.c | 10 ++++++++++
>  arch/arm/mach-imx/mach-imx6ul.c    |  3 +++
>  2 files changed, 13 insertions(+)
>
> diff --git a/arch/arm/mach-imx/cpuidle-imx6sx.c b/arch/arm/mach-imx/cpuidle-imx6sx.c
> index 41cdce6..b4fcc8ae 100644
> --- a/arch/arm/mach-imx/cpuidle-imx6sx.c
> +++ b/arch/arm/mach-imx/cpuidle-imx6sx.c
> @@ -9,14 +9,21 @@
>  #include <linux/cpuidle.h>
>  #include <linux/cpu_pm.h>
>  #include <linux/module.h>
> +#include <linux/of.h>
> +#include <asm/cacheflush.h>
>  #include <asm/cpuidle.h>
>  #include <asm/suspend.h>
>
>  #include "common.h"
>  #include "cpuidle.h"
>
> +static bool pl310_available;
> +


>  static int imx6sx_idle_finish(unsigned long val)
>  {
> +       /* check if need to flush internal L2 cache */
> +       if (!pl310_available)

Just wondering why you need an extra variable here?
Calling of_find_compatible_node takes long time at that time?

Peter

> +               flush_cache_all();
>         cpu_do_idle();
>
>         return 0;
> @@ -101,5 +108,8 @@ int __init imx6sx_cpuidle_init(void)
>         imx_gpc_set_arm_power_up_timing(2, 1);
>         imx_gpc_set_arm_power_down_timing(1, 1);
>
> +       if (of_find_compatible_node(NULL, NULL, "arm,pl310-cache"))
> +               pl310_available = true;
> +
>         return cpuidle_register(&imx6sx_cpuidle_driver, NULL);
>  }
> diff --git a/arch/arm/mach-imx/mach-imx6ul.c b/arch/arm/mach-imx/mach-imx6ul.c
> index c2cd61c..9c5e8f3 100644
> --- a/arch/arm/mach-imx/mach-imx6ul.c
> +++ b/arch/arm/mach-imx/mach-imx6ul.c
> @@ -16,6 +16,7 @@
>  #include <asm/mach/map.h>
>
>  #include "common.h"
> +#include "cpuidle.h"
>
>  static void __init imx6ul_enet_clk_init(void)
>  {
> @@ -80,6 +81,8 @@ static void __init imx6ul_init_irq(void)
>
>  static void __init imx6ul_init_late(void)
>  {
> +       imx6sx_cpuidle_init();
> +
>         if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) {
>                 imx6_pm_opp_init();
>                 platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
> --
> 1.9.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

[toc] | [next] | [standalone]


#1470548

FromYongcai Huang <anson.huang@nxp.com>
Date2016-08-26 07:20 +0200
Message-ID<sahIC-2JS-3@gated-at.bofh.it>
In reply to#1469881

Best Regards!
Anson Huang



> -----Original Message-----
> From: Peter Chen [mailto:hzpeterchen@gmail.com]
> Sent: 2016-08-25 3:09 PM
> To: Yongcai Huang <anson.huang@nxp.com>
> Cc: linux-arm-kernel@lists.infradead.org; lkml <linux-kernel@vger.kernel.org>;
> Fabio Estevam <fabio.estevam@nxp.com>; shawnguo@kernel.org;
> linux@armlinux.org.uk; kernel@pengutronix.de
> Subject: Re: [PATCH] ARM: imx: add cpuidle support for i.mx6ul
> 
> >
> > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> > ---
> >  arch/arm/mach-imx/cpuidle-imx6sx.c | 10 ++++++++++
> >  arch/arm/mach-imx/mach-imx6ul.c    |  3 +++
> >  2 files changed, 13 insertions(+)
> >
> > diff --git a/arch/arm/mach-imx/cpuidle-imx6sx.c
> > b/arch/arm/mach-imx/cpuidle-imx6sx.c
> > index 41cdce6..b4fcc8ae 100644
> > --- a/arch/arm/mach-imx/cpuidle-imx6sx.c
> > +++ b/arch/arm/mach-imx/cpuidle-imx6sx.c
> > @@ -9,14 +9,21 @@
> >  #include <linux/cpuidle.h>
> >  #include <linux/cpu_pm.h>
> >  #include <linux/module.h>
> > +#include <linux/of.h>
> > +#include <asm/cacheflush.h>
> >  #include <asm/cpuidle.h>
> >  #include <asm/suspend.h>
> >
> >  #include "common.h"
> >  #include "cpuidle.h"
> >
> > +static bool pl310_available;
> > +
> 
> 
> >  static int imx6sx_idle_finish(unsigned long val)  {
> > +       /* check if need to flush internal L2 cache */
> > +       if (!pl310_available)
> 
> Just wondering why you need an extra variable here?
> Calling of_find_compatible_node takes long time at that time?
> 
> Peter
> 

Because cpu idle enter/exit is called very frequently, so calling
of_find_compatible_node in every cpu idle thread is adding too
many latency, I think adding a variable is better.

Anson

> > +               flush_cache_all();
> >         cpu_do_idle();
> >
> >         return 0;
> > @@ -101,5 +108,8 @@ int __init imx6sx_cpuidle_init(void)
> >         imx_gpc_set_arm_power_up_timing(2, 1);
> >         imx_gpc_set_arm_power_down_timing(1, 1);
> >
> > +       if (of_find_compatible_node(NULL, NULL, "arm,pl310-cache"))
> > +               pl310_available = true;
> > +
> >         return cpuidle_register(&imx6sx_cpuidle_driver, NULL);  } diff
> > --git a/arch/arm/mach-imx/mach-imx6ul.c
> > b/arch/arm/mach-imx/mach-imx6ul.c index c2cd61c..9c5e8f3 100644
> > --- a/arch/arm/mach-imx/mach-imx6ul.c
> > +++ b/arch/arm/mach-imx/mach-imx6ul.c
> > @@ -16,6 +16,7 @@
> >  #include <asm/mach/map.h>
> >
> >  #include "common.h"
> > +#include "cpuidle.h"
> >
> >  static void __init imx6ul_enet_clk_init(void)  { @@ -80,6 +81,8 @@
> > static void __init imx6ul_init_irq(void)
> >
> >  static void __init imx6ul_init_late(void)  {
> > +       imx6sx_cpuidle_init();
> > +
> >         if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) {
> >                 imx6_pm_opp_init();
> >                 platform_device_register_simple("imx6q-cpufreq", -1,
> > NULL, 0);
> > --
> > 1.9.1
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web