public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Porter <matt.porter@linaro.org>
To: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Rob Herring <robherring2@gmail.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Koen Kooi <koen@dominion.thruhere.net>,
	Alison Chaiken <Alison_Chaiken@mentor.com>,
	Dinh Nguyen <dinh.linux@gmail.com>, Jan Lubbe <jluebbe@lasnet.de>,
	Alexander Sverdlin <alexander.sverdlin@nsn.com>,
	Michael Stickel <ms@mycable.de>,
	Guenter Roeck <linux@roeck-us.net>,
	Dirk Behme <dirk.behme@gmail.com>,
	Alan Tull <delicious.quinoa@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Michael Bohan <mbohan@codeaurora.org>,
	Ionut Nicu <ioan.nicu.ext@nsn.com>,
	Michal Simek <monstr@monstr.eu>,
	Matt Ranostay <mranostay@gmail.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] DT: proc: Add runtime overlay interface in /proc
Date: Wed, 6 Nov 2013 15:16:20 -0500	[thread overview]
Message-ID: <20131106201620.GN28156@beef> (raw)
In-Reply-To: <8EBC2D5B-74A4-4A85-8BEE-9EAEBFF045D4@antoniou-consulting.com>

On Wed, Nov 06, 2013 at 09:24:12PM +0200, Pantelis Antoniou wrote:
> Hi Rob,
> 
> On Nov 6, 2013, at 9:10 PM, Rob Herring wrote:
> 
> > On Tue, Nov 5, 2013 at 12:41 PM, Pantelis Antoniou
> > <panto@antoniou-consulting.com> wrote:
> >> Add a runtime interface to /proc to enable generic device tree overlay
> >> usage.
> >> 
> >> Two new /proc files are added:
> >> 
> >> /proc/device-tree-overlay & /proc/device-tree-overlay-status
> > 
> > I think we really want all this to live under sysfs. Grant did patches
> > to move /proc/device-tree to /sys, but it never went upstream:
> > 
> > v2: https://lkml.org/lkml/2013/3/21/215
> > v1: https://lkml.org/lkml/2013/3/20/311
> > 
> 
> Yes, I'm aware; the location of this control interface in /proc is
> unusual, but had to go somewhere. It should be easy enough to move it to
> /sys.
> 
> >> /proc/device-tree-overlay accepts a stream of a device tree objects and
> >> applies it to the running kernel's device tree.
> >> 
> >>        $ cat ~/BB-UART2-00A0.dtbo >device-tree-overlay
> >>        overlay_proc_release: Applied #2 overlay segments @0
> >> 
> >> /proc/device-tree-overlay-status displays the the overlays added using
> >> the /proc interface
> >> 
> >>        $ cat device-tree-overlay-status
> >>        0: 861 bytes BB-UART2:00A0
> > 
> > Is the size useful information?
> > 
> 
> If the overlay doesn't contain part-number/version properties there is nothing
> to differentiate each one loaded. No file information, it is just a byte stream
> interface.
> 
> >> 
> >> The format of the status line is
> >>        <ID>: <SIZE> bytes <part-number>:<version>
> >> 
> >> <ID> is the id of the overlay
> >> <SIZE> is the size of the overlay in bytes
> >> <part-number>, <version> are (optional) root level properties of the DTBO
> >> 
> >> You can remove an overlay by echoing the <ID> number of the overlay
> >> precedded with a '-'
> >> 
> >> So
> >>        $ echo "-0" >device-tree-overlay-status
> >> 
> >> Removes the overlay.
> > 
> > This interface seems racy. Could the id change on you between reading
> > the status and echoing to remove the overlay?
> > 
> > I would rather see a file created for each overlay and simply echo 0
> > or "remove" to remove the overlay. Or possibly it needs to be a
> > directory per overlay with several files for info and control. This
> > would be more inline with typical sysfs design.
> > 
> 
> It was suggested to use a configfs interface. IIRC configfs can do what you
> propose.
> 
> Something like 
> 
> /config/dto/add 	<- load by cat overlay.dtbo >/config/dto/load

In a configfs it makes more sense to mkdir. FWIW, USB gadget configfs
is a good example of this.

	mkdir /config/dto/0

which would cause the kernel to create the attribute under that
directory:

	/config/dto/0/load

Which you use to load as noted above.

Only problem is that configfs doesn't support binary attributes like
sysfs. If it is a agreed that overlays are configuration then that would
be a strong argument to bring over the binary attribute feature.


> /config/dto/0/remove 	<- unload by echo 1 >/config/dto/0/remove

	rmdir /config/dto/0

> /config/dto/0/${prop}   <- root level properties that are ignore by the overlay
> 			   mechanism

-Matt

  reply	other threads:[~2013-11-06 20:16 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05 18:41 [PATCH 0/3 - V2] Introducing Device Tree Overlays Pantelis Antoniou
2013-11-05 18:41 ` [PATCH 1/3] OF: Introduce Device Tree resolve support Pantelis Antoniou
2013-11-06 15:59   ` Alexander Sverdlin
2013-11-06 16:24     ` Ionut Nicu
2013-11-05 18:41 ` [PATCH 2/3] OF: Introduce DT overlay support Pantelis Antoniou
2013-11-06 16:00   ` Alexander Sverdlin
2013-11-06 16:26     ` Ionut Nicu
2013-11-06 20:41   ` Dinh Nguyen
2013-11-07  7:10     ` Pantelis Antoniou
2013-11-05 18:41 ` [PATCH 3/3] DT: proc: Add runtime overlay interface in /proc Pantelis Antoniou
2013-11-06  9:51   ` Ionut Nicu
2013-11-06  9:57     ` Pantelis Antoniou
2013-11-06 19:10   ` Rob Herring
2013-11-06 19:24     ` Pantelis Antoniou
2013-11-06 20:16       ` Matt Porter [this message]
2013-11-07  7:44         ` Pantelis Antoniou
2013-11-07 23:38   ` delicious quinoa
2013-11-08  7:12     ` Pantelis Antoniou
2013-11-05 19:06 ` [PATCH 0/3 - V2] Introducing Device Tree Overlays Guenter Roeck
2013-11-06  0:15   ` Dinh Nguyen
2013-11-06  8:53 ` Alexander Sverdlin
2013-11-06 19:01 ` Sebastian Andrzej Siewior
2013-11-06 19:08   ` Pantelis Antoniou
2013-11-06 20:31     ` Sebastian Andrzej Siewior
2013-11-06 20:41       ` Sebastian Andrzej Siewior
2013-11-07  7:24         ` Pantelis Antoniou
2013-11-07  7:23       ` Pantelis Antoniou
2013-11-07  9:45     ` Alexander Sverdlin
2013-11-06 19:30   ` Guenter Roeck
2013-11-06 20:38     ` Sebastian Andrzej Siewior
2013-11-06 21:17       ` Guenter Roeck
2013-11-07  7:27         ` Pantelis Antoniou
2013-11-07 19:25         ` Sebastian Andrzej Siewior
2013-11-07 20:06           ` Pantelis Antoniou
2013-11-07 20:46             ` Sebastian Andrzej Siewior
2013-11-07 23:00               ` Guenter Roeck
2013-11-08  7:12                 ` Pantelis Antoniou
2013-11-08  8:40                 ` Sebastian Andrzej Siewior
2013-11-08  7:09               ` Pantelis Antoniou
2013-11-11 17:04               ` Grant Likely
2013-11-12  8:16                 ` Pantelis Antoniou
2013-11-07 22:51             ` Guenter Roeck
2013-11-07 22:22           ` Guenter Roeck

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=20131106201620.GN28156@beef \
    --to=matt.porter@linaro.org \
    --cc=Alison_Chaiken@mentor.com \
    --cc=alexander.sverdlin@nsn.com \
    --cc=delicious.quinoa@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dinh.linux@gmail.com \
    --cc=dirk.behme@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=ioan.nicu.ext@nsn.com \
    --cc=jluebbe@lasnet.de \
    --cc=koen@dominion.thruhere.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mbohan@codeaurora.org \
    --cc=monstr@monstr.eu \
    --cc=mranostay@gmail.com \
    --cc=ms@mycable.de \
    --cc=panto@antoniou-consulting.com \
    --cc=robherring2@gmail.com \
    --cc=s.hauer@pengutronix.de \
    --cc=swarren@wwwdotorg.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox