diff options
-rw-r--r-- | arch/s390/pci/pci.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index f17a8343e360..206186c44ade 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c | |||
@@ -708,6 +708,47 @@ void pcibios_disable_device(struct pci_dev *pdev) | |||
708 | zdev->pdev = NULL; | 708 | zdev->pdev = NULL; |
709 | } | 709 | } |
710 | 710 | ||
711 | #ifdef CONFIG_HIBERNATE_CALLBACKS | ||
712 | static int zpci_restore(struct device *dev) | ||
713 | { | ||
714 | struct zpci_dev *zdev = get_zdev(to_pci_dev(dev)); | ||
715 | int ret = 0; | ||
716 | |||
717 | if (zdev->state != ZPCI_FN_STATE_ONLINE) | ||
718 | goto out; | ||
719 | |||
720 | ret = clp_enable_fh(zdev, ZPCI_NR_DMA_SPACES); | ||
721 | if (ret) | ||
722 | goto out; | ||
723 | |||
724 | zpci_map_resources(zdev); | ||
725 | zpci_register_ioat(zdev, 0, zdev->start_dma + PAGE_OFFSET, | ||
726 | zdev->start_dma + zdev->iommu_size - 1, | ||
727 | (u64) zdev->dma_table); | ||
728 | |||
729 | out: | ||
730 | return ret; | ||
731 | } | ||
732 | |||
733 | static int zpci_freeze(struct device *dev) | ||
734 | { | ||
735 | struct zpci_dev *zdev = get_zdev(to_pci_dev(dev)); | ||
736 | |||
737 | if (zdev->state != ZPCI_FN_STATE_ONLINE) | ||
738 | return 0; | ||
739 | |||
740 | zpci_unregister_ioat(zdev, 0); | ||
741 | return clp_disable_fh(zdev); | ||
742 | } | ||
743 | |||
744 | struct dev_pm_ops pcibios_pm_ops = { | ||
745 | .thaw_noirq = zpci_restore, | ||
746 | .freeze_noirq = zpci_freeze, | ||
747 | .restore_noirq = zpci_restore, | ||
748 | .poweroff_noirq = zpci_freeze, | ||
749 | }; | ||
750 | #endif /* CONFIG_HIBERNATE_CALLBACKS */ | ||
751 | |||
711 | static int zpci_scan_bus(struct zpci_dev *zdev) | 752 | static int zpci_scan_bus(struct zpci_dev *zdev) |
712 | { | 753 | { |
713 | struct resource *res; | 754 | struct resource *res; |