powerpc/pmac: Fix issues with sleep on some powerbooks
commit6b05a888adf307827a8cc960a6f660555bf9a683
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 9 Oct 2009 11:27:54 +0000 (9 11:27 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Nov 2009 00:23:12 +0000 (9 16:23 -0800)
tree3bfb7cd2bce3226c29c464b60b23d2fb32548eb3
parente434e9fc1661989db1a39b6f5be29c39e13b419a
powerpc/pmac: Fix issues with sleep on some powerbooks

commit 11a50873ef2b3c1c3fe99a661c22c08f35d93553 upstream.

Since the change of how interrupts are disabled during suspend,
certain PowerBook models started exhibiting various issues during
suspend or resume from sleep.

I finally tracked it down to the code that runs various "platform"
functions (kind of little scripts extracted from the device-tree),
which uses our i2c and PMU drivers expecting interrutps to work,
and at a time where with the new scheme, they have been disabled.

This causes timeouts internally which for some reason results in
the PMU being unable to see the trackpad, among other issues, really
it depends on the machine. Most of the time, we fail to properly adjust
some clocks for suspend/resume so the results are not always
predictable.

This patch fixes it by using IRQF_TIMER for both the PMU and the I2C
interrupts. I prefer doing it this way than moving the call sites since
I really want those platform functions to still be called after all
drivers (and before sysdevs).

We also do a slight cleanup to via-pmu.c driver to make sure the
ADB autopoll mask is handled correctly when doing bus resets

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/powerpc/platforms/powermac/low_i2c.c
drivers/macintosh/via-pmu.c