devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: adding OF_DYNAMIC proc interface
       [not found] ` <1348850798-24352-1-git-send-email-atull-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
@ 2012-09-28 21:29   ` Benjamin Herrenschmidt
  2012-09-28 21:54     ` Stephen Warren
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2012-09-28 21:29 UTC (permalink / raw)
  To: atull; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Rob Herring

On Fri, 2012-09-28 at 11:46 -0500, Alan Tull wrote:
> Hello,
> 
> The following patch adds a /proc/ofdt interface to add or remove device tree
> nodes dynamically.
> 
> Based on earlier feedback, I've changed my driver to use /proc instead of
> creating a new ioctl (the old thread is at 
> http://www.mail-archive.com/devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org/msg17333.html)
> 
> 
> I was hoping to get some early feedback from others who might be interested
> who were discussing this on an earlier thread about OF_DYNAMIC usage.
> 
> This code doesn't do any notification for drivers yet. It can add multiple
> nodes and they will show up properly under /proc/device-tree.  It has an
> issue that shows up when removing nodes (it appears that the memory used by
> proc gets corrupted after the add).

(Adding Arnd here)

Have you guys considered whether a better approach would be a file
system ? IE, create a node by creating a directory, add files for
properties etc... ?

It might need some trick to make the node "active" (in order to not
internally in the kernel start exposing unfinished nodes), maybe a
special file, maybe a permission trick ...

It should be at least considered rather than a new interface that tries
to re-implement semantics (such as notification) that are pretty much
already provided by a fs.

Also, what about the existing /proc/device-tree ?

Finally, if we are doing something new and for some reason not a fs,
what about using sysfs rather than /proc ? Really /proc is not a great
idea here.

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: adding OF_DYNAMIC proc interface
  2012-09-28 21:29   ` adding OF_DYNAMIC proc interface Benjamin Herrenschmidt
@ 2012-09-28 21:54     ` Stephen Warren
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Warren @ 2012-09-28 21:54 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, atull, Rob Herring

On 09/28/2012 03:29 PM, Benjamin Herrenschmidt wrote:
> On Fri, 2012-09-28 at 11:46 -0500, Alan Tull wrote:
>> Hello,
>>
>> The following patch adds a /proc/ofdt interface to add or remove device tree
>> nodes dynamically.
>>
>> Based on earlier feedback, I've changed my driver to use /proc instead of
>> creating a new ioctl (the old thread is at 
>> http://www.mail-archive.com/devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org/msg17333.html)
>>
>>
>> I was hoping to get some early feedback from others who might be interested
>> who were discussing this on an earlier thread about OF_DYNAMIC usage.
>>
>> This code doesn't do any notification for drivers yet. It can add multiple
>> nodes and they will show up properly under /proc/device-tree.  It has an
>> issue that shows up when removing nodes (it appears that the memory used by
>> proc gets corrupted after the add).
> 
> (Adding Arnd here)
> 
> Have you guys considered whether a better approach would be a file
> system ? IE, create a node by creating a directory, add files for
> properties etc... ?
> 
> It might need some trick to make the node "active" (in order to not
> internally in the kernel start exposing unfinished nodes), maybe a
> special file, maybe a permission trick ...

mkdir automatically creates status="disabled" or similar internally to
the kernel?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-28 21:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1348850798-24352-1-git-send-email-atull@altera.com>
     [not found] ` <1348850798-24352-1-git-send-email-atull-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
2012-09-28 21:29   ` adding OF_DYNAMIC proc interface Benjamin Herrenschmidt
2012-09-28 21:54     ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).