From: Weidong Han Date: Mon, 8 Dec 2008 03:24:12 +0000 (+0800) Subject: Get iommu from g_iommus for deferred flush X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a2bb8459fe46e5aaad6637b31b5593d740097cba;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git Get iommu from g_iommus for deferred flush deferred_flush[] uses the iommu seq_id to index, so its iommu is fixed and can get it from g_iommus. Signed-off-by: Weidong Han Signed-off-by: Joerg Roedel --- diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index d2ffa7a6d723..86b9f58a645e 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c @@ -2101,10 +2101,11 @@ static void flush_unmaps(void) /* just flush them all */ for (i = 0; i < g_num_of_iommus; i++) { - if (deferred_flush[i].next) { - struct intel_iommu *iommu = - deferred_flush[i].domain[0]->iommu; + struct intel_iommu *iommu = g_iommus[i]; + if (!iommu) + continue; + if (deferred_flush[i].next) { iommu->flush.flush_iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH, 0); for (j = 0; j < deferred_flush[i].next; j++) {