Netdev List
 help / color / mirror / Atom feed
From: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
To: netdev-bot+sashiko@kernel.org
Cc: stephan@gerhold.net, andrew+netdev@lunn.ch, davem@davemloft.net,
	kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	loic.poulain@oss.qualcomm.com, ryazanov.s.a@gmail.com,
	johannes@sipsolutions.net, edumazet@kernel.org,
	linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	deepak.singh@oss.qualcomm.com
Subject: Re: [PATCH net-next v6 1/2] dt-bindings: net: qcom,bam-dmux: Add memory-region and qcom,vmid properties
Date: Wed, 18 Nov 2026 10:58:24 +0530	[thread overview]
Message-ID: <94429261-7bbe-40d9-a8a8-3e85272d7fb7@oss.qualcomm.com> (raw)
In-Reply-To: <179483727050.3136.1539014411037771065@kernel.org>


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

>
>
>

  reply	other threads:[~2026-11-18  5:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  9:13 [PATCH net-next v6 0/2] net: wwan: qcom_bam_dmux: Add restricted DMA pool support Vishnu Santhosh
2026-11-12  9:13 ` [PATCH net-next v6 1/2] dt-bindings: net: qcom,bam-dmux: Add memory-region and qcom,vmid properties Vishnu Santhosh
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-18  5:28     ` Vishnu Santhosh [this message]
2026-11-12  9:13 ` [PATCH net-next v6 2/2] net: wwan: qcom_bam_dmux: Assign restricted DMA pool to remote processor Vishnu Santhosh
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-16 14:43   ` Loic Poulain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=94429261-7bbe-40d9-a8a8-3e85272d7fb7@oss.qualcomm.com \
    --to=vishnu.santhosh@oss.qualcomm.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=deepak.singh@oss.qualcomm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=ryazanov.s.a@gmail.com \
    --cc=stephan@gerhold.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox