RE: sysfs and power management

samu.p.onkalo
2010-10-27T13:44:19Z

>-----Original Message-----
>From: ext Alan Cox [mailto:alan@linux.intel.com]
>
>> I started to wonder if it makes sense to enhance sysfs so that it
>> optionally prodives open / close call backs. Internally sysfs has
>> some bookkeeping about the refcount but this is not visible to the
>> driver. Of course majority of the sysfs users doesn't need that at all
>> and for them this is just overhead.
>
>I think we need it. There doesn't need to be much overhead however as
>there is no need (or sense) in providing per sysfs node open/close
>hooks.

Do you mean per device hook and each sysfs open / close uses
per device ref-counting.

So the driver would just know that some sysfs entry is open
or all the entries are closed. I think that this kind of behavior
is ok for this purpose.

>
>The pm layer also lacks a clean race-free way to actually ascertain
>when the device was last kicked out of pm saving.