From: Robin Murphy <robin.murphy@arm.com>
To: "Z.Q. Hou" <zhiqiang.hou@nxp.com>, Christoph Hellwig <hch@lst.de>
Cc: "iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>
Subject: Re: [RFC PATCH] dma: coherent: respect to device 'dma-coherent' property
Date: Mon, 17 Apr 2023 13:27:33 +0100 [thread overview]
Message-ID: <42d401e9-57d2-1178-eb94-68f975be73e8@arm.com> (raw)
In-Reply-To: <DB9PR04MB9236E1467316DFEE177D5E9E849C9@DB9PR04MB9236.eurprd04.prod.outlook.com>
On 2023-04-17 03:06, Z.Q. Hou wrote:
> Hi Christoph,
>
>> -----Original Message-----
>> From: Christoph Hellwig <hch@lst.de>
>> Sent: Sunday, April 16, 2023 2:30 PM
>> To: Z.Q. Hou <zhiqiang.hou@nxp.com>
>> Cc: iommu@lists.linux.dev; linux-kernel@vger.kernel.org; hch@lst.de;
>> m.szyprowski@samsung.com; robin.murphy@arm.com
>> Subject: Re: [RFC PATCH] dma: coherent: respect to device 'dma-coherent'
>> property
>>
>> On Fri, Apr 14, 2023 at 04:03:07PM +0800, Zhiqiang Hou wrote:
>>> From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
>>>
>>> Currently, the coherent DMA memory is always mapped as writecombine
>>> and uncached, ignored the 'dma-coherent' property in device node, this
>>> patch is to map the memory as writeback and cached when the device has
>>> 'dma-coherent' property.
>>
>> What is the use case here? The somewhat misnamed per-device coherent
>> memory is intended for small per-device pools of sram or such used for
>> staging memory.
>
> In my case, there are multiple Cortex-A cores within the cluster, in which it is
> cache coherent, they are split into 2 island for running Linux and RTOS respectively.
> I created a virtual device for Linux and RTOS communication using shared memory.
> In Linux side, I created a per-device dma memory pool and added 'dma-coherent'
> for the virtual device, but the data in shared memory can't be sync up, finally found
> the per-device dma pool is always mapped as uncached, so submitted this fix patch.
Yes, in principle this should apply similarly to restricted DMA or
confidential compute VMs where DMA buffers are to be allocated from a
predetermined shared memory area, and a DT reserved-memory region is
used as a coherent pool to achieve that. Quite likely that so far this
has only been done with non-coherent hardware or in software models
where a mismatch in nominal cacheability wasn't noticeable.
It's a bit niche, but not entirely unreasonable.
Thanks,
Robin.
next prev parent reply other threads:[~2023-04-17 12:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 8:03 Zhiqiang Hou
2023-04-16 6:30 ` Christoph Hellwig
2023-04-17 2:06 ` Z.Q. Hou
2023-04-17 12:27 ` Robin Murphy [this message]
2023-04-18 9:55 ` Z.Q. Hou
2023-05-26 0:33 ` Z.Q. Hou
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=42d401e9-57d2-1178-eb94-68f975be73e8@arm.com \
--to=robin.murphy@arm.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=zhiqiang.hou@nxp.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
all inboxes | Powered by JetHome®