Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-25 Thread Will Deacon
On Fri, Nov 22, 2013 at 05:35:58PM +, Stephen Warren wrote: > On 11/22/2013 12:41 AM, Grant Likely wrote: > > It seems more that IOMMU attachment is closer to being a property of the > > bus rather than a property of the device itself. In that context it > > would make more sense for the bus de

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-22 Thread Stephen Warren
On 11/22/2013 12:41 AM, Grant Likely wrote: > On Thu, 21 Nov 2013 12:04:18 -0700, Stephen Warren > wrote: >> On 11/21/2013 06:15 AM, Grant Likely wrote: >>> On Tue, 19 Nov 2013 11:33:06 +0200, Hiroshi Doyu wrote: IOMMU devices on the bus need to be poplulated first, then iommu master d

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-21 Thread Grant Likely
On Thu, 21 Nov 2013 12:04:18 -0700, Stephen Warren wrote: > On 11/21/2013 06:15 AM, Grant Likely wrote: > > On Tue, 19 Nov 2013 11:33:06 +0200, Hiroshi Doyu wrote: > >> IOMMU devices on the bus need to be poplulated first, then iommu > >> master devices are done later. > >> > >> With CONFIG_OF_I

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-21 Thread Grant Likely
On Tue, 19 Nov 2013 11:33:06 +0200, Hiroshi Doyu wrote: > IOMMU devices on the bus need to be poplulated first, then iommu > master devices are done later. > > With CONFIG_OF_IOMMU, "iommus=" DT binding would be used to identify > whether a device can be an iommu msater or not. If a device can, w

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-21 Thread Stephen Warren
On 11/21/2013 06:15 AM, Grant Likely wrote: > On Tue, 19 Nov 2013 11:33:06 +0200, Hiroshi Doyu wrote: >> IOMMU devices on the bus need to be poplulated first, then iommu >> master devices are done later. >> >> With CONFIG_OF_IOMMU, "iommus=" DT binding would be used to identify >> whether a device

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-21 Thread Hiroshi Doyu
On Wed, 20 Nov 2013 17:30:35 +0100 Stephen Warren wrote: ... > >>> Does the above mean the following? > >>> > >>> int of_iommu_attach(struct device *dev) > >>> { > >>> int i; > >>> struct of_phandle_args args; > >>> > >>> of_property_for_each_phandle_with_args(dev->of_node, "iommus", > >>>

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-20 Thread Stephen Warren
On 11/20/2013 07:03 AM, Hiroshi Doyu wrote: > Thierry Reding wrote @ Wed, 20 Nov 2013 14:14:48 > +0100: (Yes, what Thierry said) > >>> Does the above mean the following? >>> >>> int of_iommu_attach(struct device *dev) >>> { >>> int i; >>> struct of_phandle_args args; >>> >>> of

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-20 Thread Hiroshi Doyu
Thierry Reding wrote @ Wed, 20 Nov 2013 14:14:48 +0100: > > Does the above mean the following? > > > > int of_iommu_attach(struct device *dev) > > { > > int i; > > struct of_phandle_args args; > > > > of_property_for_each_phandle_with_args(dev->of_node, "iommus", > >

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-20 Thread Thierry Reding
On Wed, Nov 20, 2013 at 04:17:08AM +0100, Hiroshi Doyu wrote: > Stephen Warren wrote @ Tue, 19 Nov 2013 22:22:47 > +0100: > > > On 11/19/2013 05:03 AM, Hiroshi Doyu wrote: > > > Hi Thierry, > > > > > > Thierry Reding wrote @ Tue, 19 Nov 2013 > > > 11:25:07 +0100: > > > > > >> From earlier di

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-19 Thread Hiroshi Doyu
Stephen Warren wrote @ Tue, 19 Nov 2013 22:22:47 +0100: > On 11/19/2013 05:03 AM, Hiroshi Doyu wrote: > > Hi Thierry, > > > > Thierry Reding wrote @ Tue, 19 Nov 2013 11:25:07 > > +0100: > > > >> From earlier discussions I thought the goal was to actually defer this > >> until all nodes referr

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-19 Thread Stephen Warren
On 11/19/2013 05:03 AM, Hiroshi Doyu wrote: > Hi Thierry, > > Thierry Reding wrote @ Tue, 19 Nov 2013 11:25:07 > +0100: > >> From earlier discussions I thought the goal was to actually defer this >> until all nodes referred to by the iommus property were actually >> registered. The above only c

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-19 Thread Hiroshi Doyu
Hi Thierry, Thierry Reding wrote @ Tue, 19 Nov 2013 11:25:07 +0100: > From earlier discussions I thought the goal was to actually defer this > until all nodes referred to by the iommus property were actually > registered. The above only checks that the phandles can be resolved to > valid struct

Re: [PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-19 Thread Thierry Reding
On Tue, Nov 19, 2013 at 11:33:06AM +0200, Hiroshi Doyu wrote: > IOMMU devices on the bus need to be poplulated first, then iommu > master devices are done later. > > With CONFIG_OF_IOMMU, "iommus=" DT binding would be used to identify > whether a device can be an iommu msater or not. If a device c

[PATCHv5 2/9] driver/core: populate devices in order for IOMMUs

2013-11-19 Thread Hiroshi Doyu
IOMMU devices on the bus need to be poplulated first, then iommu master devices are done later. With CONFIG_OF_IOMMU, "iommus=" DT binding would be used to identify whether a device can be an iommu msater or not. If a device can, we'll defer to populate that device till an iommu device is populate