From: Joerg Roedel <joerg.roedel@amd.com>
To: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Cc: Chris Wright <chrisw@sous-sol.org>,
Chris Wright <chrisw@redhat.com>,
Joerg Roedel <joerg.roedel@amd.com>
Subject: [PATCH 4/4] amd iommu: properly detach from protection domain on ->remove
Date: Fri, 22 May 2009 14:06:31 +0200 [thread overview]
Message-ID: <1242993991-28613-5-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1242993991-28613-1-git-send-email-joerg.roedel@amd.com>
From: Chris Wright <chrisw@sous-sol.org>
[ impact: bugfix ]
Some drivers may use the dma api during ->remove which will
cause a protection domain to get reattached to a device. Delay the
detach until after the driver is completely unbound.
[ joro: added a little merge helper ]
Signed-off-by: Chris Wright <chrisw@redhat.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
arch/x86/kernel/amd_iommu.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index a97db99..d689883 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -57,6 +57,10 @@ static int dma_ops_unity_map(struct dma_ops_domain *dma_dom,
static struct dma_ops_domain *find_protection_domain(u16 devid);
+#ifndef BUS_NOTIFY_UNBOUND_DRIVER
+#define BUS_NOTIFY_UNBOUND_DRIVER 0x0005
+#endif
+
#ifdef CONFIG_AMD_IOMMU_STATS
/*
@@ -1012,7 +1016,7 @@ static int device_change_notifier(struct notifier_block *nb,
printk(KERN_INFO "AMD IOMMU: Using protection domain %d for "
"device %s\n", dma_domain->domain.id, dev_name(dev));
break;
- case BUS_NOTIFY_UNBIND_DRIVER:
+ case BUS_NOTIFY_UNBOUND_DRIVER:
if (!domain)
goto out;
detach_device(domain, devid);
--
1.6.3.1
prev parent reply other threads:[~2009-05-22 12:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-22 12:06 [PATCH 0/4] amd-iommu fixes for 2.6.31 Joerg Roedel
2009-05-22 12:06 ` [PATCH 1/4] amd-iommu: fix an off-by-one error in the AMD IOMMU driver Joerg Roedel
2009-05-22 12:06 ` [PATCH 2/4] amd-iommu: fix the handling of device aliases " Joerg Roedel
2009-05-22 12:06 ` [PATCH 3/4] amd-iommu: make sure only ivmd entries are parsed Joerg Roedel
2009-05-22 12:06 ` Joerg Roedel [this message]
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=1242993991-28613-5-git-send-email-joerg.roedel@amd.com \
--to=joerg.roedel@amd.com \
--cc=chrisw@redhat.com \
--cc=chrisw@sous-sol.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
all inboxes | Powered by JetHome®