Thread (42 messages) 42 messages, 6 authors, 10h ago

Re: [PATCH v11 03/16] iommu/arm-smmu-v3: Add arm_smmu_drain_queue() helper

flat view

From: Nicolin Chen <hidden>
Date: 2026-09-30 18:24:58
Also in: driver-core, linux-iommu, linux-pci, lkml

On Tue, Sep 29, 2026 at 03:44:57AM +0000, Pranjal Shrivastava wrote:
quoted hunk ↗ jump to hunk
+/**
+ * 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/ (local)

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help