]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86/amd-iommu: Fix PCI hotplug with passthrough mode
authorJoerg Roedel <joerg.roedel@amd.com>
Thu, 10 Dec 2009 10:12:25 +0000 (11:12 +0100)
committerJoerg Roedel <joerg.roedel@amd.com>
Thu, 10 Dec 2009 11:23:47 +0000 (12:23 +0100)
The device change notifier is initialized in the dma_ops
initialization path. But this path is never executed for
iommu=pt. Move the notifier initialization to IOMMU hardware
init code to fix this.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
arch/x86/include/asm/amd_iommu_proto.h
arch/x86/kernel/amd_iommu.c
arch/x86/kernel/amd_iommu_init.c

index 2566e2606224b38d43e4d34a2d7a1dead634f312..4d817f9e6e770b582e66b72788d31ebc091c766a 100644 (file)
@@ -30,6 +30,7 @@ extern void amd_iommu_apply_erratum_63(u16 devid);
 extern void amd_iommu_reset_cmd_buffer(struct amd_iommu *iommu);
 extern int amd_iommu_init_devices(void);
 extern void amd_iommu_uninit_devices(void);
+extern void amd_iommu_init_notifier(void);
 #ifndef CONFIG_AMD_IOMMU_STATS
 
 static inline void amd_iommu_stats_init(void) { }
index 450dd6ac03d35049944825fcbeda3dc4595f9eca..a83185080e912b3a9245e70b574a06fb9a24af57 100644 (file)
@@ -1624,6 +1624,11 @@ static struct notifier_block device_nb = {
        .notifier_call = device_change_notifier,
 };
 
+void amd_iommu_init_notifier(void)
+{
+       bus_register_notifier(&pci_bus_type, &device_nb);
+}
+
 /*****************************************************************************
  *
  * The next functions belong to the dma_ops mapping/unmapping code.
@@ -2250,8 +2255,6 @@ int __init amd_iommu_init_dma_ops(void)
 
        register_iommu(&amd_iommu_ops);
 
-       bus_register_notifier(&pci_bus_type, &device_nb);
-
        amd_iommu_stats_init();
 
        return 0;
index df01c691d130cb93e5982f4965182804ca8b9601..309a52f96e0bbe5e8c80543ceddbe480bea092c0 100644 (file)
@@ -1285,6 +1285,8 @@ static int __init amd_iommu_init(void)
        if (ret)
                goto free;
 
+       amd_iommu_init_notifier();
+
        enable_iommus();
 
        if (iommu_pass_through)