Re: [PATCH v11 03/16] iommu/arm-smmu-v3: Add arm_smmu_drain_queue() helper
From: Nicolin Chen
Date: Wed Sep 30 2026 - 17:22:04 EST
On Tue, Sep 29, 2026 at 03:44:57AM +0000, Pranjal Shrivastava wrote:
> +/**
> + * arm_smmu_drain_queue - Drain an SMMU queue
> + * @smmu: the SMMU device
> + * @q: the queue to drain
> + * @until_empty: target selection
> + *
> + * With @until_empty == true (for CMDQ), exit once the queue is observed empty:
> + *
> + * cons0 cons prod
> + * | | |
> + * ---+###################+=====================+=============+--->
> + * |<--------- undrained==0? --------->|
Jason gave some remarks against this API:
https://lore.kernel.org/linux-iommu/179018862538.3334538.17643821143626392419.b4-review@b4/
So, my PRI series would drop this patch. I suspect that it still
has some value for the RPM/CMDQ case, compared to a busy-waiting
alternative. Yet, it probably should be simplified for CMDQ case
only.
In RPM case, the "prod" would be fixed/stable right? IOW, there
should be no new commands added to the cmdq, so it only needs to
wait for cons == prod?
Nicolin