Re: Strange location and name for platform devices when device-tree is used.

2013-11-15 Thread Grant Likely
On Sat, 02 Nov 2013 07:33:21 +1100, Benjamin Herrenschmidt wrote: > On Fri, 2013-11-01 at 11:04 -0700, Grant Likely wrote: > > > There are two problems here. First, making the change moves all the DT > > populated devices under the /sys/devices/platform tree, not just > > platform devices. > >

Re: Strange location and name for platform devices when device-tree is used.

2013-11-15 Thread Grant Likely
On Sat, 2 Nov 2013 10:45:05 +1100, NeilBrown wrote: > On Sat, 02 Nov 2013 10:10:25 +1100 Benjamin Herrenschmidt > wrote: > > > On Fri, 2013-11-01 at 13:47 -0700, Greg Kroah-Hartman wrote: > > > > > > > On my device I seem to have some platform devices registered through > > > > > device-tree, a

Re: Strange location and name for platform devices when device-tree is used.

2013-11-04 Thread Thierry Reding
On Sat, Nov 02, 2013 at 10:45:05AM +1100, NeilBrown wrote: > On Sat, 02 Nov 2013 10:10:25 +1100 Benjamin Herrenschmidt > wrote: > > > On Fri, 2013-11-01 at 13:47 -0700, Greg Kroah-Hartman wrote: > > > > > > > On my device I seem to have some platform devices registered through > > > > > device-t

Re: Strange location and name for platform devices when device-tree is used.

2013-11-03 Thread Benjamin Herrenschmidt
On Sat, 2013-11-02 at 13:40 -0700, Greg Kroah-Hartman wrote: > On Sun, Nov 03, 2013 at 07:22:10AM +1100, Benjamin Herrenschmidt wrote: > > On Sat, 2013-11-02 at 08:58 -0700, Greg Kroah-Hartman wrote: > > > Just loop through all the platform devices before registering it to > > > determine if you ne

Re: Strange location and name for platform devices when device-tree is used.

2013-11-03 Thread NeilBrown
On Sat, 2 Nov 2013 08:58:24 -0700 Greg Kroah-Hartman wrote: > So go blame them for this, not me, remember, I'm the one who _hates_ > platform devices and wish they had never been created... Have you ever written up why you hate them? I did a bit of googling and couldn't find anything obvious.

Re: Strange location and name for platform devices when device-tree is used.

2013-11-02 Thread Greg Kroah-Hartman
On Sun, Nov 03, 2013 at 07:22:10AM +1100, Benjamin Herrenschmidt wrote: > On Sat, 2013-11-02 at 08:58 -0700, Greg Kroah-Hartman wrote: > > Just loop through all the platform devices before registering it to > > determine if you need to do this, the platform code can do this just > > fine. If you t

Re: Strange location and name for platform devices when device-tree is used.

2013-11-02 Thread Benjamin Herrenschmidt
On Sat, 2013-11-02 at 08:58 -0700, Greg Kroah-Hartman wrote: > Just loop through all the platform devices before registering it to > determine if you need to do this, the platform code can do this just > fine. If you try to register a duplicate name with the driver core, > odds are it will complai

Re: Strange location and name for platform devices when device-tree is used.

2013-11-02 Thread Greg Kroah-Hartman
On Sat, Nov 02, 2013 at 10:09:59AM +1100, Benjamin Herrenschmidt wrote: > On Fri, 2013-11-01 at 13:47 -0700, Greg Kroah-Hartman wrote: > > > > > On my device I seem to have some platform devices registered through > > > > device-tree, and some registered through platform_device_add (e.g. > > > > '

Re: Strange location and name for platform devices when device-tree is used.

2013-11-01 Thread NeilBrown
On Sat, 02 Nov 2013 10:10:25 +1100 Benjamin Herrenschmidt wrote: > On Fri, 2013-11-01 at 13:47 -0700, Greg Kroah-Hartman wrote: > > > > > On my device I seem to have some platform devices registered through > > > > device-tree, and some registered through platform_device_add (e.g. > > > > 'alarm

Re: Strange location and name for platform devices when device-tree is used.

2013-11-01 Thread Benjamin Herrenschmidt
On Fri, 2013-11-01 at 13:47 -0700, Greg Kroah-Hartman wrote: > > > On my device I seem to have some platform devices registered through > > > device-tree, and some registered through platform_device_add (e.g. > > > 'alarmtimer'). Guaranteeing they remain disjoint sets if the kernel is > > > allow

Re: Strange location and name for platform devices when device-tree is used.

2013-11-01 Thread Benjamin Herrenschmidt
On Fri, 2013-11-01 at 13:47 -0700, Greg Kroah-Hartman wrote: > > > On my device I seem to have some platform devices registered through > > > device-tree, and some registered through platform_device_add (e.g. > > > 'alarmtimer'). Guaranteeing they remain disjoint sets if the kernel is > > > allow

Re: Strange location and name for platform devices when device-tree is used.

2013-11-01 Thread Greg Kroah-Hartman
On Fri, Nov 01, 2013 at 11:04:59AM -0700, Grant Likely wrote: > Second, I expect there is going to be userspace breakage to move them. > I've considered moving them before, but so far have felt that being > tidier hasn't been worth the potential breakage. Userspace /shouldn't/ > be relying on the n

Re: Strange location and name for platform devices when device-tree is used.

2013-11-01 Thread Greg Kroah-Hartman
On Fri, Nov 01, 2013 at 04:08:36PM +1100, Benjamin Herrenschmidt wrote: > On Fri, 2013-11-01 at 16:03 +1100, NeilBrown wrote: > > > Do you mean we could allow multiple devices on the one bus to have the same > > name, but get sysfs to notice and de-duplicate by mangling one name? I > > don't > >

Re: Strange location and name for platform devices when device-tree is used.

2013-11-01 Thread Benjamin Herrenschmidt
On Fri, 2013-11-01 at 11:04 -0700, Grant Likely wrote: > There are two problems here. First, making the change moves all the DT > populated devices under the /sys/devices/platform tree, not just > platform devices. All DT populated *platform* devices. There are others that have their own location

Re: Strange location and name for platform devices when device-tree is used.

2013-11-01 Thread Grant Likely
On Fri, 01 Nov 2013 16:08:36 +1100, Benjamin Herrenschmidt wrote: > On Fri, 2013-11-01 at 16:03 +1100, NeilBrown wrote: > > > Do you mean we could allow multiple devices on the one bus to have the same > > name, but get sysfs to notice and de-duplicate by mangling one name? I > > don't > > thi

Re: Strange location and name for platform devices when device-tree is used.

2013-10-31 Thread Benjamin Herrenschmidt
On Fri, 2013-11-01 at 16:03 +1100, NeilBrown wrote: > Do you mean we could allow multiple devices on the one bus to have the same > name, but get sysfs to notice and de-duplicate by mangling one name? I don't > think I like that but I might have misunderstood. What other option do we have ? > O

Re: Strange location and name for platform devices when device-tree is used.

2013-10-31 Thread NeilBrown
On Fri, 01 Nov 2013 15:27:34 +1100 Benjamin Herrenschmidt wrote: > On Fri, 2013-11-01 at 15:22 +1100, Benjamin Herrenschmidt wrote: > > On Fri, 2013-11-01 at 14:59 +1100, NeilBrown wrote: > > > and I wonder how relevant it still is in this context. As platform > > > devices > > > are all in the

Re: Strange location and name for platform devices when device-tree is used.

2013-10-31 Thread Benjamin Herrenschmidt
On Fri, 2013-11-01 at 15:22 +1100, Benjamin Herrenschmidt wrote: > On Fri, 2013-11-01 at 14:59 +1100, NeilBrown wrote: > > and I wonder how relevant it still is in this context. As platform devices > > are all in the root of the device-tree and hence are siblings, they must > > have > > unique na

Re: Strange location and name for platform devices when device-tree is used.

2013-10-31 Thread Benjamin Herrenschmidt
On Fri, 2013-11-01 at 14:59 +1100, NeilBrown wrote: > and I wonder how relevant it still is in this context. As platform devices > are all in the root of the device-tree and hence are siblings, they must have > unique names in the device-tree and so the platform devices created from > them will a

Strange location and name for platform devices when device-tree is used.

2013-10-31 Thread NeilBrown
My ARM board has a collection of "platform devices". When I build a kernel using a board file, these platform devices are named with exactly the names I give them, and they appear in sysfs under /sys/devices/platform all as you might expect. When I build a kernel using device-tree (and tryi