[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <22F5FEA8-8ED8-4F3D-98F0-6689E0A1B091@antoniou-consulting.com>
Date: Thu, 7 Nov 2013 09:44:23 +0200
From: Pantelis Antoniou <panto@...oniou-consulting.com>
To: Matt Porter <matt.porter@...aro.org>
Cc: Rob Herring <robherring2@...il.com>,
Grant Likely <grant.likely@...retlab.ca>,
Stephen Warren <swarren@...dotorg.org>,
Koen Kooi <koen@...inion.thruhere.net>,
Alison Chaiken <Alison_Chaiken@...tor.com>,
Dinh Nguyen <dinh.linux@...il.com>,
Jan Lubbe <jluebbe@...net.de>,
Alexander Sverdlin <alexander.sverdlin@....com>,
Michael Stickel <ms@...able.de>,
Guenter Roeck <linux@...ck-us.net>,
Dirk Behme <dirk.behme@...il.com>,
Alan Tull <delicious.quinoa@...il.com>,
Sascha Hauer <s.hauer@...gutronix.de>,
Michael Bohan <mbohan@...eaurora.org>,
Ionut Nicu <ioan.nicu.ext@....com>,
Michal Simek <monstr@...str.eu>,
Matt Ranostay <mranostay@...il.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] DT: proc: Add runtime overlay interface in /proc
Hi Matt,
On Nov 6, 2013, at 10:16 PM, Matt Porter wrote:
> 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@...oniou-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.
>
I see. This can be made to work.
> 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.
>
>
Oops...
>> /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
>
Oh well, let's see what the maintainer have to say about which way to do.
Any option of the tree presented would work fine.
> -Matt
Regards
-- Pantelis
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists