[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260129231429.52f280f9@pumpkin>
Date: Thu, 29 Jan 2026 23:14:29 +0000
From: David Laight <david.laight.linux@...il.com>
To: Rob Clark <rob.clark@....qualcomm.com>
Cc: Ekansh Gupta <ekansh.gupta@....qualcomm.com>, Dmitry Baryshkov
<dmitry.baryshkov@....qualcomm.com>, srini@...nel.org,
linux-arm-msm@...r.kernel.org, gregkh@...uxfoundation.org,
quic_bkumar@...cinc.com, linux-kernel@...r.kernel.org,
quic_chennak@...cinc.com, dri-devel@...ts.freedesktop.org, arnd@...db.de
Subject: Re: [PATCH v3 3/3] misc: fastrpc: Support mapping
userspace-allocated buffers
On Thu, 29 Jan 2026 14:11:12 -0800
Rob Clark <rob.clark@....qualcomm.com> wrote:
> But looking at the patch, this looks more like mapping an imported
> dmabuf? Presumably going thru dma_buf_map_attachment() somewhere in
> the existing fastrpc code?
I think I might have had a related problem.
I used dma_alloc_coherent() to get multiple 16kB blocks of kernel memory that
a device can access. The device has an internal 'mmu' that makes them logically
contiguous (from the device point of view).
I then wanted to mmap() a 4k (page) aligned sub-range of that kernel memory
into userspace so that it saw part of the same logically contiguous memory
as the on-device hardware.
Different parts of the devices (max 512 * 16kB) master window are used for
different things, so mmap() offset zero is different for different mmap() requests.
One of the 'old' methods still works provided the pages are physically
contiguous - which isn't the default for systems with an iommu.
IIRC there is a function that will map a single dma_alloc_coherent() allocated
buffer into userspace - but that doesn't let you offset the addresses
not join up multiple buffers.
I can't have been the only person trying to do that?
David
Powered by blists - more mailing lists