Skip to content

Commit d550ddc

Browse files
jgunthorpewilldeacon
authored andcommitted
iommu/arm-smmu-v3: Pass smmu_domain to arm_enable/disable_ats()
The caller already has the domain, just pass it in. A following patch will remove master->domain. Tested-by: Shameer Kolothum <[email protected]> Tested-by: Nicolin Chen <[email protected]> Tested-by: Moritz Fischer <[email protected]> Reviewed-by: Nicolin Chen <[email protected]> Reviewed-by: Mostafa Saleh <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent d2e053d commit d550ddc

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2421,12 +2421,12 @@ static bool arm_smmu_ats_supported(struct arm_smmu_master *master)
24212421
return dev_is_pci(dev) && pci_ats_supported(to_pci_dev(dev));
24222422
}
24232423

2424-
static void arm_smmu_enable_ats(struct arm_smmu_master *master)
2424+
static void arm_smmu_enable_ats(struct arm_smmu_master *master,
2425+
struct arm_smmu_domain *smmu_domain)
24252426
{
24262427
size_t stu;
24272428
struct pci_dev *pdev;
24282429
struct arm_smmu_device *smmu = master->smmu;
2429-
struct arm_smmu_domain *smmu_domain = master->domain;
24302430

24312431
/* Don't enable ATS at the endpoint if it's not enabled in the STE */
24322432
if (!master->ats_enabled)
@@ -2442,10 +2442,9 @@ static void arm_smmu_enable_ats(struct arm_smmu_master *master)
24422442
dev_err(master->dev, "Failed to enable ATS (STU %zu)\n", stu);
24432443
}
24442444

2445-
static void arm_smmu_disable_ats(struct arm_smmu_master *master)
2445+
static void arm_smmu_disable_ats(struct arm_smmu_master *master,
2446+
struct arm_smmu_domain *smmu_domain)
24462447
{
2447-
struct arm_smmu_domain *smmu_domain = master->domain;
2448-
24492448
if (!master->ats_enabled)
24502449
return;
24512450

@@ -2514,7 +2513,7 @@ static void arm_smmu_detach_dev(struct arm_smmu_master *master)
25142513
if (!smmu_domain)
25152514
return;
25162515

2517-
arm_smmu_disable_ats(master);
2516+
arm_smmu_disable_ats(master, smmu_domain);
25182517

25192518
spin_lock_irqsave(&smmu_domain->devices_lock, flags);
25202519
list_del(&master->domain_head);
@@ -2636,7 +2635,7 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
26362635
break;
26372636
}
26382637

2639-
arm_smmu_enable_ats(master);
2638+
arm_smmu_enable_ats(master, smmu_domain);
26402639
goto out_unlock;
26412640

26422641
out_list_del:

0 commit comments

Comments
 (0)