summaryrefslogtreecommitdiffstats
path: root/arch/s390/pci
diff options
context:
space:
mode:
authorJoerg Roedel2017-04-27 14:44:06 +0200
committerJoerg Roedel2017-08-15 18:22:45 +0200
commitf42c22351455bcc8b9eecea19b48bdb499a50a65 (patch)
treebef9c48454e3d1d0f9df8806c6897a26a6172db6 /arch/s390/pci
parentLinux 4.13-rc5 (diff)
downloadkernel-qcow2-linux-f42c22351455bcc8b9eecea19b48bdb499a50a65.tar.gz
kernel-qcow2-linux-f42c22351455bcc8b9eecea19b48bdb499a50a65.tar.xz
kernel-qcow2-linux-f42c22351455bcc8b9eecea19b48bdb499a50a65.zip
iommu/s390: Add support for iommu_device handling
Add support for the iommu_device_register interface to make the s390 hardware iommus visible to the iommu core and in sysfs. Acked-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'arch/s390/pci')
-rw-r--r--arch/s390/pci/pci.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 7b30af5da222..001ca80fa2fe 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -776,6 +776,7 @@ void pcibios_remove_bus(struct pci_bus *bus)
zpci_exit_slot(zdev);
zpci_cleanup_bus_resources(zdev);
+ zpci_destroy_iommu(zdev);
zpci_free_domain(zdev);
spin_lock(&zpci_list_lock);
@@ -848,11 +849,15 @@ int zpci_create_device(struct zpci_dev *zdev)
if (rc)
goto out;
+ rc = zpci_init_iommu(zdev);
+ if (rc)
+ goto out_free;
+
mutex_init(&zdev->lock);
if (zdev->state == ZPCI_FN_STATE_CONFIGURED) {
rc = zpci_enable_device(zdev);
if (rc)
- goto out_free;
+ goto out_destroy_iommu;
}
rc = zpci_scan_bus(zdev);
if (rc)
@@ -869,6 +874,8 @@ int zpci_create_device(struct zpci_dev *zdev)
out_disable:
if (zdev->state == ZPCI_FN_STATE_ONLINE)
zpci_disable_device(zdev);
+out_destroy_iommu:
+ zpci_destroy_iommu(zdev);
out_free:
zpci_free_domain(zdev);
out: