linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	iommu@lists.linux-foundation.org, will@kernel.org,
	bhelgaas@google.com
Cc: joro@8bytes.org, robin.murphy@arm.com,
	jonathan.cameron@huawei.com, zhangfei.gao@linaro.org,
	robh@kernel.org
Subject: [PATCH v2 5/6] iommu/arm-smmu-v3: Batch context descriptor invalidation
Date: Mon, 24 Feb 2020 17:58:45 +0100	[thread overview]
Message-ID: <20200224165846.345993-6-jean-philippe@linaro.org> (raw)
In-Reply-To: <20200224165846.345993-1-jean-philippe@linaro.org>

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 <jean-philippe@linaro.org>
---
 drivers/iommu/arm-smmu-v3.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index beeec366bc41..12b2a0fa747e 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1512,6 +1512,7 @@ static void arm_smmu_sync_cd(struct arm_smmu_domain *smmu_domain,
 	size_t i;
 	unsigned long flags;
 	struct arm_smmu_master *master;
+	struct arm_smmu_cmdq_batch cmds = {};
 	struct arm_smmu_device *smmu = smmu_domain->smmu;
 	struct arm_smmu_cmdq_ent cmd = {
 		.opcode	= CMDQ_OP_CFGI_CD,
@@ -1525,12 +1526,12 @@ static void arm_smmu_sync_cd(struct arm_smmu_domain *smmu_domain,
 	list_for_each_entry(master, &smmu_domain->devices, domain_head) {
 		for (i = 0; i < master->num_sids; i++) {
 			cmd.cfgi.sid = master->sids[i];
-			arm_smmu_cmdq_issue_cmd(smmu, &cmd);
+			arm_smmu_cmdq_batch_add(smmu, &cmds, &cmd);
 		}
 	}
 	spin_unlock_irqrestore(&smmu_domain->devices_lock, flags);
 
-	arm_smmu_cmdq_issue_sync(smmu);
+	arm_smmu_cmdq_batch_submit(smmu, &cmds);
 }
 
 static int arm_smmu_alloc_cd_leaf_table(struct arm_smmu_device *smmu,
-- 
2.25.0


  parent reply	other threads:[~2020-02-24 16:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24 16:58 [PATCH v2 0/6] iommu/arm-smmu-v3: Finish PASID support and command queue batching Jean-Philippe Brucker
2020-02-24 16:58 ` [PATCH v2 1/6] PCI/ATS: Export symbols of PASID functions Jean-Philippe Brucker
2020-03-18 18:36   ` Bjorn Helgaas
2020-03-18 21:12     ` Will Deacon
2020-02-24 16:58 ` [PATCH v2 2/6] iommu/arm-smmu-v3: Add support for PCI PASID Jean-Philippe Brucker
2020-02-24 16:58 ` [PATCH v2 3/6] iommu/arm-smmu-v3: Write level-1 descriptors atomically Jean-Philippe Brucker
2020-02-24 16:58 ` [PATCH v2 4/6] iommu/arm-smmu-v3: Add command queue batching helpers Jean-Philippe Brucker
2020-02-24 16:58 ` Jean-Philippe Brucker [this message]
2020-02-24 16:58 ` [PATCH v2 6/6] iommu/arm-smmu-v3: Batch ATC invalidation commands Jean-Philippe Brucker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200224165846.345993-6-jean-philippe@linaro.org \
    --to=jean-philippe@linaro.org \
    --cc=bhelgaas@google.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jonathan.cameron@huawei.com \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    --cc=zhangfei.gao@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).