Thread (32 messages) 32 messages, 10 authors, 2011-03-11

[RFC PATCHv1 1/2] Export SoC info through sysfs

From: arnd@arndb.de (Arnd Bergmann)
Date: 2011-03-10 16:32:33
Also in: linux-arm-msm, linux-omap

On Thursday 10 March 2011, Linus Walleij wrote:
On Thu, Mar 10, 2011 at 3:23 PM, Arnd Bergmann [off-list ref] wrote:
quoted
On Thursday 10 March 2011, Linus Walleij wrote:
quoted
So platform is just the platform bus, not the, you know,
*platform*. There are competing on-chip busses not just one.
Good point. Note that I did not mean to put the attributes
directly under /sys/platform/, but under /sys/platform/foo/,
where foo is the main bus that is used between the CPU core
and all the SOC components.

This may of course not be easy. If you have an AMBA or PCI
bus, you might want to have it represented as
/sys/devices/pci0 and /sys/devices/amba0 instead of
/sys/devices/platform/foo/amba0/.
Userspace app doing something needs the name and some
unique number to be looked up. The first iteration of this
patch (for the OMAPs) put it in /proc/socinfo with all the
expected fuzz that this should go into sysfs as result.

So: where do we suggest Maxime actually put this then?
I'm not sure we even need to define something really new.
Ideally, it could just be properties of the devices in
the device tree, but obviously we're not there yet and
may not even want to go there for all platforms.
quoted
Making up a pseudo-device that does not refer to any hardware
in particular is against the 'devices are only "devices"'
rule in Documentation/sysfs-rules.txt.
Fine then I think we agree this can not realistically be
under /sys/devices/* unless we first refactor all platforms
that want to use this mechanism to have top-level-devices.
Not much refactoring required there, just register one
(platform or top-level, I don't care) device named "soc",
and make all platform devices of the soc have a .parent
pointer to that device.

Then you can add attributes to the device.
quoted
If you really want that, it should be in /sys/kernel/,
/sys/firmware/ or a new top-level directory in sysfs.

I think putting it in /sys/devices is good, but it has
to be an attribute of an actual device, not an empty
one that does not even have any child devices. If the
device represents the soc, then every other device
that is found in the soc should be a child of this one.
IMO this is not good for socinfo, what is good for apps that
want socinfo is to just attempt to open+read these file paths.
Not to invoke libsysfs and start parsing the file tree to see if
they can find some socinfo somewhere.

What about we just put it in
/sys/socinfo/* then, and we have a simple,
easy-to-understand way for apps that want socinfo to
read it out?
Possible, but I'd be less happy with this. It's a bit
of duplication of the information that is already present
in both /sys/devices and /sys/firmware.

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help