public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: tony@atomide•com (Tony Lindgren)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 01/20] ARM: clean up idle handlers
Date: Mon, 19 Dec 2011 11:07:37 -0800	[thread overview]
Message-ID: <20111219190736.GK6464@atomide.com> (raw)
In-Reply-To: <1324288069-21940-2-git-send-email-nico@fluxnic.net>

* Nicolas Pitre <nico@fluxnic•net> [111219 01:20]:
> Let's factor out the need_resched() check instead of having it duplicated
> in every pm_idle implementations to avoid inconsistencies (omap2_pm_idle
> was missing it already).
> 
> The forceful re-enablement of IRQs after pm_idle has returned can go.
> The warning certainly doesn't trigger for existing users.  Similar for
> the redundant local_irq_disable() call in the OMAP implementations.
> 
> To get rid of the pm_idle calling convention oddity, let's introduce
> arm_pm_idle() allowing for the local_irq_enable() to be factored out
> from SOC specific implementations. The default pm_idle function becomes
> a wrapper for arm_pm_idle and it takes care of enabling IRQs closer to
> where they are initially disabled.
> 
> And finally move the comment explaining the reason for that turning off
> of IRQs to a more proper location.
> 
> Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro•org>

For omaps:

Tested-by: Tony Lindgren <tony@atomide•com>

For pm44xx.c the following merge will be needed for omap/omap4 branch
in arm-soc tree:

--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@@ -16,10 -17,10 +17,12 @@@
  #include <linux/err.h>
  #include <linux/slab.h>
  
 +#include <asm/system.h>
 +
  #include "common.h"
+ #include "clockdomain.h"
  #include "powerdomain.h"
+ #include "pm.h"
  
  struct power_state {
  	struct powerdomain *pwrdm;
@@@ -85,11 -161,30 +163,24 @@@ static int __init pwrdms_setup(struct p
  	pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC);
  	if (!pwrst)
  		return -ENOMEM;
+ 
  	pwrst->pwrdm = pwrdm;
- 	pwrst->next_state = PWRDM_POWER_ON;
+ 	pwrst->next_state = PWRDM_POWER_RET;
  	list_add(&pwrst->node, &pwrst_list);
  
- 	return pwrdm_set_next_pwrst(pwrst->pwrdm, pwrst->next_state);
+ 	return omap_set_pwrdm_state(pwrst->pwrdm, pwrst->next_state);
+ }
+ 
+ /**
+  * omap_default_idle - OMAP4 default ilde routine.'
+  *
+  * Implements OMAP4 memory, IO ordering requirements which can't be addressed
+  * with default arch_idle() hook. Used by all CPUs with !CONFIG_CPUIDLE and
+  * by secondary CPU with CONFIG_CPUIDLE.
+  */
+ static void omap_default_idle(void)
+ {
 -	local_irq_disable();
 -	local_fiq_disable();
 -
+ 	omap_do_wfi();
 -
 -	local_fiq_enable();
 -	local_irq_enable();
  }
  
  /**
@@@ -117,6 -255,11 +251,11 @@@ static int __init omap4_pm_init(void
  	suspend_set_ops(&omap_pm_ops);
  #endif /* CONFIG_SUSPEND */
  
+ 	/* Overwrite the default arch_idle() */
 -	pm_idle = omap_default_idle;
++	arm_pm_idle = omap_default_idle;
+ 
+ 	omap4_idle_init();
+ 
  err2:
  	return ret;
  }

Regards,

Tony

  reply	other threads:[~2011-12-19 19:07 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-19  9:47 [PATCH 00/20] arch_idle() cleanup and mach/system.h removal Nicolas Pitre
2011-12-19  9:47 ` [PATCH 01/20] ARM: clean up idle handlers Nicolas Pitre
2011-12-19 19:07   ` Tony Lindgren [this message]
2011-12-19 19:43     ` Nicolas Pitre
2011-12-20  0:41   ` Stephen Warren
2011-12-25  1:42   ` Shawn Guo
2011-12-25  1:48     ` Shawn Guo
2012-01-03  3:34       ` Nicolas Pitre
2011-12-19  9:47 ` [PATCH 02/20] ARM: mach-s5pv210: use standard arch_idle() Nicolas Pitre
2011-12-19  9:47 ` [PATCH 03/20] ARM: mach-s5pc100: " Nicolas Pitre
2011-12-19  9:47 ` [PATCH 04/20] ARM: mach-exynos: " Nicolas Pitre
2011-12-19  9:47 ` [PATCH 05/20] ARM: mach-at91: move special idle code out of line Nicolas Pitre
2011-12-19  9:47 ` [PATCH 06/20] ARM: mach-clps711x: " Nicolas Pitre
2011-12-19  9:47 ` [PATCH 07/20] ARM: mach-ebsa110: " Nicolas Pitre
2011-12-19  9:47 ` [PATCH 08/20] ARM: mach-gemini: " Nicolas Pitre
2011-12-19 17:55   ` Tony Lindgren
2011-12-19  9:47 ` [PATCH 09/20] ARM: mach-h720x: " Nicolas Pitre
2011-12-19  9:47 ` [PATCH 10/20] ARM: s3c24xx: move special idle code to " Nicolas Pitre
2011-12-19  9:47 ` [PATCH 11/20] ARM: plat-mxc: hook special idle handlers to arm_pm_idle Nicolas Pitre
2011-12-25  1:53   ` Shawn Guo
2012-01-03  3:32     ` Nicolas Pitre
2011-12-19  9:47 ` [PATCH 12/20] ARM: mach-msm: " Nicolas Pitre
2011-12-19 17:56   ` Tony Lindgren
2011-12-19 18:07     ` Nicolas Pitre
2011-12-19 23:21   ` David Brown
2011-12-19  9:47 ` [PATCH 13/20] ARM: mach-ixp23xx: properly disable CPU idle call Nicolas Pitre
2011-12-19  9:47 ` [PATCH 14/20] ARM: mach-ixp4xx: " Nicolas Pitre
2011-12-19  9:47 ` [PATCH 15/20] ARM: mach-shark: " Nicolas Pitre
2011-12-19  9:47 ` [PATCH 16/20] ARM: mach-w90x900: " Nicolas Pitre
2011-12-19  9:47 ` [PATCH 17/20] ARM: mach-s3c64xx: " Nicolas Pitre
2011-12-20 15:03   ` Mark Brown
2011-12-20 18:54     ` Nicolas Pitre
2011-12-20 23:36       ` Mark Brown
2011-12-19  9:47 ` [PATCH 18/20] ARM: mach-tegra: " Nicolas Pitre
2011-12-19  9:47 ` [PATCH 19/20] ARM: substitute arch_idle() Nicolas Pitre
2011-12-19 19:08   ` Tony Lindgren
2011-12-19  9:47 ` [PATCH 20/20] ARM: big removal of now unused arch_reset() Nicolas Pitre
2011-12-19 18:15   ` H Hartley Sweeten
2011-12-19 18:21     ` Nicolas Pitre
2011-12-19 19:08   ` Tony Lindgren
2011-12-19 23:22   ` David Brown
2011-12-24 23:22   ` Linus Walleij
2011-12-19 18:57 ` [PATCH 00/20] arch_idle() cleanup and mach/system.h removal Jamie Iles
2011-12-19 19:25   ` Nicolas Pitre
2012-01-13 10:43 ` Russell King - ARM Linux
2012-01-13 13:54   ` Nicolas Pitre
2012-01-13 14:07     ` Russell King - ARM Linux
2012-01-13 19:31       ` Nicolas Pitre
2012-01-21  3:20       ` Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111219190736.GK6464@atomide.com \
    --to=tony@atomide$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox