From: Wei Hu <wei@aristanetworks.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
Wei Hu <wei@aristanetworks.com>
Subject: [PATCH 1/1] intel-iommu: Disable DMA Remapping when intel_iommu=off
Date: Fri, 19 Apr 2013 23:58:00 -0700 [thread overview]
Message-ID: <1366441080-5937-1-git-send-email-wei@aristanetworks.com> (raw)
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
next reply other threads:[~2013-04-20 6:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-20 6:58 Wei Hu [this message]
2013-04-22 5:31 ` [PATCH 1/1] intel-iommu: Disable DMA Remapping when intel_iommu=off Takao Indoh
2013-04-22 6:50 ` Wei Hu
2013-04-22 7:06 ` Takao Indoh
2013-04-22 7:11 ` Wei Hu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1366441080-5937-1-git-send-email-wei@aristanetworks.com \
--to=wei@aristanetworks.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox