mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>,
	Srinivas Kandagatla <srini@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] dt-bindings: sound: qcom,q6apm-dai: add stage-2 (SCM/VMID) access model
Date: Mon, 7 Sep 2026 09:48:09 +0200	[thread overview]
Message-ID: <23d6166f-50f7-4d23-a700-ab738c1e872f@kernel.org> (raw)
In-Reply-To: <c97d0871-0c89-4590-9ad3-4d3859d0522a@kernel.org>

On 03/09/2026 11:39, Krzysztof Kozlowski wrote:
> On 02/09/2026 08:07, Ajay Kumar Nandam wrote:
>>
>>
>> On 8/27/2026 11:33 AM, Krzysztof Kozlowski wrote:
>>> On 25/08/2026 20:40, Ajay Kumar Nandam wrote:
>>>> The APM DAIs expose PCM buffers that the backing DSP must be able to
>>>> reach. On existing targets the DSP runs in a stage-1 context and the
>>>> buffers are described to the SMMU via the iommus property.
>>>>
>>>> On platforms such as Qualcomm Shikra, where audio is served by the modem
>>>> DSP (mDSP) rather than the ADSP, the DSP runs in a stage-2 protected
>>>> context and cannot use the SMMU. The buffers are reachable only after
>>>> hypervisor (SCM) memory assignment to the fixed set of consumer Virtual
>>>> Machine IDs (VMIDs) that own that protected context. Describe those
>>>> consumers with a new qcom,vmids property.
>>>>
>>>> The two access models are mutually exclusive: a node carries either
>>>> iommus (stage-1/SMMU) or qcom,vmids (stage-2/SCM), expressed with a
>>>> oneOf constraint. iommus is therefore no longer unconditionally required.
>>>> SCM assignment replaces the buffer's current owners with the supplied
>>>> destination set, so the driver always adds HLOS to that set itself to
>>>> retain host access; HLOS must not be listed in qcom,vmids.
>>>>
>>>> When qcom,vmids is present the PCM buffers must reside in reserved-memory
>>>> carveouts that are SCM-assigned to the consumer VMIDs. Add an optional
>>>> memory-region property listing those carveouts. The first entry is the
>>>> control-path buffer and subsequent entries are data-path buffers.
>>>> memory-region is only meaningful alongside qcom,vmids, enforced via
>>>> dependentRequired.
>>>>
>>>> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
>>>> ---
>>>>   .../devicetree/bindings/sound/qcom,q6apm-dai.yaml  | 72 +++++++++++++++++++++-
>>>>   1 file changed, 70 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml b/Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml
>>>> index 9e5b30d9c6e6..d9a6bc4a14f2 100644
>>>> --- a/Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml
>>>> +++ b/Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml
>>>> @@ -10,7 +10,15 @@ maintainers:
>>>>     - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>>>   
>>>>   description: |
>>>> -  This binding describes the Qualcomm APM DAIs in DSP
>>>> +  This binding describes the Qualcomm APM DAIs in DSP.
>>>> +
>>>> +  The DSP that runs the APM must be able to reach the PCM buffers. On
>>>> +  existing targets the DSP runs in a stage-1 context and the buffers are
>>>> +  described to the SMMU via iommus. On targets whose APM DSP runs in a
>>>> +  stage-2 protected context that cannot use the SMMU, the buffers are
>>>> +  reachable only after hypervisor (SCM) memory assignment to the fixed
>>>> +  set of consumer VMIDs that own that protected context, described by
>>>> +  qcom,vmids. The two access models are mutually exclusive.
>>>>   
>>>>   properties:
>>>>     compatible:
>>>> @@ -20,9 +28,42 @@ properties:
>>>>       minItems: 1
>>>>       maxItems: 2
>>>
>>> As I said last time, different hardware, different programming
>>> interface, different features, so a different compatible.
>>
>>
>> The APM DAI block is the same packet format.  The driver uses a single 
>> of_device_id entry with no match data; there is no code path dispatched 
>> by the compatible string.
>>
>> The iommu vs VMID distinction is a property of the memory topology,
>> not the DAI hardware, and is already described by the mutually exclusive
>> iommus / qcom,vmids properties.  The DSP identity (ADSP vs mDSP) is
>> carried by the GPR node's qcom,domain property and read at the send
>> layer — the DAI node itself does not need to know which DSP it talks to.
> 
> I am still trying to grasp it. You have a device "APM" and it accesses
> PCM buffers or other memory in some way needing IOMMU for that.
> 
> Now you add something which you call EXACTLY the same device, no
> difference at all, same "APM", but this time this device operates
> completely different, because it does not use IOMMU, but talks with
> firmware via SCM.
> 
> Well, I really do not see how is this still exactly the same or even
> compatible device.
> 
> The way device accesses its data is part of the programming model and
> different programming models have different compatibles.


Additionally, as explained to me in off-list channel, the qcom,vmids is
not a hardware property at all (because hardware is the same), thus does
not look suitable for DT.

Best regards,
Krzysztof

  reply	other threads:[~2026-09-07  7:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25 18:40 [PATCH v2 0/3] ASoC: qcom: enable audio on stage-2 protected DSPs (mDSP) Ajay Kumar Nandam
2026-08-25 18:40 ` [PATCH v2 1/3] dt-bindings: sound: qcom,q6apm-dai: add stage-2 (SCM/VMID) access model Ajay Kumar Nandam
2026-08-26 22:44   ` Mark Brown
2026-09-02  6:03     ` Ajay Kumar Nandam
2026-08-27  6:03   ` Krzysztof Kozlowski
2026-09-02  6:07     ` Ajay Kumar Nandam
2026-09-03  9:39       ` Krzysztof Kozlowski
2026-09-07  7:48         ` Krzysztof Kozlowski [this message]
2026-09-08 17:26           ` Ajay Kumar Nandam
2026-08-25 18:40 ` [PATCH v2 2/3] ASoC: qcom: q6apm-dai: add VMID-based SCM assignment for mDSP buffers Ajay Kumar Nandam
2026-08-26 22:52   ` Mark Brown
2026-09-02  6:09     ` Ajay Kumar Nandam
2026-08-25 18:40 ` [PATCH v2 3/3] ASoC: qcom: qdsp6: generalize GPR service domain Ajay Kumar Nandam

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=23d6166f-50f7-4d23-a700-ab738c1e872f@kernel.org \
    --to=krzk@kernel.org \
    --cc=ajay.nandam@oss.qualcomm.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=srini@kernel.org \
    --cc=tiwai@suse.com \
    /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

all inboxes | Powered by JetHome®