From e521dca64e0f82d844928c5ee88d82fdced50cbe Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 2 May 2005 16:12:00 +1000 Subject: [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 Signed-off-by: Linus Torvalds --- drivers/macintosh/via-pmu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'drivers/macintosh') 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) return -EBUSY; } + /* Disable clock spreading on some machines */ + pmac_tweak_clock_spreading(0); + + /* Stop preemption */ preempt_disable(); /* Make sure the decrementer won't interrupt us */ @@ -2417,11 +2421,12 @@ pmac_wakeup_devices(void) /* Re-enable local CPU interrupts */ local_irq_enable(); - mdelay(100); - preempt_enable(); + /* Re-enable clock spreading on some machines */ + pmac_tweak_clock_spreading(1); + /* Resume devices */ device_resume(); -- cgit v1.2.3-59-g8ed1b