diff options
author | Wang Dongsheng <dongsheng.wang@freescale.com> | 2014-05-09 04:06:07 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2014-05-09 16:13:04 (GMT) |
commit | ec65b6f5a7c541f551cfa05802a48d67f4174da4 (patch) | |
tree | e05c9619d4d683a5440797a1027c239dfc6b9817 /arch | |
parent | f33c54a20981af0f4ff8701cd4c657ec1d4fec10 (diff) | |
download | linux-fsl-qoriq-ec65b6f5a7c541f551cfa05802a48d67f4174da4.tar.xz |
hibernation/pci: fix PCI-EP device bar lost in hibernation thaw flow
EP device bar address will lost when EP device in D3 state,
But when system thaw out from hibernation freezen, EP bar address
not be restored in thaw flow.
The pci framework provide arch-specific hooks(pcibios_pm_ops) when
a PCI device is doing a hibernate transition, so register
fsl_pci_thaw_noirq into pcibios_pm_ops to fix this issue, the
fsl_pci_thaw_noirq will call pci_restore_state() to restore EP bar
address.
Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
Change-Id: I11b68737dd9aafc99f4b7571558529c37e8a648b
Reviewed-on: http://git.am.freescale.net:8181/12031
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Yang Li <LeoLi@freescale.com>
Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/sysdev/fsl_pci.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 65be890..91586ac 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -1371,12 +1371,25 @@ static struct syscore_ops pci_syscore_pm_ops = { .suspend = fsl_pci_syscore_suspend, .resume = fsl_pci_syscore_resume, }; + +#ifdef CONFIG_HIBERNATE_CALLBACKS +static int fsl_pci_thaw_noirq(struct device *dev) +{ + struct pci_dev *pci_dev = to_pci_dev(dev); + + pci_restore_state(pci_dev); + return 0; +} +#endif #endif void fsl_pcibios_fixup_phb(struct pci_controller *phb) { #ifdef CONFIG_PM_SLEEP fsl_pci_pme_probe(phb); +#ifdef CONFIG_HIBERNATE_CALLBACKS + pcibios_pm_ops.thaw_noirq = fsl_pci_thaw_noirq; +#endif #endif } |