iommu/amd: Use dev_data->domain in get_domain()
Using the cached value is much more efficient than calling into the IOMMU core code. Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
parent
80187fd39d
commit
d26592a93d
@ -2215,16 +2215,11 @@ static void queue_add(struct dma_ops_domain *dma_dom,
|
|||||||
static struct protection_domain *get_domain(struct device *dev)
|
static struct protection_domain *get_domain(struct device *dev)
|
||||||
{
|
{
|
||||||
struct protection_domain *domain;
|
struct protection_domain *domain;
|
||||||
struct iommu_domain *io_domain;
|
|
||||||
|
|
||||||
if (!check_device(dev))
|
if (!check_device(dev))
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
|
|
||||||
io_domain = iommu_get_domain_for_dev(dev);
|
domain = get_dev_data(dev)->domain;
|
||||||
if (!io_domain)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
domain = to_pdomain(io_domain);
|
|
||||||
if (!dma_ops_domain(domain))
|
if (!dma_ops_domain(domain))
|
||||||
return ERR_PTR(-EBUSY);
|
return ERR_PTR(-EBUSY);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user