All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
Cc: Srinivas Kandagatla <srini@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Mohit Sharma <mohit.sharma@oss.qualcomm.com>,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 3/3] ASoC: qcom: q6apm-dai: add SCM buffer assignment for mDSP platforms
Date: Fri, 18 Sep 2026 16:22:52 -0500	[thread overview]
Message-ID: <20260918212252.GA2258003-robh@kernel.org> (raw)
In-Reply-To: <20260918-vmid-v3-v3-3-f1cbf47bf173@oss.qualcomm.com>

On Fri, Sep 18, 2026 at 07:19:37PM +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.
> 
> At probe time, the driver reads the GPR domain_id from the parent APM
> device to determine which DSP serves audio. When domain_id matches
> GPR_DOMAIN_ID_ADSP the existing SMMU/iommus path is taken and no new
> code is exercised. When domain_id matches GPR_DOMAIN_ID_MODEM, the
> driver verifies that qcom_scm is available (deferring otherwise) and
> that iommus is absent (the two mechanisms are mutually exclusive), then
> enables the SCM assignment path.
> 
> In the SCM path the driver parses the optional memory-region entries in
> DT. The first entry (memory-region[0] / audio_heap_mem) is the
> control-path carveout used by the DSP firmware for command traffic; since
> the mDSP operates on stage-2 protected memory, this carveout must be
> SCM-assigned at probe time itself for the firmware to function. It is
> SCM-assigned to HLOS (retained as source owner, RW) plus MSS_MSA and
> LPASS (consumer VMIDs, both RW) and restored to HLOS-only ownership via
> devm_add_action_or_reset() at device removal. The second entry
> (memory-region[1]) is the data-path buffer pool from which per-stream
> DMA buffers are carved out. This pool is attached via
> of_reserved_mem_device_init_by_idx() so that PCM buffers allocate
> directly from the carveout instead of system RAM. Individual buffer
> slices are SCM-assigned in pcm_new() after allocation and unassigned in
> pcm_free(), so only the actively used slices are shared with the modem
> and unused carveout memory remains HLOS-owned.
> 
> The VMIDs are static per SoC and hardcoded in the driver (HLOS, MSS_MSA,
> LPASS) rather than read from DT, following the upstream pattern used by
> rmtfs_mem and qcom_q6v5_pas. Buffer constraints are capped at
> reserved_buf_size when the data-path pool is present, and
> snd_pcm_set_fixed_buffer_all() is used for both paths so the carveout is
> not subject to the preallocate_dma module parameter.
> 
> The DT binding is updated to add an optional memory-region property (1-2
> entries) and to make iommus optional (removed from the required list),
> since mDSP platforms have neither IOMMU nor VMID DT properties.
> 
> All new code paths are gated on use_scm_assign (false when domain_id is
> not GPR_DOMAIN_ID_MODEM), ensuring existing ADSP/iommus targets are
> completely unaffected.
> 
> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
> ---
>  .../devicetree/bindings/sound/qcom,q6apm-dai.yaml  |  12 +-

Bindings are separate patches. Run checkpatch.pl, it will tell you this.

>  sound/soc/qcom/Kconfig                             |   1 +
>  sound/soc/qcom/qdsp6/q6apm-dai.c                   | 260 +++++++++++++++++++--
>  3 files changed, 252 insertions(+), 21 deletions(-)

      parent reply	other threads:[~2026-09-18 21:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 13:49 [PATCH v3 0/3] ASoC: qcom: enable audio on stage-2 protected DSPs (mDSP) Ajay Kumar Nandam
2026-09-18 13:49 ` [PATCH v3 1/3] ASoC: qcom: q6apm: clear g_apm on driver removal Ajay Kumar Nandam
2026-09-18 13:49 ` [PATCH v3 2/3] ASoC: qcom: qdsp6: generalize GPR service domain Ajay Kumar Nandam
2026-09-18 13:49 ` [PATCH v3 3/3] ASoC: qcom: q6apm-dai: add SCM buffer assignment for mDSP platforms Ajay Kumar Nandam
2026-09-18 14:07   ` sashiko-bot
2026-09-18 21:22   ` Rob Herring [this message]

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=20260918212252.GA2258003-robh@kernel.org \
    --to=robh@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=mohit.sharma@oss.qualcomm.com \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.dev \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.