Re: Battery class driver.

Shem Multinymous
2006-10-24T03:04:20Z

On 10/24/06, David Zeuthen <davidz@redhat.com> wrote:

> b) if the kernel ensures that the 'timestamp' file is updated last,
> we get atomic updates

Atomic updates require either double-buffering the data (twice worse
than mere caching...) or locking away access during update (in which
case the order doesn't mater).

But yes, lack of atomicity in sysfs is a big issue. We don't seem to
have any ABI convention for providing atomic snapshots of those
dozen-small-atribute directories.

> Notably user space can see _when_ the values from the hardware was
> retrieved the last time

> This is a good thing, but is orthogonal to the how-do-we-poll issue.

> So.. how all this relates to hwmon I'm not sure.. looking briefly at
> Documentation/hwmon/sysfs-interface no such thing seems to be available,

Yes, hwmon ignores merrily ignores this issue, as do all other
data-through-sysfs drivers I've looked at. Except for the patched
hdaps driver in the tp_smapi package, which has a (very) rudimentary
solution via caching and a configurable in-kernel polling timer.

Shem