iommu/arm-smmu-v3: Add and use static helper function arm_smmu_get_cmdq()
authorZhen Lei <thunder.leizhen@huawei.com>
Wed, 11 Aug 2021 11:48:51 +0000 (19:48 +0800)
committerWill Deacon <will@kernel.org>
Fri, 13 Aug 2021 13:19:41 +0000 (14:19 +0100)
commit8639cc83aac5dd1a197ed05b8f717acc35bb0248
tree4b020509578f18803c8d13f864bcd431ab860377
parent4537f6f1e2d8d22ec6f9c6bd3844fdccb931f46e
iommu/arm-smmu-v3: Add and use static helper function arm_smmu_get_cmdq()

One SMMU has only one normal CMDQ. Therefore, this CMDQ is used regardless
of the core on which the command is inserted. It can be referenced
directly through "smmu->cmdq". However, one SMMU has multiple ECMDQs, and
the ECMDQ used by the core on which the command insertion is executed may
be different. So the helper function arm_smmu_get_cmdq() is added, which
returns the CMDQ/ECMDQ that the current core should use. Currently, the
code that supports ECMDQ is not added. just simply returns "&smmu->cmdq".

Many subfunctions of arm_smmu_cmdq_issue_cmdlist() use "&smmu->cmdq" or
"&smmu->cmdq.q" directly. To support ECMDQ, they need to call the newly
added function arm_smmu_get_cmdq() instead.

Note that normal CMDQ is still required until ECMDQ is available.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20210811114852.2429-4-thunder.leizhen@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c