Skip to content

Commit edd0351

Browse files
jpbruckerwilldeacon
authored andcommitted
iommu/arm-smmu-v3: Batch context descriptor invalidation
Rather than publishing one command at a time when invalidating a context descriptor, batch the commands for all SIDs in the domain. Signed-off-by: Jean-Philippe Brucker <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 4ce8da4 commit edd0351

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/iommu/arm-smmu-v3.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,7 @@ static void arm_smmu_sync_cd(struct arm_smmu_domain *smmu_domain,
15121512
size_t i;
15131513
unsigned long flags;
15141514
struct arm_smmu_master *master;
1515+
struct arm_smmu_cmdq_batch cmds = {};
15151516
struct arm_smmu_device *smmu = smmu_domain->smmu;
15161517
struct arm_smmu_cmdq_ent cmd = {
15171518
.opcode = CMDQ_OP_CFGI_CD,
@@ -1525,12 +1526,12 @@ static void arm_smmu_sync_cd(struct arm_smmu_domain *smmu_domain,
15251526
list_for_each_entry(master, &smmu_domain->devices, domain_head) {
15261527
for (i = 0; i < master->num_sids; i++) {
15271528
cmd.cfgi.sid = master->sids[i];
1528-
arm_smmu_cmdq_issue_cmd(smmu, &cmd);
1529+
arm_smmu_cmdq_batch_add(smmu, &cmds, &cmd);
15291530
}
15301531
}
15311532
spin_unlock_irqrestore(&smmu_domain->devices_lock, flags);
15321533

1533-
arm_smmu_cmdq_issue_sync(smmu);
1534+
arm_smmu_cmdq_batch_submit(smmu, &cmds);
15341535
}
15351536

15361537
static int arm_smmu_alloc_cd_leaf_table(struct arm_smmu_device *smmu,

0 commit comments

Comments
 (0)