mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Piyush Raj Chouhan <pc1598@mainlining.org>
To: Srinivas Kandagatla <srini@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Piyush Raj Chouhan <pc1598@mainlining.org>,
	Robin Snyders <robin@snyders.xyz>
Subject: [PATCH] misc: fastrpc: Allocate message buffer from remote heap for sensors PD
Date: Sat,  3 Oct 2026 01:31:18 +0530	[thread overview]
Message-ID: <20261002200118.138837-2-pc1598@mainlining.org> (raw)
In-Reply-To: <20261002200118.138837-1-pc1598@mainlining.org>

The sensors protection domain reaches the message buffer directly rather
than through its context bank, so it requires an allocation from the
reserved remote heap memory pool. Using a context-bank buffer allocation
leaves the DSP addressing memory that is not mapped in its address space,
triggering an SMMU context fault (e.g. 0x1fffff000) or bus stall.

Ensure the remote heap is used for SENSORS_PD invocations even when
a stream ID (sid) is present.

Suggested-by: Robin Snyders <robin@snyders.xyz>
Signed-off-by: Piyush Raj Chouhan <pc1598@mainlining.org>
---
 drivers/misc/fastrpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index d4fac2caca86..8f39f4bed20e 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -1099,7 +1099,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
 
 	ctx->msg_sz = pkt_size;
 
-	if (ctx->fl->sctx->sid)
+	if (ctx->fl->sctx->sid && ctx->fl->pd != SENSORS_PD)
 		err = fastrpc_buf_alloc(ctx->fl, dev, pkt_size, &ctx->buf);
 	else
 		err = fastrpc_remote_heap_alloc(ctx->fl, dev, pkt_size, &ctx->buf);
-- 
2.55.0


  reply	other threads:[~2026-10-02 20:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 20:01 [PATCH 0/1] misc: fastrpc: Fix SMMU context fault on " Piyush Raj Chouhan
2026-10-02 20:01 ` Piyush Raj Chouhan [this message]
     [not found] <4hxf4z2g3kz87m@smtp-3-0000.mail.infomaniak.ch>
2026-10-03 15:17 ` [PATCH] misc: fastrpc: Allocate message buffer from remote heap for " Piyush Raj Chouhan

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=20261002200118.138837-2-pc1598@mainlining.org \
    --to=pc1598@mainlining.org \
    --cc=ekansh.gupta@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin@snyders.xyz \
    --cc=srini@kernel.org \
    /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®