Skip to content

Commit d801cec

Browse files
committed
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>
1 parent 187cfc4 commit d801cec

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

drivers/video/aty/aty128fb.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,13 +1853,14 @@ static void aty128_bl_exit(struct backlight_device *bd)
18531853
* Initialisation
18541854
*/
18551855

1856-
#ifdef CONFIG_PPC_PMAC
1856+
#ifdef CONFIG_PPC_PMAC__disabled
18571857
static void aty128_early_resume(void *data)
18581858
{
18591859
struct aty128fb_par *par = data;
18601860

18611861
if (try_acquire_console_sem())
18621862
return;
1863+
pci_restore_state(par->pdev);
18631864
aty128_do_resume(par->pdev);
18641865
release_console_sem();
18651866
}
@@ -1907,7 +1908,14 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
19071908
/* Indicate sleep capability */
19081909
if (par->chip_gen == rage_M3) {
19091910
pmac_call_feature(PMAC_FTR_DEVICE_CAN_WAKE, NULL, 0, 1);
1911+
#if 0 /* Disable the early video resume hack for now as it's causing problems, among
1912+
* others we now rely on the PCI core restoring the config space for us, which
1913+
* isn't the case with that hack, and that code path causes various things to
1914+
* be called with interrupts off while they shouldn't. I'm leaving the code in
1915+
* as it can be useful for debugging purposes
1916+
*/
19101917
pmac_set_early_video_resume(aty128_early_resume, par);
1918+
#endif
19111919
}
19121920

19131921
/* Find default mode */

drivers/video/aty/radeon_pm.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2762,12 +2762,13 @@ int radeonfb_pci_resume(struct pci_dev *pdev)
27622762
return rc;
27632763
}
27642764

2765-
#ifdef CONFIG_PPC_OF
2765+
#ifdef CONFIG_PPC_OF__disabled
27662766
static void radeonfb_early_resume(void *data)
27672767
{
27682768
struct radeonfb_info *rinfo = data;
27692769

27702770
rinfo->no_schedule = 1;
2771+
pci_restore_state(rinfo->pdev);
27712772
radeonfb_pci_resume(rinfo->pdev);
27722773
rinfo->no_schedule = 0;
27732774
}
@@ -2834,7 +2835,14 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlis
28342835
*/
28352836
if (rinfo->pm_mode != radeon_pm_none) {
28362837
pmac_call_feature(PMAC_FTR_DEVICE_CAN_WAKE, rinfo->of_node, 0, 1);
2838+
#if 0 /* Disable the early video resume hack for now as it's causing problems, among
2839+
* others we now rely on the PCI core restoring the config space for us, which
2840+
* isn't the case with that hack, and that code path causes various things to
2841+
* be called with interrupts off while they shouldn't. I'm leaving the code in
2842+
* as it can be useful for debugging purposes
2843+
*/
28372844
pmac_set_early_video_resume(radeonfb_early_resume, rinfo);
2845+
#endif
28382846
}
28392847

28402848
#if 0

0 commit comments

Comments
 (0)