radeonfb/aty128fb: Disable broken early resume hook for PowerBooks

radeonfb and aty128fb have a special hook called by the PowerMac platform
code very very early on resume from sleep to bring the screen back. This
is useful for debugging wakup problems, but unfortunately, this also became
a source of problems of its own.

The hook is called extremely early, with interrupts still off, and the code
path involved with that code nowadays rely on things like taking mutexes,
GFP_KERNEL allocations, etc...

In addition, the driver now relies on the PCI core to restore the standard
config space before calling resume which doesn't happen with this early
code path.

I'm keeping the code in but commented out along with a fixup call to
pci_restore_state(). The reason is that I still want to make it easy to
re-enable temporarily to track wake up problems, and it's possible that
I can revive it at some stage if we make sleeping things save to call
in early resume using a system state.

In the meantime, this should fix several reported regressions.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

+18 -2
+9 -1
drivers/video/aty/aty128fb.c
··· 1853 1853 * Initialisation 1854 1854 */ 1855 1855 1856 - #ifdef CONFIG_PPC_PMAC 1856 + #ifdef CONFIG_PPC_PMAC__disabled 1857 1857 static void aty128_early_resume(void *data) 1858 1858 { 1859 1859 struct aty128fb_par *par = data; 1860 1860 1861 1861 if (try_acquire_console_sem()) 1862 1862 return; 1863 + pci_restore_state(par->pdev); 1863 1864 aty128_do_resume(par->pdev); 1864 1865 release_console_sem(); 1865 1866 } ··· 1908 1907 /* Indicate sleep capability */ 1909 1908 if (par->chip_gen == rage_M3) { 1910 1909 pmac_call_feature(PMAC_FTR_DEVICE_CAN_WAKE, NULL, 0, 1); 1910 + #if 0 /* Disable the early video resume hack for now as it's causing problems, among 1911 + * others we now rely on the PCI core restoring the config space for us, which 1912 + * isn't the case with that hack, and that code path causes various things to 1913 + * be called with interrupts off while they shouldn't. I'm leaving the code in 1914 + * as it can be useful for debugging purposes 1915 + */ 1911 1916 pmac_set_early_video_resume(aty128_early_resume, par); 1917 + #endif 1912 1918 } 1913 1919 1914 1920 /* Find default mode */
+9 -1
drivers/video/aty/radeon_pm.c
··· 2762 2762 return rc; 2763 2763 } 2764 2764 2765 - #ifdef CONFIG_PPC_OF 2765 + #ifdef CONFIG_PPC_OF__disabled 2766 2766 static void radeonfb_early_resume(void *data) 2767 2767 { 2768 2768 struct radeonfb_info *rinfo = data; 2769 2769 2770 2770 rinfo->no_schedule = 1; 2771 + pci_restore_state(rinfo->pdev); 2771 2772 radeonfb_pci_resume(rinfo->pdev); 2772 2773 rinfo->no_schedule = 0; 2773 2774 } ··· 2835 2834 */ 2836 2835 if (rinfo->pm_mode != radeon_pm_none) { 2837 2836 pmac_call_feature(PMAC_FTR_DEVICE_CAN_WAKE, rinfo->of_node, 0, 1); 2837 + #if 0 /* Disable the early video resume hack for now as it's causing problems, among 2838 + * others we now rely on the PCI core restoring the config space for us, which 2839 + * isn't the case with that hack, and that code path causes various things to 2840 + * be called with interrupts off while they shouldn't. I'm leaving the code in 2841 + * as it can be useful for debugging purposes 2842 + */ 2838 2843 pmac_set_early_video_resume(radeonfb_early_resume, rinfo); 2844 + #endif 2839 2845 } 2840 2846 2841 2847 #if 0