[PATCH v8 02/12] iommu/arm-smmu-v3: Add a helper to drain cmd queues
Daniel Mentz
danielmentz at google.com
Mon Jun 1 22:21:45 PDT 2026
On Mon, Jun 1, 2026 at 2:59 PM Pranjal Shrivastava <praan at google.com> wrote:
> +static int arm_smmu_drain_queues(struct arm_smmu_device *smmu)
> +{
> + int ret;
> +
> + /*
> + * Since this is only called from the suspend callback where
> + * exclusive access is ensured as CMDQ_PROD_STOP_FLAG blocks new
> + * command submissions to the cmdq, we can skip the cmdq locking.
> + */
>From what I understand, the purpose of this lock is to ensure that
only one thread updates smmu->cmdq.q.cons. The flag
CMDQ_PROD_STOP_FLAG might block new threads from submitting commands
to the command queue. However, other threads might have already passed
that point and are about to update smmu->cmdq.q.cons. Hence, this
assumption might not be safe.
> + ret = arm_smmu_queue_poll_until_empty(smmu, &smmu->cmdq.q);
> +
> + return ret;
> +}
More information about the linux-arm-kernel
mailing list