Re: [PATCH net-next v6 1/2] dt-bindings: net: qcom,bam-dmux: Add memory-region and qcom,vmid properties

From: netdev-bot+sashiko

Date: Mon Nov 16 2026 - 08:55:14 EST


Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 0 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] The series confines only the BAM-DMUX client's own DMA mappings
to the restricted-dma-pool.
- [Low] The patch adds the Shikra-specific compatible `qcom,shikra-bam-
dmux`, but the only placement the driver supports cannot pass schema…

--

dt-bindings: net: qcom,bam-dmux: Add memory-region and qcom,vmid properties

This patch adds optional memory-region and qcom,vmid properties to the
BAM-DMUX binding. With them, DMA mappings can be confined to a restricted
DMA pool that is shared with the modem through SCM. It also adds the
qcom,shikra-bam-dmux compatible, with qcom,bam-dmux as fallback, and
requires both new properties for it.

> diff --git a/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> index 33746c238513d..f7388d24c8612 100644
> --- a/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> +++ b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
> @@ -22,7 +22,11 @@ description: |
>
> properties:
> compatible:
> - const: qcom,bam-dmux
> + oneOf:
> + - const: qcom,bam-dmux
> + - items:
> + - const: qcom,shikra-bam-dmux
> + - const: qcom,bam-dmux

[Severity: Low]
Will a Shikra DT that uses this compatible pass dtbs_check?

The bam-dmux device is only created from a child of the PAS remoteproc
node:

drivers/remoteproc/qcom_q6v5_pas.c:qcom_pas_probe() {
...
node = of_get_compatible_child(pdev->dev.of_node, "qcom,bam-dmux");
pas->bam_dmux = of_platform_device_create(node, NULL, &pdev->dev);
...
}

So on Shikra the node has to sit under the qcom,shikra-mpss-pas node.

Documentation/devicetree/bindings/remoteproc/qcom,shikra-pas.yaml does not
define a bam-dmux child and ends with unevaluatedProperties: false. The
qcom,pas-common.yaml schema it references does not define one either.

Should the series also update the Shikra PAS binding to allow the
bam-dmux child node?

[ ... ]

> @@ -72,6 +76,22 @@ properties:
> - const: tx
> - const: rx
>
> + memory-region:
> + maxItems: 1
> + description:
> + Phandle to a reserved-memory node compatible with restricted-dma-pool.
> + The BAM-DMUX device uses the pool for DMA mappings.
> +
> + qcom,vmid:
> + $ref: /schemas/types.yaml#/definitions/uint32-array
> + maxItems: 1
> + items:
> + minimum: 1
> + maximum: 63
> + description:
> + VMID of the remote execution environment that is granted access to the
> + restricted DMA pool through SCM.
> +

[Severity: High]
Does this also cover the BAM descriptor FIFOs, or only the bam-dmux
buffers?

Only the bam-dmux node gets the restricted pool. qcom_bam_dmux.c maps the
skb buffers with dmux->dev, so only the payload buffers go through the
pool. The descriptor FIFO is allocated on the BAM DMA controller device
instead:

drivers/dma/qcom/bam_dma.c:bam_alloc_chan() {
...
bchan->fifo_virt = dma_alloc_wc(bdev->dev, BAM_DESC_FIFO_SIZE,
&bchan->fifo_phys, GFP_KERNEL);
...
}

That address is then programmed into the hardware:

drivers/dma/qcom/bam_dma.c:bam_chan_init_hw() {
...
writel_relaxed(ALIGN(bchan->fifo_phys, sizeof(struct bam_desc_hw)),
bam_addr(bdev, bchan->id, BAM_P_DESC_FIFO_ADDR));
...
}

The follow-up commit "net: wwan: qcom_bam_dmux: Assign restricted DMA pool
to remote processor" says "BAM-DMUX DMA mappings and BAM descriptor FIFOs
must therefore be constrained to a designated memory region", and that
accesses outside the region can trigger an XPU violation. It relies on
"When the BAM DMA controller references the same pool, its descriptor
FIFOs are covered by the assignment as well."

However, Documentation/devicetree/bindings/dma/qcom,bam-dma.yaml does not
define memory-region and has additionalProperties: false. The
dma-controller.yaml and dma-common.yaml schemas it references do not
define it either.

With a schema-valid Shikra DT, wouldn't bam_alloc_chan() allocate the
FIFO from ordinary memory outside the SCM-assigned region? The BAM
descriptor fetches would then land outside the shared region.

Should the series also extend qcom,bam-dma.yaml to accept memory-region?
It may also need to check how iommus interacts with
of_dma_set_restricted_buffer(). Failing that, could one of the bindings
document where the descriptor FIFO has to live?

[ ... ]

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112-qcom-bam-dmux-vmid-ext-v6-0-7a16bd3dff18%40oss.qualcomm.com