Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754547AbbFKNsZ (ORCPT ); Thu, 11 Jun 2015 09:48:25 -0400 Received: from 8bytes.org ([81.169.241.247]:39758 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752955AbbFKNrw (ORCPT ); Thu, 11 Jun 2015 09:47:52 -0400 From: Joerg Roedel To: iommu@lists.linux-foundation.org Cc: David Woodhouse , zhen-hual@hp.com, bhe@redhat.com, linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH 3/4] iommu/vt-d: Remove unmap_device_dma() Date: Thu, 11 Jun 2015 15:47:42 +0200 Message-Id: <1434030463-942-4-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434030463-942-1-git-send-email-joro@8bytes.org> References: <1434030463-942-1-git-send-email-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2766 Lines: 92 From: Joerg Roedel This removes the unmap_device_dma() function and the code-path calling it. That code looks like a left-over from Bill Sumners patch-set, as it only makes sense when kdump recovery is implemented like in his original patch-set. With the way it is implemented now this code doesn't make sense at all and can be removed. Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index f50d065..fcb9310 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -400,9 +400,6 @@ static LIST_HEAD(__iommu_remapped_mem); */ static int intel_iommu_load_translation_tables(struct intel_iommu *iommu); -static void unmap_device_dma(struct dmar_domain *domain, - struct device *dev, - struct intel_iommu *iommu); static void iommu_check_pre_te_status(struct intel_iommu *iommu); static u8 g_translation_pre_enabled; @@ -3120,25 +3117,6 @@ static struct dmar_domain *__get_valid_domain_for_dev(struct device *dev) return NULL; } - /* if in kdump kernel, we need to unmap the mapped dma pages, - * detach this device first. - */ - if (likely(domain_context_mapped(dev))) { - iommu = domain_get_iommu(domain); - if (iommu->pre_enabled_trans) { - unmap_device_dma(domain, dev, iommu); - - domain = get_domain_for_dev(dev, - DEFAULT_DOMAIN_ADDRESS_WIDTH); - if (!domain) { - pr_err("Allocating domain for %s failed", - dev_name(dev)); - return NULL; - } - } else - return domain; - } - ret = domain_context_mapping(domain, dev, CONTEXT_TT_MULTI_LEVEL); if (ret) { pr_err("Domain context map for %s failed", @@ -5063,28 +5041,6 @@ out_unmap: return ret; } -static void unmap_device_dma(struct dmar_domain *domain, - struct device *dev, - struct intel_iommu *iommu) -{ - struct context_entry *ce; - struct iova *iova; - phys_addr_t phys_addr; - dma_addr_t dev_addr; - struct pci_dev *pdev; - - pdev = to_pci_dev(dev); - ce = iommu_context_addr(iommu, pdev->bus->number, pdev->devfn, 1); - phys_addr = context_address_root(ce) << VTD_PAGE_SHIFT; - dev_addr = phys_to_dma(dev, phys_addr); - - iova = find_iova(&domain->iovad, IOVA_PFN(dev_addr)); - if (iova) - intel_unmap(dev, dev_addr); - - domain_remove_one_dev_info(domain, dev); -} - static void iommu_check_pre_te_status(struct intel_iommu *iommu) { u32 sts; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/