From: Joerg Roedel <jroedel@suse.de>
Date: Tue, 30 Sep 2014 11:02:03 +0000 (+0200)
Subject: iommu/vt-d: Only remove domain when device is removed
X-Git-Tag: iommu-updates-v3.18^5~2
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1196c2f;p=users%2Fdwmw2%2Flinux.git

iommu/vt-d: Only remove domain when device is removed

This makes sure any RMRR mappings stay in place when the
driver is unbound from the device.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Tested-by: Jerry Hoemann <jerry.hoemann@hp.com>
---

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index d1f5caad04f99..eaf825ac7d28f 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3865,8 +3865,7 @@ static int device_notifier(struct notifier_block *nb,
 	if (iommu_dummy(dev))
 		return 0;
 
-	if (action != BUS_NOTIFY_UNBOUND_DRIVER &&
-	    action != BUS_NOTIFY_DEL_DEVICE)
+	if (action != BUS_NOTIFY_REMOVED_DEVICE)
 		return 0;
 
 	domain = find_domain(dev);