aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/via-pmu.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-05-02 02:12:00 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-02 11:15:22 -0400
commite521dca64e0f82d844928c5ee88d82fdced50cbe (patch)
treec894a71c7d1a22e6c814f202532ec55616665adb /drivers/macintosh/via-pmu.c
parent6995f17a5ab3c3fd4df2e5b107d08cff1db3fa41 (diff)
[PATCH] ppc32: Fix might_sleep() warning with clock spreading
The clock spreading disable/enable code was called to late/early during the suspend/resume code on some laptops and would trigger a might_sleep() warning due to the down() call in the low level i2c code. This fixes it by calling those functions earlier/later when interrupts are still enabled. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/macintosh/via-pmu.c')
-rw-r--r--drivers/macintosh/via-pmu.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index fdea1a3a631d..e654aa5eecd4 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -2351,6 +2351,10 @@ pmac_suspend_devices(void)
2351 return -EBUSY; 2351 return -EBUSY;
2352 } 2352 }
2353 2353
2354 /* Disable clock spreading on some machines */
2355 pmac_tweak_clock_spreading(0);
2356
2357 /* Stop preemption */
2354 preempt_disable(); 2358 preempt_disable();
2355 2359
2356 /* Make sure the decrementer won't interrupt us */ 2360 /* Make sure the decrementer won't interrupt us */
@@ -2417,11 +2421,12 @@ pmac_wakeup_devices(void)
2417 2421
2418 /* Re-enable local CPU interrupts */ 2422 /* Re-enable local CPU interrupts */
2419 local_irq_enable(); 2423 local_irq_enable();
2420
2421 mdelay(100); 2424 mdelay(100);
2422
2423 preempt_enable(); 2425 preempt_enable();
2424 2426
2427 /* Re-enable clock spreading on some machines */
2428 pmac_tweak_clock_spreading(1);
2429
2425 /* Resume devices */ 2430 /* Resume devices */
2426 device_resume(); 2431 device_resume();
2427 2432