From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely Date: Wed, 19 Sep 2012 07:59:45 +0000 Message-ID: <201209190759.46174.arnd@arndb.de> References: <1346223335-31455-1-git-send-email-hdoyu@nvidia.com> <20120918124918.GK2505@amd.com> <20120919095843.d1db155e0f085f4fcf64ea32@nvidia.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120919095843.d1db155e0f085f4fcf64ea32-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Hiroshi Doyu Cc: Joerg Roedel , "m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org" , "linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org" , "minchan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "chunsang.jeong-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "subashrp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" , "linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw@public.gmane.org" , "linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org" , "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" , Krishna Reddy , "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org" , "pullip.cho-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org" , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" List-Id: iommu@lists.linux-foundation.org On Wednesday 19 September 2012, Hiroshi Doyu wrote: > I guess that it would work. Originally I thought that using DMA-API > and IOMMU-API together in driver might be kind of layering violation > since IOMMU-API itself is used in DMA-API. Only DMA-API used in driver > might be cleaner. Considering that DMA API traditionally handling > anonymous {bus,iova} address only, introducing the concept of > specific address in DMA API may not be so encouraged, though. > > It would be nice to listen how other SoCs have solved similar needs. In general, I would recommend using only the IOMMU API when you have a device driver that needs to control the bus virtual address space and that manages a device that resides in its own IOMMU context. I would recommend using only the dma-mapping API when you have a device that lives in a shared bus virtual address space with other devices, and then never ask for a specific bus virtual address. Can you explain what devices you see that don't fit in one of those two categories? Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Wed, 19 Sep 2012 07:59:45 +0000 Subject: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely In-Reply-To: <20120919095843.d1db155e0f085f4fcf64ea32@nvidia.com> References: <1346223335-31455-1-git-send-email-hdoyu@nvidia.com> <20120918124918.GK2505@amd.com> <20120919095843.d1db155e0f085f4fcf64ea32@nvidia.com> Message-ID: <201209190759.46174.arnd@arndb.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wednesday 19 September 2012, Hiroshi Doyu wrote: > I guess that it would work. Originally I thought that using DMA-API > and IOMMU-API together in driver might be kind of layering violation > since IOMMU-API itself is used in DMA-API. Only DMA-API used in driver > might be cleaner. Considering that DMA API traditionally handling > anonymous {bus,iova} address only, introducing the concept of > specific address in DMA API may not be so encouraged, though. > > It would be nice to listen how other SoCs have solved similar needs. In general, I would recommend using only the IOMMU API when you have a device driver that needs to control the bus virtual address space and that manages a device that resides in its own IOMMU context. I would recommend using only the dma-mapping API when you have a device that lives in a shared bus virtual address space with other devices, and then never ask for a specific bus virtual address. Can you explain what devices you see that don't fit in one of those two categories? Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx121.postini.com [74.125.245.121]) by kanga.kvack.org (Postfix) with SMTP id 367C06B0069 for ; Wed, 19 Sep 2012 04:00:00 -0400 (EDT) From: Arnd Bergmann Subject: Re: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely Date: Wed, 19 Sep 2012 07:59:45 +0000 References: <1346223335-31455-1-git-send-email-hdoyu@nvidia.com> <20120918124918.GK2505@amd.com> <20120919095843.d1db155e0f085f4fcf64ea32@nvidia.com> In-Reply-To: <20120919095843.d1db155e0f085f4fcf64ea32@nvidia.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201209190759.46174.arnd@arndb.de> Sender: owner-linux-mm@kvack.org List-ID: To: Hiroshi Doyu Cc: Joerg Roedel , "m.szyprowski@samsung.com" , "linux@arm.linux.org.uk" , "minchan@kernel.org" , "chunsang.jeong@linaro.org" , "linux-kernel@vger.kernel.org" , "subashrp@gmail.com" , "linaro-mm-sig@lists.linaro.org" , "linux-mm@kvack.org" , "iommu@lists.linux-foundation.org" , Krishna Reddy , "linux-tegra@vger.kernel.org" , "kyungmin.park@samsung.com" , "pullip.cho@samsung.com" , "linux-arm-kernel@lists.infradead.org" On Wednesday 19 September 2012, Hiroshi Doyu wrote: > I guess that it would work. Originally I thought that using DMA-API > and IOMMU-API together in driver might be kind of layering violation > since IOMMU-API itself is used in DMA-API. Only DMA-API used in driver > might be cleaner. Considering that DMA API traditionally handling > anonymous {bus,iova} address only, introducing the concept of > specific address in DMA API may not be so encouraged, though. > > It would be nice to listen how other SoCs have solved similar needs. In general, I would recommend using only the IOMMU API when you have a device driver that needs to control the bus virtual address space and that manages a device that resides in its own IOMMU context. I would recommend using only the dma-mapping API when you have a device that lives in a shared bus virtual address space with other devices, and then never ask for a specific bus virtual address. Can you explain what devices you see that don't fit in one of those two categories? Arnd -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754764Ab2ISIAB (ORCPT ); Wed, 19 Sep 2012 04:00:01 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:50807 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753111Ab2ISH76 (ORCPT ); Wed, 19 Sep 2012 03:59:58 -0400 From: Arnd Bergmann To: Hiroshi Doyu Subject: Re: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely Date: Wed, 19 Sep 2012 07:59:45 +0000 User-Agent: KMail/1.12.2 (Linux/3.5.0; KDE/4.3.2; x86_64; ; ) Cc: Joerg Roedel , "m.szyprowski@samsung.com" , "linux@arm.linux.org.uk" , "minchan@kernel.org" , "chunsang.jeong@linaro.org" , "linux-kernel@vger.kernel.org" , "subashrp@gmail.com" , "linaro-mm-sig@lists.linaro.org" , "linux-mm@kvack.org" , "iommu@lists.linux-foundation.org" , Krishna Reddy , "linux-tegra@vger.kernel.org" , "kyungmin.park@samsung.com" , "pullip.cho@samsung.com" , "linux-arm-kernel@lists.infradead.org" References: <1346223335-31455-1-git-send-email-hdoyu@nvidia.com> <20120918124918.GK2505@amd.com> <20120919095843.d1db155e0f085f4fcf64ea32@nvidia.com> In-Reply-To: <20120919095843.d1db155e0f085f4fcf64ea32@nvidia.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201209190759.46174.arnd@arndb.de> X-Provags-ID: V02:K0:0anadbv9l+/qm4XgN9ycsM5X8/GgeI5iQH3n3Gi/lMJ VP05hKIcwbNLYXuYb66borXgnPpTALSxANgh/lEawZ3/acCzl3 Gh+P8cyezfJ8xyFni8X2GXZPu8lCJI3qefvTDJTkwZMe3jWcBk YeWqX8EXqClBOHYov1QXACNB+ZMJDfCIHeYysZGVp2qtYH6CW4 up39fPgF99aIbGzKBORyTH3MgmxJHOZxyaYXj5Q4BLLigIS7IR +FqL5AwujDd74f5D2uqJLyzcoCL0e4OsQZWnYXB7AHvZlVf5yU kEUkHhxiJ7rPnpOM34yJlAnfmYCFY7gsYSlWwyhMc/SwszCgHN O9zkQt38VQTtgmnOD3sM= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 19 September 2012, Hiroshi Doyu wrote: > I guess that it would work. Originally I thought that using DMA-API > and IOMMU-API together in driver might be kind of layering violation > since IOMMU-API itself is used in DMA-API. Only DMA-API used in driver > might be cleaner. Considering that DMA API traditionally handling > anonymous {bus,iova} address only, introducing the concept of > specific address in DMA API may not be so encouraged, though. > > It would be nice to listen how other SoCs have solved similar needs. In general, I would recommend using only the IOMMU API when you have a device driver that needs to control the bus virtual address space and that manages a device that resides in its own IOMMU context. I would recommend using only the dma-mapping API when you have a device that lives in a shared bus virtual address space with other devices, and then never ask for a specific bus virtual address. Can you explain what devices you see that don't fit in one of those two categories? Arnd