From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robin Murphy Subject: Re: [RFC, v3 9/9] media: platform: Add Mediatek ISP P1 shared memory device Date: Fri, 26 Jul 2019 12:04:23 +0100 Message-ID: <4460bc91-352a-7f3a-cbed-1b95e743ca8c@arm.com> References: <20190611035344.29814-1-jungo.lin@mediatek.com> <20190611035344.29814-10-jungo.lin@mediatek.com> <20190701072532.GB137710@chromium.org> <1562297618.1212.46.camel@mtksdccf07> <1562313579.1212.73.camel@mtksdccf07> <1563870117.1212.455.camel@mtksdccf07> <20190726074116.GA19745@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-GB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Tomasz Figa , Christoph Hellwig Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, =?UTF-8?B?U2VhbiBDaGVuZyAo6YSt5piH5byYKQ==?= , =?UTF-8?B?RnJlZGVyaWMgQ2hlbiAo6Zmz5L+K5YWDKQ==?= , =?UTF-8?B?UnlubiBXdSAo5ZCz6IKy5oGpKQ==?= , srv_heupstream , Rob Herring , =?UTF-8?B?UnlhbiBZdSAo5L2Z5a2f5L+uKQ==?= , Matthias Brugger , =?UTF-8?B?RnJhbmtpZSBDaGl1ICjpgrHmloflh7Ep?= , "list-Y9sIeH5OGRo@public.gmane.org:IOMMU DRIVERS" , Hans Verkuil , Jungo Lin , Sj Huang , "moderated list:ARM/Mediatek SoC support" , Laurent Pinchart , ddavenport-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, Mauro Carvalho Chehab linu List-Id: devicetree@vger.kernel.org On 26/07/2019 08:42, Tomasz Figa wrote: > On Fri, Jul 26, 2019 at 4:41 PM Christoph Hellwig wrote: >> >> On Fri, Jul 26, 2019 at 02:15:14PM +0900, Tomasz Figa wrote: >>> Could you try dma_get_sgtable() with the SCP struct device and then >>> dma_map_sg() with the P1 struct device? >> >> Please don't do that. dma_get_sgtable is a pretty broken API (see >> the common near the arm implementation) and we should not add more >> users of it. If you want a piece of memory that can be mapped to >> multiple devices allocate it using alloc_pages and then just map >> it to each device. > > Thanks for taking a look at this thread. > > Unfortunately that wouldn't work. We have a specific reserved memory > pool that is the only memory area accessible to one of the devices. > Any idea how to handle this? If it's reserved in the sense of being outside struct-page-backed "kernel memory", then provided you have a consistent CPU physical address it might be reasonable for other devices to access it via dma_map_resource(). Robin.