All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
To: atull@atull-linux1
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
Subject: Re: adding OF_DYNAMIC proc interface
Date: Sat, 29 Sep 2012 07:29:00 +1000	[thread overview]
Message-ID: <1348867740.7621.4.camel@pasglop> (raw)
In-Reply-To: <1348850798-24352-1-git-send-email-atull-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>

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.

       reply	other threads:[~2012-09-28 21:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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   ` Benjamin Herrenschmidt [this message]
2012-09-28 21:54     ` adding OF_DYNAMIC proc interface Stephen Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348867740.7621.4.camel@pasglop \
    --to=benh-xvmvhmargas8u2djnn8i7kb+6bgklq7r@public.gmane.org \
    --cc=atull@atull-linux1 \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.