Re: [PATCH 1/5] power: RFC: introduce a new power API

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Anton Vorontsov
Date: Thursday, December 20, 2007 - 8:07 am

Hi Andres,

On Wed, Dec 19, 2007 at 06:13:04PM -0500, Andres Salomon wrote:

Please, stop saying "flexibility". ;-) Better "I needed this, that's
why I've done that".

You needed S/N property, I've gave you the solution without any
drastic or conceptual change to the whole subsystem.

Not that I don't want conceptual changes, I just don't see any need
for them. And no, I don't think that purposed changes are any
better then existing properties.


This isn't the issue. This is what userspace expects. And no, we don't
want to some driver return "too much" from the "current_now" property.
This isn't legitimate value for that property!


Why do they want silly things in the first place?


This is _good_. And we've done it expressly:

- - - Documentation/power_supply_class.txt
So, userspace gets predictable set of attributes and their units for any
kind of power supply, and can process/present them to a user in
consistent manner. Results for different power supplies and machines are
also directly comparable.
- - - -


See the quote above. If driver implements something special, it must
create its own attribute. Via device_create_file. So far none driver
(including OLPC) needed any special attribute that we wouldn't add
to the "core set".


Did you reach int limit already? I can change the int to long long
in a jiffy. Or add new member to the union, with "bigint" name.
I don't see any problem if one day we will face int limit.


No way. What is that for? Name the property.


For what kind of property? Does it exist?

  ^^^^^^^^^^^
s/flexibility/anarchy/

Yes, we're disciplining drivers, so they will look uniform outside of
the kernel. If driver needs not to be uniform, it's free to define its
own internal attributes in _addition_ to uniform ones. And again,
no single driver ever implemented this yet, and no one ever asked to
add new attribute to the "core set". And obviously no one got a refuse
to add one.

If you want to add S/N attribute to the core set -- go ahead, this
is long awaited addition. S/N is okay to be a free-form, thus
strval is a correct choice for that property.


When we'll end up with "others", we'll implement another attribute.

If it needs to be free-form, it will use strval. If it will need
to be a hex number, it will be 'int' and _sysfs will represent it
as hex, for _all_ drivers.


You didn't point how that api falls down, really. You're talking
about maybes and what-ifs.



Correct.


Then, what the power supply subsystem is for? Just place all the
drivers together in driver/power/, and let them create sysfs
attributes by their own. You'll get a medley, not the subsystem.

Good luck,

-- 
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/5] power: RFC: introduce a new power API, Anton Vorontsov, (Wed Dec 19, 5:35 am)
Re: [PATCH 1/5] power: RFC: introduce a new power API, Andres Salomon, (Wed Dec 19, 11:02 am)
Re: [PATCH 1/5] power: RFC: introduce a new power API, Anton Vorontsov, (Wed Dec 19, 11:50 am)
Re: [PATCH 1/5] power: RFC: introduce a new power API, Andres Salomon, (Wed Dec 19, 4:13 pm)
Re: [PATCH 1/5] power: RFC: introduce a new power API, Anton Vorontsov, (Thu Dec 20, 8:07 am)
Re: [PATCH 1/5] power: RFC: introduce a new power API, Andres Salomon, (Thu Dec 20, 9:00 am)
Re: [PATCH 1/5] power: RFC: introduce a new power API, Anton Vorontsov, (Thu Dec 20, 10:09 am)