Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-04 Thread Thierry Reding
On Fri, May 30, 2014 at 09:01:19PM +0200, Arnd Bergmann wrote: > On Friday 30 May 2014 12:22:32 Dave Martin wrote: > > > + > > > +Examples: > > > += > > > + > > > +Single-master IOMMU: > > > + > > > + > > > + iommu { > > > + #address-cells = <0>; > > > +

Re: [PATCH v2 1/4] dma-mapping: Add devm_ interface for dma_map_single()

2014-06-04 Thread Joerg Roedel
Hi, On Wed, Jun 04, 2014 at 06:03:36PM +0300, Eli Billauer wrote: > I believe that I need a managed dma_map_single() my own driver, > which doesn't fall in the case of a single use: The driver allocates > its buffers with __get_free_pages() (or the to-be managed version of > it). Then it cuts the

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-04 Thread Thierry Reding
On Fri, May 30, 2014 at 12:27:28PM +0100, Dave Martin wrote: > On Fri, May 30, 2014 at 08:30:08AM +0100, Thierry Reding wrote: [...] > > Arnd, can you take another look at this binding and see if there's > > anything else missing? If not I'll go through the document again and > > update all #addres

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-04 Thread Thierry Reding
On Wed, Jun 04, 2014 at 05:41:32PM +0100, Will Deacon wrote: > On Wed, Jun 04, 2014 at 03:35:10PM +0100, Thierry Reding wrote: > > On Mon, Jun 02, 2014 at 11:41:04AM +0100, Dave Martin wrote: > > > In the strictest sense, no. > > > > > > But for a large set of sane configurations, this probably wo

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-04 Thread Will Deacon
On Wed, Jun 04, 2014 at 03:35:10PM +0100, Thierry Reding wrote: > On Mon, Jun 02, 2014 at 11:41:04AM +0100, Dave Martin wrote: > > In the strictest sense, no. > > > > But for a large set of sane configurations, this probably works. > > > > Small sets of randomly-assigned IDs can just be enumerate

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-04 Thread Will Deacon
On Wed, Jun 04, 2014 at 03:01:15PM +0100, Arnd Bergmann wrote: > On Wednesday 04 June 2014 14:56:01 Will Deacon wrote: > > On Wed, Jun 04, 2014 at 02:44:03PM +0100, Thierry Reding wrote: > > > On Fri, May 30, 2014 at 09:54:37PM +0200, Arnd Bergmann wrote: > > > > On Friday 30 May 2014 22:29:13 Hiro

Re: [PATCH v2 1/4] dma-mapping: Add devm_ interface for dma_map_single()

2014-06-04 Thread Eli Billauer
Hi, I believe that I need a managed dma_map_single() my own driver, which doesn't fall in the case of a single use: The driver allocates its buffers with __get_free_pages() (or the to-be managed version of it). Then it cuts the allocated memory into smaller buffers (in some cases, and with ce

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-04 Thread Thierry Reding
On Mon, Jun 02, 2014 at 11:41:04AM +0100, Dave Martin wrote: > On Fri, May 30, 2014 at 09:49:59PM +0200, Arnd Bergmann wrote: > > On Friday 30 May 2014 14:31:55 Rob Herring wrote: > > > On Fri, May 30, 2014 at 2:06 PM, Arnd Bergmann wrote: > > > > On Friday 30 May 2014 08:16:05 Rob Herring wrote:

Re: [PATCH v2 1/4] dma-mapping: Add devm_ interface for dma_map_single()

2014-06-04 Thread Tejun Heo
Hello, On Wed, Jun 04, 2014 at 01:39:07AM +0200, Joerg Roedel wrote: > I fully agree with the points Shuah brought up here. I don't think it is > a good idea to add this kind of resource management to runtime-allocated > (and de-allocated) resources of device drivers. > > Also DMA handles are not

Re: [PATCH v2 1/4] dma-mapping: Add devm_ interface for dma_map_single()

2014-06-04 Thread Tejun Heo
Hello, On Wed, Jun 04, 2014 at 04:12:11PM +0200, Joerg Roedel wrote: > Yes, but those drivers usually get DMA buffers at init time with the > dma_alloc_* interfaces. The dma_map_* interfaces discussed here belong > to the streaming DMA-API, so they are usually used for only one DMA > transaction b

Re: [PATCH v2 1/4] dma-mapping: Add devm_ interface for dma_map_single()

2014-06-04 Thread Joerg Roedel
On Wed, Jun 04, 2014 at 10:04:08AM -0400, Tejun Heo wrote: > Hmmm? Don't we have drivers which map dma buffers on device init and > release them on exit? For dynamic usages, its usefulness is limited > especially given that dynamic tracking of buffers usually would > involve tracking of other inf

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-04 Thread Arnd Bergmann
On Wednesday 04 June 2014 14:56:01 Will Deacon wrote: > On Wed, Jun 04, 2014 at 02:44:03PM +0100, Thierry Reding wrote: > > On Fri, May 30, 2014 at 09:54:37PM +0200, Arnd Bergmann wrote: > > > On Friday 30 May 2014 22:29:13 Hiroshi Doyu wrote: > > > > The disadvantage of this is that this limits th

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-04 Thread Will Deacon
On Wed, Jun 04, 2014 at 02:44:03PM +0100, Thierry Reding wrote: > On Fri, May 30, 2014 at 09:54:37PM +0200, Arnd Bergmann wrote: > > On Friday 30 May 2014 22:29:13 Hiroshi Doyu wrote: > > > The disadvantage of this is that this limits the max number of streamIDs > > > to support. If # of streamID i

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-04 Thread Arnd Bergmann
On Wednesday 04 June 2014 15:44:03 Thierry Reding wrote: > > Well, the iommu specific binding could allow a variable #address-cells. > > That way, you just need to know the number of stream IDs for that instance > > of the iommu. > > That sounds fairly complicated to me. I don't see what that buys

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-04 Thread Thierry Reding
On Fri, May 30, 2014 at 09:54:37PM +0200, Arnd Bergmann wrote: > On Friday 30 May 2014 22:29:13 Hiroshi Doyu wrote: > > > > IIUC the original problem, "a master with 8 streamIDs" means something > > like below, where some devices have multiple IDs but some have a > > single. A sinle #address-cells

Re: [PATCH v2] devicetree: Add generic IOMMU device tree bindings

2014-06-04 Thread Thierry Reding
On Sun, Jun 01, 2014 at 10:55:46AM +0100, Will Deacon wrote: > On Fri, May 30, 2014 at 08:54:37PM +0100, Arnd Bergmann wrote: > > On Friday 30 May 2014 22:29:13 Hiroshi Doyu wrote: > > > Tegra,SMMU has a similar problem and we have used a fixed size bitmap(64 > > > bit) to afford 64 stream IDs so t