[RFC PATCH] iommu/arm-smmu-v3: Set CMDQ_PROD_OWNED_FLAG to bit 29
John Garry
john.garry at arm.com
Wed Nov 11 01:41:40 PST 2026
On 11/11/26 02:01, Sukadev Bhattiprolu wrote:
> From: Sukadev Bhattiprolu <sukadev at qti.qualcomm.com>
> Date: Mon, 9 Nov 2026 20:45:29 -0800
> Subject: [RFC PATCH] iommu/arm-smmu-v3: Set CMDQ_PROD_OWNED_FLAG to bit 29
>
> CMDQ_PROD_OWNED_FLAG is currently set to bit 31 but with support for
> ECMDQs in ARM SMMU spec v3.3, bit 31 is used for SMMU_ECMDQ_PROD.EN.
>
> Since CMDQ_PROD_OWNED_FLAG is only used by software, use bit 29 instead.
We only use bit31 for the software-maintained version of prod, and never
write that (bit) to the reg. Furthermore, we only ever read that reg for
the cmdq timeout and the value there is only used for diagnostic info.
So do you see a problem in continuing to use this scheme for ECMDQ and
DCMDQ support?
In previous patches posted to support ECMDQ, bit31 is just always
written when updating the ECMDQ prod register.
>
> Change-Id: Ia171b73ca7b012fc25a2a8f3d7e1dc71f4c2b528
> Signed-off-by: Sukadev Bhattiprolu <sukadev at qti.qualcomm.com>
>
> ---
> - Would it be safe to change the OWNED_FLAG to one of the RES0 bits in
> the SMMU_ECMDQ_PROD register (30:24)?
Since we now know what bit31 will be used for (and we think that it
would work ok for for ECMDQ and DCMDQ support), it seems risky to change
OWNER to a res bit.
>
> - https://lore.kernel.org/all/20260908171712.356645-11-praan@google.com/
> proposes using bit 30 for CMDQ_PROD_STOP_FLAG.
>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> index bb048e08d613..f79353582909 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> @@ -398,7 +398,7 @@ static inline unsigned int arm_smmu_cdtab_l2_idx(unsigned int ssid)
> #define CMDQ_ERR_CERROR_ABT_IDX 2
> #define CMDQ_ERR_CERROR_ATC_INV_IDX 3
>
> -#define CMDQ_PROD_OWNED_FLAG Q_OVERFLOW_FLAG
> +#define CMDQ_PROD_OWNED_FLAG (1U << 29)
>
> struct arm_smmu_cmd {
> u64 data[CMDQ_ENT_DWORDS];
More information about the linux-arm-kernel
mailing list