From: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: srini@kernel.org, linux-arm-msm@vger.kernel.org,
gregkh@linuxfoundation.org, quic_bkumar@quicinc.com,
linux-kernel@vger.kernel.org, quic_chennak@quicinc.com,
dri-devel@lists.freedesktop.org, arnd@arndb.de
Subject: Re: [PATCH v3 3/3] misc: fastrpc: Support mapping userspace-allocated buffers
Date: Fri, 30 Jan 2026 17:27:37 +0530 [thread overview]
Message-ID: <ff888cbf-b1cd-4768-a056-3667f94903d3@oss.qualcomm.com> (raw)
In-Reply-To: <33xoq7nt7j3sgcrnxjmbfogrdy3hyskym3yzurmqzwdqxtlgwe@vywpjmegteel>
On 1/30/2026 7:59 AM, Dmitry Baryshkov wrote:
> On Thu, Jan 29, 2026 at 04:09:41PM +0530, Ekansh Gupta wrote:
>>
>> On 1/6/2026 8:21 AM, Dmitry Baryshkov wrote:
>>> On Tue, Dec 30, 2025 at 04:32:25PM +0530, Ekansh Gupta wrote:
>>>> Currently, FastRPC only supports mapping buffers allocated by the
>>>> kernel. This limits flexibility for applications that allocate memory
>>>> in userspace using rpcmem or DMABUF and need to share it with the DSP.
>>> Hmm, for DMABUF we need _import_ support rather than support for mapping
>>> of userspace-allocated buffers.
>>>
>>>> Add support for mapping and unmapping userspace-allocated buffers to
>>>> the DSP through SMMU. This includes handling map requests for rpcmem
>>>> and DMABUF-backed memory and providing corresponding unmap
>>>> functionality.
>>> For me this definitely looks like a step back. For drm/accel we are
>>> going to have GEM-managed buffers only. Why do we need to handle
>>> userspace-allocated buffers here?
>> That's correct, GEM-PRIME will handle it properly. Here, the reason to add this
>> change is to enable routing of DSP logs to HLOS which is done by using a shared
>> buffer between userspace process and DSP PD. The buffer can be allocated from
>> both fastrpc driver's DMA-BUF or DMABUF heap(eg. system heap).
>>
>> So this shared buffer is getting mapped to both process's IOMMU device and DSP PD
>> with this change.
> So, you have the DMA-BUF buffer. Instead of mapping it from userspace
> with unclean semantics, please import the buffer.
I'm assuming fastrpc_map_create is sort of importing the buffer by calling
dma_buf_map_attachment. Is this not the correct understanding? This assumption
is based on the existing part inside fastrpc_get_args, where fastrpc_map_create is
getting called for each of user passed DMA-BUF.
Moving to accel based driver is going to standardize this as the .gem_prime_import
implementation is going to handle this case.
//Ekansh
>
>>>> Signed-off-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>
>>>> ---
>>>> drivers/misc/fastrpc.c | 97 +++++++++++++++++++++++++++++++++++++-----
>>>> 1 file changed, 86 insertions(+), 11 deletions(-)
>>>>
next prev parent reply other threads:[~2026-01-30 11:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-30 11:02 [PATCH v3 0/3] misc: fastrpc: Refactor and add userspace buffer support Ekansh Gupta
2025-12-30 11:02 ` [PATCH v3 1/3] misc: fastrpc: Sanitize address logging and remove tabs Ekansh Gupta
2025-12-30 13:23 ` Konrad Dybcio
2025-12-30 13:47 ` Greg KH
2025-12-30 11:02 ` [PATCH v3 2/3] misc: fastrpc: Refactor mmap and munmap logic into helper functions Ekansh Gupta
2025-12-30 11:02 ` [PATCH v3 3/3] misc: fastrpc: Support mapping userspace-allocated buffers Ekansh Gupta
2026-01-06 2:51 ` Dmitry Baryshkov
2026-01-29 10:39 ` Ekansh Gupta
2026-01-29 22:11 ` Rob Clark
2026-01-29 23:14 ` David Laight
2026-01-30 11:52 ` Ekansh Gupta
2026-01-30 2:29 ` Dmitry Baryshkov
2026-01-30 11:57 ` Ekansh Gupta [this message]
2026-02-09 1:39 ` Dmitry Baryshkov
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=ff888cbf-b1cd-4768-a056-3667f94903d3@oss.qualcomm.com \
--to=ekansh.gupta@oss.qualcomm.com \
--cc=arnd@arndb.de \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_bkumar@quicinc.com \
--cc=quic_chennak@quicinc.com \
--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