Thread View: linux.kernel.netdev
5 messages
5 total messages
Started by Vishnu Santhosh
Thu, 12 Nov 2026 09:13
[PATCH net-next v6 0/2] net: wwan: qcom_bam_dmux: Add restricted DMA pool support
Author: Vishnu Santhosh
Date: Thu, 12 Nov 2026 09:13
Date: Thu, 12 Nov 2026 09:13
79 lines
19493 bytes
19493 bytes
Some Qualcomm SoCs, such as Shikra, run the modem in a separate security
domain with restricted access to system memory. BAM-DMUX DMA mappings
and BAM descriptor FIFOs must therefore be constrained to a designated
memory region that can be shared with the modem. Accesses outside that
region can trigger an XPU violation.
Add memory-region and qcom,vmid properties to the BAM-DMUX binding, and
a qcom,shikra-bam-dmux compatible that requires them. When qcom,vmid is
present, the driver SCM-assigns the entire restricted DMA pool to the
local and remote execution environments before requesting the DMA
channels.
The restricted pool then contains the BAM-DMUX mappings. When the BAM DMA
controller references the same pool, its descriptor FIFOs are covered by
the assignment as well.
A related binding change allows the BAM DMA controller to use the same
restricted pool for descriptor FIFO allocations:
https://lore.kernel.org/all/20261021-qcom-bam-dma-vmid-ext-v3-1-299355e8dd3b@oss.qualcomm.com/
("dt-bindings: dma: qcom,bam-dma: Allow memory-region property")
Signed-off-by: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
---
Changes in v6:
- Request the PC IRQ disabled and enable it at the end of probe, instead
of reusing remove() on late probe failure (Loic)
- Link to v5: https://lore.kernel.org/r/20261105-qcom-bam-dmux-vmid-ext-v5-0-5c7903385b4b@oss.qualcomm.com
Changes in v5:
- Drop the redundant restricted-dma-pool compatible check, since
is_swiotlb_for_alloc() already covers it (Loic)
- Link to v4: https://lore.kernel.org/r/20261103-qcom-bam-dmux-vmid-ext-v4-0-3690cc5ca0fd@oss.qualcomm.com
Changes in v4:
- Decide the pool reclaim on the remote power vote after disabling the
PC IRQ (Sashiko)
- Link to v3: https://lore.kernel.org/r/20261021-qcom-bam-dmux-vmid-ext-v3-0-cedd1f681102@oss.qualcomm.com
Changes in v3:
- dt-bindings: Add qcom,shikra-bam-dmux, with qcom,bam-dmux as fallback,
and require memory-region and qcom,vmid for it (Krzysztof)
- dt-bindings: Drop minItems from qcom,vmid (Krzysztof)
- dt-bindings: Drop the example changes (Krzysztof)
- dt-bindings: Drop the statement about the local VMID from the
qcom,vmid description (Sashiko)
- Reuse remove() on late probe failure, since the PC IRQ may already
have powered up the RX path (Sashiko)
- Skip the pool reclaim when the remote did not acknowledge the
power-down (Sashiko)
- Fail probe if the restricted pool is not attached to the device
(Sashiko)
- Link to v2: https://lore.kernel.org/r/20260920-qcom-bam-dmux-vmid-ext-v2-0-ef5ca2178378@oss.qualcomm.com
Changes in v2:
- Replace the Shikra-specific compatible and coherent RX allocation with
memory-region and qcom,vmid properties.
- Use a restricted DMA pool for BAM-DMUX mappings and BAM descriptor FIFOs.
- SCM-assign the complete pool before requesting the DMA channels.
- Validate the remote VMID and restricted DMA pool configuration.
- Link to v1: https://lore.kernel.org/r/20260714-qcom-bam-dmux-vmid-ext-v1-0-3f29da7cca76@oss.qualcomm.com
---
Vishnu Santhosh (2):
dt-bindings: net: qcom,bam-dmux: Add memory-region and qcom,vmid properties
net: wwan: qcom_bam_dmux: Assign restricted DMA pool to remote processor
.../devicetree/bindings/net/qcom,bam-dmux.yaml | 36 ++++++-
drivers/net/wwan/Kconfig | 1 +
drivers/net/wwan/qcom_bam_dmux.c | 103 ++++++++++++++++++++-
3 files changed, 138 insertions(+), 2 deletions(-)
---
base-commit: c88fd6989aea9237a60a4859139a265bfb7ddc0b
change-id: 20260714-qcom-bam-dmux-vmid-ext-d9289db310c1
Best regards,
--
Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
[PATCH net-next v6 1/2] dt-bindings: net: qcom,bam-dmux: Add memory-region and qcom,vmid properties
Author: Vishnu Santhosh
Date: Thu, 12 Nov 2026 09:13
Date: Thu, 12 Nov 2026 09:13
88 lines
18268 bytes
18268 bytes
Some Qualcomm SoCs, such as Shikra, run the modem in a separate security
domain with restricted access to system memory. BAM-DMUX DMA mappings
must therefore be constrained to a designated region that can be shared
with the modem.
Add an optional memory-region property to reference a restricted DMA
pool used for BAM-DMUX mappings, and a qcom,vmid property to identify the
remote execution environment that is granted access to the pool through
SCM.
Require memory-region whenever qcom,vmid is specified.
Add the qcom,shikra-bam-dmux compatible, with qcom,bam-dmux as fallback,
and require both properties for it.
Co-developed-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>
Signed-off-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>
Signed-off-by: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
.../devicetree/bindings/net/qcom,bam-dmux.yaml | 36 +++++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml b/Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
index 33746c238513d72366bc52359fb10f275475b331..f7388d24c8612b5a99d5d0e66cfbe2de3b1c9e0d 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
interrupts:
description:
@@ -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.
+
required:
- compatible
- interrupts
@@ -81,6 +101,20 @@ required:
- dmas
- dma-names
+dependencies:
+ qcom,vmid: [ memory-region ]
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: qcom,shikra-bam-dmux
+ then:
+ required:
+ - memory-region
+ - qcom,vmid
+
additionalProperties: false
examples:
--
2.34.1
Re: [PATCH net-next v6 1/2] dt-bindings: net: qcom,bam-dmux: Add memory-region and qcom,vmid properties
Author: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 13:54
Date: Mon, 16 Nov 2026 13:54
137 lines
13109 bytes
13109 bytes
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
Re: [PATCH net-next v6 1/2] dt-bindings: net: qcom,bam-dmux: Add memory-region and qcom,vmid properties
Author: Vishnu Santhosh
Date: Wed, 18 Nov 2026 05:28
Date: Wed, 18 Nov 2026 05:28
147 lines
20523 bytes
20523 bytes
On 16-11-2026 07:24 pm, netdev-bot+sashiko@kernel.org wrote:
> 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?
This is handled separately:
https://lore.kernel.org/all/20260908-shikra-pas-bam-dmux-binding-v4-1-6044889e7e3d@oss.qualcomm.com/
>
> [ ... ]
>
>> @@ -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?
This is covered by a separate binding change for the BAM DMA controller,
which goes through the dmaengine tree:
https://lore.kernel.org/all/20261021-qcom-bam-dma-vmid-ext-v3-1-299355e8dd3b@oss.qualcomm.com/
Thanks,
Vishnu
>
>
>
Re: [PATCH net-next v6 0/2] net: wwan: qcom_bam_dmux: Add restricted DMA pool support
Author: patchwork-bot+netdevbpf
Date: Thu, 19 Nov 2026 10:20
Date: Thu, 19 Nov 2026 10:20
31 lines
9459 bytes
9459 bytes
Hello:
This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Thu, 12 Nov 2026 14:43:30 +0530 you wrote:
> Some Qualcomm SoCs, such as Shikra, run the modem in a separate security
> domain with restricted access to system memory. BAM-DMUX DMA mappings
> and BAM descriptor FIFOs must therefore be constrained to a designated
> memory region that can be shared with the modem. Accesses outside that
> region can trigger an XPU violation.
>
> Add memory-region and qcom,vmid properties to the BAM-DMUX binding, and
> a qcom,shikra-bam-dmux compatible that requires them. When qcom,vmid is
> present, the driver SCM-assigns the entire restricted DMA pool to the
> local and remote execution environments before requesting the DMA
> channels.
>
> [...]
Here is the summary with links:
- [net-next,v6,1/2] dt-bindings: net: qcom,bam-dmux: Add memory-region and qcom,vmid properties
https://git.kernel.org/netdev/net-next/c/ed5087bd84ec
- [net-next,v6,2/2] net: wwan: qcom_bam_dmux: Assign restricted DMA pool to remote processor
https://git.kernel.org/netdev/net-next/c/a5ce83fc0b37
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads