Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

atyfb: Properly save PCI state before changing PCI PM level

This fixes atyfb to properly save the PCI config space -before- it
potentially switches the PM state of the chip. This avoids a
warning with the new PM core and is the right thing to do anyway.

I also slightly cleaned up the code that checks whether we are
running on a PowerMac to do a runtime check instead of a compile
check only, and replaced a deprecated number with the proper
symbolic constant.

Finally, I removed the useless switch to D0 from resume since
the core does it for us.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Benjamin Herrenschmidt and committed by
Linus Torvalds
b7468168 e83102ca

+15 -5
+15 -5
drivers/video/aty/atyfb_base.c
··· 1978 1978 1979 1979 return timeout ? 0 : -EIO; 1980 1980 } 1981 - #endif 1981 + #endif /* CONFIG_PPC_PMAC */ 1982 1982 1983 1983 static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) 1984 1984 { ··· 2002 2002 par->asleep = 1; 2003 2003 par->lock_blank = 1; 2004 2004 2005 + /* Because we may change PCI D state ourselves, we need to 2006 + * first save the config space content so the core can 2007 + * restore it properly on resume. 2008 + */ 2009 + pci_save_state(pdev); 2010 + 2005 2011 #ifdef CONFIG_PPC_PMAC 2006 2012 /* Set chip to "suspend" mode */ 2007 - if (aty_power_mgmt(1, par)) { 2013 + if (machine_is(powermac) && aty_power_mgmt(1, par)) { 2008 2014 par->asleep = 0; 2009 2015 par->lock_blank = 0; 2010 2016 atyfb_blank(FB_BLANK_UNBLANK, info); ··· 2053 2047 2054 2048 acquire_console_sem(); 2055 2049 2050 + /* PCI state will have been restored by the core, so 2051 + * we should be in D0 now with our config space fully 2052 + * restored 2053 + */ 2054 + 2056 2055 #ifdef CONFIG_PPC_PMAC 2057 - if (pdev->dev.power.power_state.event == 2) 2056 + if (machine_is(powermac) && 2057 + pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) 2058 2058 aty_power_mgmt(0, par); 2059 - #else 2060 - pci_set_power_state(pdev, PCI_D0); 2061 2059 #endif 2062 2060 2063 2061 aty_resume_chip(info);