Devicetree
 help / color / mirror / Atom feed
From: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Srinivas Kandagatla <srini@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	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>,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mohit Sharma <mohit.sharma@oss.qualcomm.com>
Subject: Re: [PATCH v2 2/3] ASoC: qcom: q6apm-dai: add VMID-based SCM assignment for mDSP buffers
Date: Wed, 2 Sep 2026 11:39:09 +0530	[thread overview]
Message-ID: <942f0a0a-461e-4794-a33a-9c820635eef0@oss.qualcomm.com> (raw)
In-Reply-To: <948de620-a482-4624-8383-6b65eb28a5e9@sirena.org.uk>



On 8/27/2026 4:22 AM, Mark Brown wrote:
> On Wed, Aug 26, 2026 at 12:10:13AM +0530, Ajay Kumar Nandam wrote:
>> On platforms such as Qualcomm Shikra, audio is served by the modem DSP
>> (mDSP) which runs in a stage-2 protected context. Unlike ADSP targets
>> where SMMU-mapped system RAM is directly accessible, the mDSP cannot
>> reach the PCM buffers unless they are explicitly SCM-assigned to the
>> appropriate Virtual Machine IDs (VMIDs). Without this assignment, audio
>> does not function on these platforms.
> 
>> -		ret = snd_pcm_set_fixed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, component->dev, size);
>> +		if (pdata->has_reserved_mem)
>> +			ret = snd_pcm_set_managed_buffer_all(pcm,
>> +							     SNDRV_DMA_TYPE_DEV, component->dev,
>> +							     pdata->reserved_buf_size,
>> +							     pdata->reserved_buf_size);
> 
> Does this do the right thing if the ALSA core preallocate_dma module
> param is set to 0 for some reason?  I'm not clear why you would...

Good catch.  With preallocate_dma=0 the managed-buffer path defers
allocation to stream open, but the reserved-memory carveout is a
fixed-size pool that must always be mapped upfront — lazy allocation
from the system page allocator would bypass the SCM-assigned region
entirely.

Will switch back to snd_pcm_set_fixed_buffer_all() for the
reserved-memory path in v3; the carveout is fixed by nature and
should not be subject to the preallocate knob.

Thanks & Regards
Ajay Kumar Nandam

  reply	other threads:[~2026-09-02  6:09 UTC|newest]

Thread overview: 12+ 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-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-25 18:57   ` sashiko-bot
2026-08-26 22:52   ` Mark Brown
2026-09-02  6:09     ` Ajay Kumar Nandam [this message]
2026-08-25 18:40 ` [PATCH v2 3/3] ASoC: qcom: qdsp6: generalize GPR service domain Ajay Kumar Nandam
2026-08-25 18:54   ` sashiko-bot

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=942f0a0a-461e-4794-a33a-9c820635eef0@oss.qualcomm.com \
    --to=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=mohit.sharma@oss.qualcomm.com \
    --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