]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
amd-iommu: disable IOMMU hardware on shutdown
authorJoerg Roedel <joerg.roedel@amd.com>
Tue, 9 Jun 2009 15:52:27 +0000 (17:52 +0200)
committerJoerg Roedel <joerg.roedel@amd.com>
Mon, 15 Jun 2009 13:20:40 +0000 (15:20 +0200)
When the IOMMU stays enabled the BIOS may not be able to finish the
machine shutdown properly. So disable the hardware on shutdown.

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

index 262e02820049aa8cc92dca18e83afdcbb829a71c..bdf96f119f069a8615067b33dc7e0a28fc133df2 100644 (file)
@@ -29,9 +29,11 @@ extern void amd_iommu_detect(void);
 extern irqreturn_t amd_iommu_int_handler(int irq, void *data);
 extern void amd_iommu_flush_all_domains(void);
 extern void amd_iommu_flush_all_devices(void);
+extern void amd_iommu_shutdown(void);
 #else
 static inline int amd_iommu_init(void) { return -ENODEV; }
 static inline void amd_iommu_detect(void) { }
+static inline void amd_iommu_shutdown(void) { }
 #endif
 
 #endif /* _ASM_X86_AMD_IOMMU_H */
index 238989ec077df9e0b669c2f2a65d8b820a833510..575ca46211bb54ad3fbeccf7b373f107683ee02f 100644 (file)
@@ -1273,6 +1273,11 @@ free:
        goto out;
 }
 
+void amd_iommu_shutdown(void)
+{
+       disable_iommus();
+}
+
 /****************************************************************************
  *
  * Early detect code. This code runs at IOMMU detection time in the DMA
index 745579bc825687cdb5855b9d5e7a7a6cbd042239..328592fb6044c6a5be8b607d56f6ff317f72bff2 100644 (file)
@@ -290,6 +290,8 @@ static int __init pci_iommu_init(void)
 void pci_iommu_shutdown(void)
 {
        gart_iommu_shutdown();
+
+       amd_iommu_shutdown();
 }
 /* Must execute after PCI subsystem */
 fs_initcall(pci_iommu_init);