All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] intel-iommu: Disable DMA Remapping when intel_iommu=off
@ 2013-04-20  6:58 Wei Hu
       [not found] ` <1366441080-5937-1-git-send-email-wei-BGArkANP9klv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Wei Hu @ 2013-04-20  6:58 UTC (permalink / raw)
  To: David Woodhouse; +Cc: iommu, linux-kernel, Wei Hu

On a VT-d capable machine Linux will enable IOMMU by default. If it
then kexec's a second kernel with intel_iommu=off, this second kernel
will leave the DMA remapping engine on with no code handling it. The
symptom is at least USB and SATA drives stop working. This patch fixes
the problem by always disabling DMA remapping when intel_iommu=off.

Signed-off-by: Wei Hu <wei@aristanetworks.com>
---
 drivers/iommu/intel-iommu.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 0099667..0b8f8bb 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3681,8 +3681,12 @@ int __init intel_iommu_init(void)
 		return 	-ENODEV;
 	}
 
-	if (no_iommu || dmar_disabled)
+	if (no_iommu || dmar_disabled) {
+		struct dmar_drhd_unit *drhd;
+		for_each_drhd_unit(drhd)
+			iommu_disable_translation(drhd->iommu);
 		return -ENODEV;
+	}
 
 	if (iommu_init_mempool()) {
 		if (force_on)
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-04-22  7:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-20  6:58 [PATCH 1/1] intel-iommu: Disable DMA Remapping when intel_iommu=off Wei Hu
     [not found] ` <1366441080-5937-1-git-send-email-wei-BGArkANP9klv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2013-04-22  5:31   ` Takao Indoh
2013-04-22  5:31     ` Takao Indoh
2013-04-22  6:50     ` Wei Hu
     [not found]       ` <CANwcMEZF+ehPeFuucRqcKSiNNoXL6bDy+GTHBHYjr3DfoZY7vg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-22  7:06         ` Takao Indoh
2013-04-22  7:06           ` Takao Indoh
2013-04-22  7:11           ` Wei Hu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.