diff options
-rw-r--r-- | arch/x86/include/asm/amd_iommu_proto.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/amd_iommu_init.c | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/include/asm/amd_iommu_proto.h b/arch/x86/include/asm/amd_iommu_proto.h index 2566e2606224..4d817f9e6e77 100644 --- a/arch/x86/include/asm/amd_iommu_proto.h +++ b/arch/x86/include/asm/amd_iommu_proto.h | |||
@@ -30,6 +30,7 @@ extern void amd_iommu_apply_erratum_63(u16 devid); | |||
30 | extern void amd_iommu_reset_cmd_buffer(struct amd_iommu *iommu); | 30 | extern void amd_iommu_reset_cmd_buffer(struct amd_iommu *iommu); |
31 | extern int amd_iommu_init_devices(void); | 31 | extern int amd_iommu_init_devices(void); |
32 | extern void amd_iommu_uninit_devices(void); | 32 | extern void amd_iommu_uninit_devices(void); |
33 | extern void amd_iommu_init_notifier(void); | ||
33 | #ifndef CONFIG_AMD_IOMMU_STATS | 34 | #ifndef CONFIG_AMD_IOMMU_STATS |
34 | 35 | ||
35 | static inline void amd_iommu_stats_init(void) { } | 36 | static inline void amd_iommu_stats_init(void) { } |
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 450dd6ac03d3..a83185080e91 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -1624,6 +1624,11 @@ static struct notifier_block device_nb = { | |||
1624 | .notifier_call = device_change_notifier, | 1624 | .notifier_call = device_change_notifier, |
1625 | }; | 1625 | }; |
1626 | 1626 | ||
1627 | void amd_iommu_init_notifier(void) | ||
1628 | { | ||
1629 | bus_register_notifier(&pci_bus_type, &device_nb); | ||
1630 | } | ||
1631 | |||
1627 | /***************************************************************************** | 1632 | /***************************************************************************** |
1628 | * | 1633 | * |
1629 | * The next functions belong to the dma_ops mapping/unmapping code. | 1634 | * The next functions belong to the dma_ops mapping/unmapping code. |
@@ -2250,8 +2255,6 @@ int __init amd_iommu_init_dma_ops(void) | |||
2250 | 2255 | ||
2251 | register_iommu(&amd_iommu_ops); | 2256 | register_iommu(&amd_iommu_ops); |
2252 | 2257 | ||
2253 | bus_register_notifier(&pci_bus_type, &device_nb); | ||
2254 | |||
2255 | amd_iommu_stats_init(); | 2258 | amd_iommu_stats_init(); |
2256 | 2259 | ||
2257 | return 0; | 2260 | return 0; |
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index df01c691d130..309a52f96e0b 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -1285,6 +1285,8 @@ static int __init amd_iommu_init(void) | |||
1285 | if (ret) | 1285 | if (ret) |
1286 | goto free; | 1286 | goto free; |
1287 | 1287 | ||
1288 | amd_iommu_init_notifier(); | ||
1289 | |||
1288 | enable_iommus(); | 1290 | enable_iommus(); |
1289 | 1291 | ||
1290 | if (iommu_pass_through) | 1292 | if (iommu_pass_through) |