summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-05-02 16:12:00 +1000
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-02 08:15:22 -0700
commite521dca64e0f82d844928c5ee88d82fdced50cbe (patch)
treec894a71c7d1a22e6c814f202532ec55616665adb /arch
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 'arch')
-rw-r--r--arch/ppc/platforms/pmac_feature.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/ppc/platforms/pmac_feature.c b/arch/ppc/platforms/pmac_feature.c
index f0bb3d39b686..867336ad5d36 100644
--- a/arch/ppc/platforms/pmac_feature.c
+++ b/arch/ppc/platforms/pmac_feature.c
@@ -1591,8 +1591,10 @@ intrepid_shutdown(struct macio_chip* macio, int sleep_mode)
}
-static void __pmac pmac_tweak_clock_spreading(struct macio_chip* macio, int enable)
+void __pmac pmac_tweak_clock_spreading(int enable)
{
+ struct macio_chip* macio = &macio_chips[0];
+
/* Hack for doing clock spreading on some machines PowerBooks and
* iBooks. This implements the "platform-do-clockspreading" OF
* property as decoded manually on various models. For safety, we also
@@ -1707,9 +1709,6 @@ core99_sleep(void)
macio->type != macio_intrepid)
return -ENODEV;
- /* Disable clock spreading */
- pmac_tweak_clock_spreading(macio, 0);
-
/* We power off the wireless slot in case it was not done
* by the driver. We don't power it on automatically however
*/
@@ -1852,9 +1851,6 @@ core99_wake_up(void)
UN_OUT(UNI_N_CLOCK_CNTL, save_unin_clock_ctl);
udelay(100);
- /* Enable clock spreading */
- pmac_tweak_clock_spreading(macio, 1);
-
return 0;
}
@@ -2822,7 +2818,7 @@ set_initial_features(void)
* clock spreading now. This should be a platform function but we
* don't do these at the moment
*/
- pmac_tweak_clock_spreading(&macio_chips[0], 1);
+ pmac_tweak_clock_spreading(1);
#endif /* CONFIG_POWER4 */