Skip to contentSkip to conversation

iommu/vt-d: fix bug in handling multiple RMRRs for the same PCI device

PATCH Applied Jiang Liu 2 participants 2 messages Jun 20, 2014

Subsystems (2)
lore
Share & tools
lore

Jiang Liu

author
#0 lore raw

PATCH 1/1 iommu/vt-d: fix bug in handling multiple RMRRs for the same PCI device

Function dmar_iommu_notify_scope_dev() makes a wrong assumption that there's one RMRR for each PCI device at most, which causes DMA failure on some HP platforms. So enhance dmar_iommu_notify_scope_dev() to handle multiple RMRRs for the same PCI device.

Fixbug: https://bugzilla.novell.com/show_bug.cgi?id=879482

---
 drivers/iommu/intel-iommu.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/iommu/intel-iommu.c +3 -6
index 6bb32773c3ac..51b6b77dc3e5 100644
@@ -3816,14 +3816,11 @@ int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info)
 				((void *)rmrr) + rmrr->header.length,
 				rmrr->segment, rmrru->devices,
 				rmrru->devices_cnt);
-			if (ret > 0)
-				break;
-			else if(ret < 0)
+			if(ret < 0)
 				return ret;
 		} else if (info->event == BUS_NOTIFY_DEL_DEVICE) {
-			if (dmar_remove_dev_scope(info, rmrr->segment,
-				rmrru->devices, rmrru->devices_cnt))
-				break;
+			dmar_remove_dev_scope(info, rmrr->segment,
+				rmrru->devices, rmrru->devices_cnt);
 		}
 	}
 
Signature · 1 line
1.7.10.4
maintainer Applied
#1 lore raw
Quoted 11 lines · Jiang Liu

Function dmar_iommu_notify_scope_dev() makes a wrong assumption that there's one RMRR for each PCI device at most, which causes DMA failure on some HP platforms. So enhance dmar_iommu_notify_scope_dev() to handle multiple RMRRs for the same PCI device.

Fixbug: https://bugzilla.novell.com/show_bug.cgi?id‡9482

Applied to iommu/fixes, thans Jiang.