Subject: Re: [PATCH v7 02/11] iommu/arm-smmu-v3: Add a helper to drain cmd queues

From: Pranjal Shrivastava <[email-masked]>
Date: Thu, 28 May 2026 10:34:42 +0000

On Wed, May 27, 2026 at 06:35:56PM -0700, Nicolin Chen wrote:
> On Wed, May 27, 2026 at 10:13:58PM +0000, Pranjal Shrivastava wrote:
> > +static int arm_smmu_drain_queues(struct arm_smmu_device *smmu)
> 
> So, this function has a very generic name for queues but its use
> case is limited to cmdq in a suspend context, and might not work
> for other queues.
> 
> I am adding another helper for in-flight evetq and priq:
>  - Drain a queue for a detaching master; other attached masters
>    might still advance the prod, so queue wouldn't be empty.
>  - evtq and priq sets wfe=false.
> 
> So, there is a naming conflict here.
> 
> Maybe:
>   arm_smmu_drain_queue_for_cmdq()
>   arm_smmu_drain_queue_for_iopf()
> ?

Ack. Sorry about that, the earlier versions were draining the other
queues too but that has changed from the last few versions.

I'm planning to rename it to arm_smmu_drain_cmdq(), sounds good?

Thanks,
Praan