[PATCH v7 07/11] iommu/arm-smmu-v3: Add CMDQ_PROD_STOP_FLAG to gate CMDQ submissions
Nicolin Chen
nicolinc at nvidia.com
Thu May 28 12:41:35 PDT 2026
On Wed, May 27, 2026 at 10:14:03PM +0000, Pranjal Shrivastava wrote:
> Introduce a new bit flag, CMDQ_PROD_STOP_FLAG (bit 30), in the command
> queue's producer index to safely gate command submissions during device
> suspension.
>
> The flag embeds the suspend state directly into the existing global state
> The flag checked in the compxchg loop in arm_smmu_cmdq_issue_cmdlist(),
s/compxchg/cmpxchg
> which acts as a Point of Commitment, ensuring that no indices are
> reserved or committed once the SMMU begins suspending.
>
> This prevents a situation of "abandoned batches" where indices are
> incremented but commands are never written, which would otherwise
> lead to timeout during the drain poll.
>
> Update queue_inc_prod_n() to preserve this flag during index
> calculations, ensuring that any in-flight commands that successfully
> passed the point of commitment can proceed to completion while the
> flag remains set.
>
> Suggested-by: Daniel Mentz <danielmentz at google.com>
> Signed-off-by: Pranjal Shrivastava <praan at google.com>
Reviewed-by: Nicolin Chen <nicolinc at nvidia.com>
More information about the linux-arm-kernel
mailing list