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

s390/pci: implement hibernation hooks

Implement architecture-specific functionality when a PCI device is
doing a hibernate transition.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Sebastian Ott and committed by
Martin Schwidefsky
69db3b5e e258d719

+41
+41
arch/s390/pci/pci.c
··· 708 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 752 static int zpci_scan_bus(struct zpci_dev *zdev) 712 753 { 713 754 struct resource *res;