[PATCH v9 08/12] iommu/tegra241-cmdqv: Add a helper to quiesce VCMDQs
Pranjal Shrivastava
praan at google.com
Tue Aug 25 11:46:27 PDT 2026
On Tue, Aug 25, 2026 at 01:36:11PM -0300, Jason Gunthorpe wrote:
> > [ ... 73 lines skipped ... ]
> > @@ -467,6 +487,14 @@ static int tegra241_cmdqv_drain_vintf0_lvcmdqs(struct arm_smmu_device *smmu)
> > if (!READ_ONCE(vintf->enabled))
> > return 0;
> >
> > + /*
> > + * Gate all vCMDQs by setting the STOP_FLAG in a separate,
> > + * initial loop to ensure no new commands can be submitted
> > + * to any secondary queue while we are waiting to drain them.
> > + */
> > + tegra241_cmdqv_quiesce_vintf0_lvcmdqs(smmu);
> > +
> > + /* Now that all queues are safely gated, drain them sequentially. */
> > for (lidx = 0; lidx < cmdqv->num_lvcmdqs_per_vintf; lidx++) {
> > struct tegra241_vcmdq *vcmdq = vintf->lvcmdqs[lidx];
> >
>
> [Severity: High]
> If arm_smmu_queue_poll_until_empty() fails during this sequential drain, it
> returns an error without clearing the CMDQ_PROD_STOP_FLAG that was just set on
> all queues:
>
> Make sense to me, the earlier patch added:
>
> ret = arm_smmu_queue_poll_until_empty(smmu, &vcmdq->cmdq.q);
> if (ret)
> break;
>
Yes, I plan to treat this the same as the primary CMDQ and move on
instead of break; I'll address this in v10.
Thanks,
Praan
More information about the linux-arm-kernel
mailing list