[PATCH v8 09/12] iommu/arm-smmu-v3: Implement pm_runtime & system sleep ops
Daniel Mentz
danielmentz at google.com
Tue Jun 2 08:27:22 PDT 2026
On Mon, Jun 1, 2026 at 2:59 PM Pranjal Shrivastava <praan at google.com> wrote:
> +static inline u32 arm_smmu_cmdq_owner_prod_idx(struct arm_smmu_cmdq *cmdq)
> +{
> + return atomic_read(&cmdq->owner_prod) & CMDQ_PROD_IDX_MASK;
Is this masking necessary? Can't we just use
atomic_read(&cmdq->owner_prod) as is? The only place in
arm_smmu_cmdq_issue_cmdlist() that writes to cmdq->owner_prod already
applied CMDQ_PROD_IDX_MASK.
> +}
> +
> @@ -4839,6 +4876,10 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu)
> return ret;
> }
>
> + /* Clear any flags from the previous life */
> + atomic_andnot(CMDQ_PROD_STOP_FLAG, &smmu->cmdq.owner_prod);
Same. I believe CMDQ_PROD_STOP_FLAG will never be set in
smmu->cmdq.owner_prod. Hence, clearing it shouldn't be necessary.
> + atomic_andnot(CMDQ_PROD_STOP_FLAG, &smmu->cmdq.q.llq.atomic.prod);
> +
> /* Invalidate any cached configuration */
> arm_smmu_cmdq_issue_cmd_with_sync(smmu, arm_smmu_make_cmd_cfgi_all());
>
> @@ -4898,6 +4939,21 @@ static int arm_smmu_device_reset(struct arm_smmu_device *smmu)
More information about the linux-arm-kernel
mailing list