[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1432831305-11126-16-git-send-email-joro@8bytes.org>
Date: Thu, 28 May 2015 18:41:38 +0200
From: Joerg Roedel <joro@...tes.org>
To: iommu@...ts.linux-foundation.org
Cc: Will Deacon <will.deacon@....com>, Kukjin Kim <kgene@...nel.org>,
David Woodhouse <dwmw2@...radead.org>,
Heiko Stuebner <heiko@...ech.de>,
Hiroshi Doyu <hdoyu@...dia.com>,
Thierry Reding <thierry.reding@...il.com>,
Alex Williamson <alex.williamson@...hat.com>,
Robin Murphy <robin.murphy@....com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Oded Gabbay <oded.gabbay@...il.com>, joro@...tes.org,
jroedel@...e.de, linux-kernel@...r.kernel.org
Subject: [PATCH 15/22] iommu/amd: Use default domain if available for DMA-API
From: Joerg Roedel <jroedel@...e.de>
Signed-off-by: Joerg Roedel <jroedel@...e.de>
---
drivers/iommu/amd_iommu.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 9da3f0e..dc8e44b 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2495,12 +2495,19 @@ void amd_iommu_init_notifier(void)
static struct protection_domain *get_domain(struct device *dev)
{
struct protection_domain *domain;
+ struct iommu_domain *io_domain;
struct dma_ops_domain *dma_dom;
u16 devid = get_device_id(dev);
if (!check_device(dev))
return ERR_PTR(-EINVAL);
+ io_domain = iommu_get_domain_for_dev(dev);
+ if (io_domain) {
+ domain = to_pdomain(io_domain);
+ return domain;
+ }
+
domain = domain_for_device(dev);
if (domain != NULL && !dma_ops_domain(domain))
return ERR_PTR(-EBUSY);
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists