diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-11-11 07:10:08 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-11-14 17:30:21 -0500 |
commit | bc9f54498eadc5254378e376e8d2111cfd30b229 (patch) | |
tree | db23da7000e73e85ebe6ad9a115ab89431498ee0 /arch/arm | |
parent | 952f6d1386b21c5e8db346b805380bf2432e5e9b (diff) |
PM / shmobile: Avoid restoring the INTCS state during initialization
The SH7372 PM domain initialization routine calls pd_power_up()
that executes the domain's .resume() callback, if present, and for
the A4R domain this callback attepmts to restore the INTCS state from
uninitialized data. To avoid that, introduce __pd_power_up() that
will only execute the domain's .resume() callback if its second
argument is 'true' and make the SH7372 PM domain initialization
use it with 'false' as its second argument. Redefine pd_power_up()
as a wrapper around __pd_power_up().
Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Tracked-down-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Magnus Damm <damm@opensource.se>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-shmobile/pm-sh7372.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c index 78c98a847433..1ec35ebe2376 100644 --- a/arch/arm/mach-shmobile/pm-sh7372.c +++ b/arch/arm/mach-shmobile/pm-sh7372.c | |||
@@ -107,9 +107,8 @@ static int pd_power_down(struct generic_pm_domain *genpd) | |||
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
109 | 109 | ||
110 | static int pd_power_up(struct generic_pm_domain *genpd) | 110 | static int __pd_power_up(struct sh7372_pm_domain *sh7372_pd, bool do_resume) |
111 | { | 111 | { |
112 | struct sh7372_pm_domain *sh7372_pd = to_sh7372_pd(genpd); | ||
113 | unsigned int mask = 1 << sh7372_pd->bit_shift; | 112 | unsigned int mask = 1 << sh7372_pd->bit_shift; |
114 | unsigned int retry_count; | 113 | unsigned int retry_count; |
115 | int ret = 0; | 114 | int ret = 0; |
@@ -138,12 +137,17 @@ static int pd_power_up(struct generic_pm_domain *genpd) | |||
138 | mask, __raw_readl(PSTR)); | 137 | mask, __raw_readl(PSTR)); |
139 | 138 | ||
140 | out: | 139 | out: |
141 | if (ret == 0 && sh7372_pd->resume) | 140 | if (ret == 0 && sh7372_pd->resume && do_resume) |
142 | sh7372_pd->resume(); | 141 | sh7372_pd->resume(); |
143 | 142 | ||
144 | return ret; | 143 | return ret; |
145 | } | 144 | } |
146 | 145 | ||
146 | static int pd_power_up(struct generic_pm_domain *genpd) | ||
147 | { | ||
148 | return __pd_power_up(to_sh7372_pd(genpd), true); | ||
149 | } | ||
150 | |||
147 | static void sh7372_a4r_suspend(void) | 151 | static void sh7372_a4r_suspend(void) |
148 | { | 152 | { |
149 | sh7372_intcs_suspend(); | 153 | sh7372_intcs_suspend(); |
@@ -175,7 +179,7 @@ void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd) | |||
175 | genpd->active_wakeup = pd_active_wakeup; | 179 | genpd->active_wakeup = pd_active_wakeup; |
176 | genpd->power_off = pd_power_down; | 180 | genpd->power_off = pd_power_down; |
177 | genpd->power_on = pd_power_up; | 181 | genpd->power_on = pd_power_up; |
178 | genpd->power_on(&sh7372_pd->genpd); | 182 | __pd_power_up(sh7372_pd, false); |
179 | } | 183 | } |
180 | 184 | ||
181 | void sh7372_add_device_to_domain(struct sh7372_pm_domain *sh7372_pd, | 185 | void sh7372_add_device_to_domain(struct sh7372_pm_domain *sh7372_pd, |