[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1363801579.17680.3.camel@pasglop>
Date: Wed, 20 Mar 2013 18:46:19 +0100
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Grant Likely <grant.likely@...retlab.ca>,
linux-kernel@...r.kernel.org, devicetree-discuss@...ts.ozlabs.org,
Rob Herring <rob.herring@...xeda.com>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH 1/2] of: Make device nodes kobjects so they show up in
sysfs
On Wed, 2013-03-20 at 09:56 -0700, Greg Kroah-Hartman wrote:
> > Unfortunately they occasionally are... VPDs can be pretty big for
> > example.
>
> If the attributes are binary blobs, use the binary file capability of
> sysfs to properly handle them.
Except that we don't know that ... we have properties which comes all as
"blobs", only the consumers can interpret what they contain. Tools like
lsprop or dtc do have some built-in smarts to differentiate for example
strings, simple numbers and blobs based roughly on heuristics of content
& size but that's purely for the sake of pretty printing.
Something like /proc/device-tree (or a sysfs equivalent) has no way
really to know what's in there. So basically they should *all* be binary
blobs.
> > > Second, all normal sysfs attributes report their size as 4096 bytes
> > > instead of the actual property size reported in /proc/device-tree. It is
> > > possible that this change will cause some userspace tools to break.
> >
> > This is btw a complete idiocy of sysfs and should/could be fixed.
>
> How can sysfs change this? It doesn't know the size of the attribute
> ahead of time, and it can change depending on what happens in the
> system. So we default to a page size, which is the largest size an
> attribute can be.
That's true for some attributes I suppose and I while I do understand
the difficulty there would be in calculating all the sizes on every
stat, it's still gross, especially for those plenty of attributes who
do have a fixed size.
In our case, we do know the size, we should expose it.
Cheers,
Ben.
--
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