linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found] <1199441414.19185.9.camel@yangyi-dev.bj.intel.com>
@ 2008-01-04 11:48 ` Pavel Machek
       [not found] ` <20080104114832.GA4114@elf.ucw.cz>
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 26+ messages in thread
From: Pavel Machek @ 2008-01-04 11:48 UTC (permalink / raw)
  To: Yi Yang; +Cc: linux-pm, linux-kernel

Hi!

> If a device can't support wakeup, its /sys/devices/.../power/wakeup output is
> empty, this is confusing, a user doesn't know if it supports wakeup feature
> unless he/she read the ralated source code, for this case, it is more
> reasonable to output "unsupported". Otherwise, no matter what value the user
> sets to /sys/devices/.../power/wakeup, the result is the same:  Invalid argument,
> so the user doesn't know why.
> 
> This patch changes empty output to "unsupported" in order that a user knows
> wakeup feature isn't supported by this device when he/she
> 'cat /sys/devices/.../power/wakeup', please consider to apply,
> thanks.

What about simply removing "wakuep" file if wakeup is not supported?
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found] ` <20080104114832.GA4114@elf.ucw.cz>
@ 2008-01-04 16:09   ` David Brownell
  2008-01-07  1:21   ` Yi Yang
       [not found]   ` <20080104160933.B01D81FBAB5@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
  2 siblings, 0 replies; 26+ messages in thread
From: David Brownell @ 2008-01-04 16:09 UTC (permalink / raw)
  To: yi.y.yang, pavel; +Cc: linux-pm, linux-kernel

> > This patch changes empty output to "unsupported" in order that a user knows
> > wakeup feature isn't supported by this device when he/she
> > 'cat /sys/devices/.../power/wakeup', please consider to apply,
> > thanks.
>
> What about simply removing "wakuep" file if wakeup is not supported?

It may not *stay* unsupported, so I think changing it in either
of those permanent ways would be confusing/misleading.

For example, USB devices have multiple states ... minimally, an
unconfigured state, and a configured state.  Some have multiple
configurations.  Only configured states can be wakeup-capable.
So a given device might have three states, but support wakeup
except in one of them...

- Dave

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found] <1199441414.19185.9.camel@yangyi-dev.bj.intel.com>
  2008-01-04 11:48 ` [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device Pavel Machek
       [not found] ` <20080104114832.GA4114@elf.ucw.cz>
@ 2008-01-04 16:31 ` David Brownell
       [not found] ` <20080104163101.EDC02115203@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 26+ messages in thread
From: David Brownell @ 2008-01-04 16:31 UTC (permalink / raw)
  To: yi.y.yang, pavel, linux-pm; +Cc: linux-kernel

> This patch changes empty output to "unsupported" in order that a user knows
> wakeup feature isn't supported by this device when he/she
> 'cat /sys/devices/.../power/wakeup', please consider to apply, thanks.

I don't much like this patch.  Not just for the technical reasons
mentioned in my previous note ... but also because it doesn't update
the documention at the top, which clearly states that "\n" is
returned for "temporary or permanent inability to issue wakeup".
And then it gives the example I gave before ...

Though I suppose a patch that changes the *entire* userspace interface,
(which includes its documentation, and all out-of-tree users) would have
shown more clearly why it wasn't a good idea.  ;)


> --- a/drivers/base/power/sysfs.c	2008-01-04 16:50:54.000000000 +0800
> +++ b/drivers/base/power/sysfs.c	2008-01-04 17:14:42.000000000 +0800
> @@ -49,7 +49,7 @@ wake_show(struct device * dev, struct de
>  {
>  	return sprintf(buf, "%s\n", device_can_wakeup(dev)
>  		? (device_may_wakeup(dev) ? enabled : disabled)
> -		: "");
> +		: "unsupported");
>  }
>  
>  static ssize_t
>
>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found]   ` <20080104160933.B01D81FBAB5@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
@ 2008-01-04 16:38     ` Alan Stern
       [not found]     ` <Pine.LNX.4.44L0.0801041136490.4078-100000@iolanthe.rowland.org>
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 26+ messages in thread
From: Alan Stern @ 2008-01-04 16:38 UTC (permalink / raw)
  To: David Brownell; +Cc: yi.y.yang, linux-pm, linux-kernel

On Fri, 4 Jan 2008, David Brownell wrote:

> > > This patch changes empty output to "unsupported" in order that a user knows
> > > wakeup feature isn't supported by this device when he/she
> > > 'cat /sys/devices/.../power/wakeup', please consider to apply,
> > > thanks.
> >
> > What about simply removing "wakuep" file if wakeup is not supported?
> 
> It may not *stay* unsupported, so I think changing it in either
> of those permanent ways would be confusing/misleading.

How about changing it to say "unavailable"?  That doesn't imply 
permanence.

Alan Stern

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found]     ` <Pine.LNX.4.44L0.0801041136490.4078-100000@iolanthe.rowland.org>
@ 2008-01-04 16:52       ` Olivier Galibert
  2008-01-07  1:52       ` Yi Yang
       [not found]       ` <20080104165214.GA30672@dspnet.fr.eu.org>
  2 siblings, 0 replies; 26+ messages in thread
From: Olivier Galibert @ 2008-01-04 16:52 UTC (permalink / raw)
  To: Alan Stern; +Cc: yi.y.yang, linux-pm, linux-kernel

On Fri, Jan 04, 2008 at 11:38:29AM -0500, Alan Stern wrote:
> How about changing it to say "unavailable"?  That doesn't imply 
> permanence.

How about not changing a userland-visible interface gratuitously?

  OG.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found]       ` <20080104165214.GA30672@dspnet.fr.eu.org>
@ 2008-01-04 17:20         ` Oliver Neukum
  2008-01-07  2:00           ` Yi Yang
  2008-01-07  1:55         ` Yi Yang
       [not found]         ` <1199670923.3551.10.camel@yangyi-dev.bj.intel.com>
  2 siblings, 1 reply; 26+ messages in thread
From: Oliver Neukum @ 2008-01-04 17:20 UTC (permalink / raw)
  To: linux-pm; +Cc: yi.y.yang, Olivier Galibert, linux-kernel

Am Freitag, 4. Januar 2008 17:52:14 schrieb Olivier Galibert:
> On Fri, Jan 04, 2008 at 11:38:29AM -0500, Alan Stern wrote:
> > How about changing it to say "unavailable"?  That doesn't imply 
> > permanence.
> 
> How about not changing a userland-visible interface gratuitously?

Very good idea.

	Regards
		Oliver

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found] ` <20080104114832.GA4114@elf.ucw.cz>
  2008-01-04 16:09   ` David Brownell
@ 2008-01-07  1:21   ` Yi Yang
       [not found]   ` <20080104160933.B01D81FBAB5@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
  2 siblings, 0 replies; 26+ messages in thread
From: Yi Yang @ 2008-01-07  1:21 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-pm, linux-kernel

On Fri, 2008-01-04 at 12:48 +0100, Pavel Machek wrote:
> Hi!
> 
> > If a device can't support wakeup, its /sys/devices/.../power/wakeup output is
> > empty, this is confusing, a user doesn't know if it supports wakeup feature
> > unless he/she read the ralated source code, for this case, it is more
> > reasonable to output "unsupported". Otherwise, no matter what value the user
> > sets to /sys/devices/.../power/wakeup, the result is the same:  Invalid argument,
> > so the user doesn't know why.
> > 
> > This patch changes empty output to "unsupported" in order that a user knows
> > wakeup feature isn't supported by this device when he/she
> > 'cat /sys/devices/.../power/wakeup', please consider to apply,
> > thanks.
> 
> What about simply removing "wakuep" file if wakeup is not supported?
> 									Pavel
At the beginning, i did that as you said, but it can't work, some
power/wakeup will disappear although they can be disabled or enabled, so
it is only one feasible way to make it exist permanently.
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found]   ` <20080104160933.B01D81FBAB5@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
  2008-01-04 16:38     ` Alan Stern
       [not found]     ` <Pine.LNX.4.44L0.0801041136490.4078-100000@iolanthe.rowland.org>
@ 2008-01-07  1:37     ` Yi Yang
       [not found]     ` <1199669879.19185.20.camel@yangyi-dev.bj.intel.com>
  3 siblings, 0 replies; 26+ messages in thread
From: Yi Yang @ 2008-01-07  1:37 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-pm, linux-kernel

On Fri, 2008-01-04 at 08:09 -0800, David Brownell wrote:
> > > This patch changes empty output to "unsupported" in order that a user knows
> > > wakeup feature isn't supported by this device when he/she
> > > 'cat /sys/devices/.../power/wakeup', please consider to apply,
> > > thanks.
> >
> > What about simply removing "wakuep" file if wakeup is not supported?
> 
> It may not *stay* unsupported, so I think changing it in either
> of those permanent ways would be confusing/misleading.
> 
> For example, USB devices have multiple states ... minimally, an
> unconfigured state, and a configured state.  Some have multiple
> configurations.  Only configured states can be wakeup-capable.
> So a given device might have three states, but support wakeup
> except in one of them...
If so, we can change "unsupported" to "unconfigurable" or "inoperable"
which can cover the states "unconfigured", "unsupported" and other
unknown states. :-).
> 
> - Dave
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found] ` <20080104163101.EDC02115203@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
@ 2008-01-07  1:51   ` Yi Yang
  0 siblings, 0 replies; 26+ messages in thread
From: Yi Yang @ 2008-01-07  1:51 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-pm, linux-kernel

On Fri, 2008-01-04 at 08:31 -0800, David Brownell wrote:
> > This patch changes empty output to "unsupported" in order that a user knows
> > wakeup feature isn't supported by this device when he/she
> > 'cat /sys/devices/.../power/wakeup', please consider to apply, thanks.
> 
> I don't much like this patch.  Not just for the technical reasons
> mentioned in my previous note ... but also because it doesn't update
> the documention at the top, which clearly states that "\n" is
> returned for "temporary or permanent inability to issue wakeup".
> And then it gives the example I gave before ...
> 
> Though I suppose a patch that changes the *entire* userspace interface,
> (which includes its documentation, and all out-of-tree users) would have
> shown more clearly why it wasn't a good idea.  ;)
Really, "\n" should be changed to show that change.
Anyway, "\n" isn't a good indicator for that state. :-)
> 
> 
> > --- a/drivers/base/power/sysfs.c	2008-01-04 16:50:54.000000000 +0800
> > +++ b/drivers/base/power/sysfs.c	2008-01-04 17:14:42.000000000 +0800
> > @@ -49,7 +49,7 @@ wake_show(struct device * dev, struct de
> >  {
> >  	return sprintf(buf, "%s\n", device_can_wakeup(dev)
> >  		? (device_may_wakeup(dev) ? enabled : disabled)
> > -		: "");
> > +		: "unsupported");
> >  }
> >  
> >  static ssize_t
> >
> >

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found]     ` <Pine.LNX.4.44L0.0801041136490.4078-100000@iolanthe.rowland.org>
  2008-01-04 16:52       ` Olivier Galibert
@ 2008-01-07  1:52       ` Yi Yang
       [not found]       ` <20080104165214.GA30672@dspnet.fr.eu.org>
  2 siblings, 0 replies; 26+ messages in thread
From: Yi Yang @ 2008-01-07  1:52 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-pm, linux-kernel

On Fri, 2008-01-04 at 11:38 -0500, Alan Stern wrote:
> On Fri, 4 Jan 2008, David Brownell wrote:
> 
> > > > This patch changes empty output to "unsupported" in order that a user knows
> > > > wakeup feature isn't supported by this device when he/she
> > > > 'cat /sys/devices/.../power/wakeup', please consider to apply,
> > > > thanks.
> > >
> > > What about simply removing "wakuep" file if wakeup is not supported?
> > 
> > It may not *stay* unsupported, so I think changing it in either
> > of those permanent ways would be confusing/misleading.
> 
> How about changing it to say "unavailable"?  That doesn't imply 
> permanence.
This should be an option.
> 
> Alan Stern
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found]       ` <20080104165214.GA30672@dspnet.fr.eu.org>
  2008-01-04 17:20         ` Oliver Neukum
@ 2008-01-07  1:55         ` Yi Yang
       [not found]         ` <1199670923.3551.10.camel@yangyi-dev.bj.intel.com>
  2 siblings, 0 replies; 26+ messages in thread
From: Yi Yang @ 2008-01-07  1:55 UTC (permalink / raw)
  To: Olivier Galibert; +Cc: linux-pm, linux-kernel

On Fri, 2008-01-04 at 17:52 +0100, Olivier Galibert wrote:
> On Fri, Jan 04, 2008 at 11:38:29AM -0500, Alan Stern wrote:
> > How about changing it to say "unavailable"?  That doesn't imply 
> > permanence.
> 
> How about not changing a userland-visible interface gratuitously?
"empty" can't tell a user the state of wakeup of a device, so it is
necessary to change it.
> 
>   OG.
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found]     ` <1199669879.19185.20.camel@yangyi-dev.bj.intel.com>
@ 2008-01-07  1:57       ` Rafael J. Wysocki
       [not found]       ` <200801070257.58884.rjw@sisk.pl>
  1 sibling, 0 replies; 26+ messages in thread
From: Rafael J. Wysocki @ 2008-01-07  1:57 UTC (permalink / raw)
  To: yi.y.yang; +Cc: linux-pm, linux-kernel

On Monday, 7 of January 2008, Yi Yang wrote:
> On Fri, 2008-01-04 at 08:09 -0800, David Brownell wrote:
> > > > This patch changes empty output to "unsupported" in order that a user knows
> > > > wakeup feature isn't supported by this device when he/she
> > > > 'cat /sys/devices/.../power/wakeup', please consider to apply,
> > > > thanks.
> > >
> > > What about simply removing "wakuep" file if wakeup is not supported?
> > 
> > It may not *stay* unsupported, so I think changing it in either
> > of those permanent ways would be confusing/misleading.
> > 
> > For example, USB devices have multiple states ... minimally, an
> > unconfigured state, and a configured state.  Some have multiple
> > configurations.  Only configured states can be wakeup-capable.
> > So a given device might have three states, but support wakeup
> > except in one of them...
> If so, we can change "unsupported" to "unconfigurable" or "inoperable"
> which can cover the states "unconfigured", "unsupported" and other
> unknown states. :-).

The main problem with your patch is that is changes a documented behavior
visible by the user space.  That should be done very cautiously.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
  2008-01-04 17:20         ` Oliver Neukum
@ 2008-01-07  2:00           ` Yi Yang
  0 siblings, 0 replies; 26+ messages in thread
From: Yi Yang @ 2008-01-07  2:00 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: linux-pm, Olivier Galibert, linux-kernel

On Fri, 2008-01-04 at 18:20 +0100, Oliver Neukum wrote:
> Am Freitag, 4. Januar 2008 17:52:14 schrieb Olivier Galibert:
> > On Fri, Jan 04, 2008 at 11:38:29AM -0500, Alan Stern wrote:
> > > How about changing it to say "unavailable"?  That doesn't imply 
> > > permanence.
> > 
> > How about not changing a userland-visible interface gratuitously?
> 
Why not do if we can make it better?
> Very good idea.
> 
> 	Regards
> 		Oliver

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found]       ` <200801070257.58884.rjw@sisk.pl>
@ 2008-01-07  2:05         ` Yi Yang
       [not found]         ` <1199671545.3551.16.camel@yangyi-dev.bj.intel.com>
  1 sibling, 0 replies; 26+ messages in thread
From: Yi Yang @ 2008-01-07  2:05 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-pm, linux-kernel

On Mon, 2008-01-07 at 02:57 +0100, Rafael J. Wysocki wrote:
> On Monday, 7 of January 2008, Yi Yang wrote:
> > On Fri, 2008-01-04 at 08:09 -0800, David Brownell wrote:
> > > > > This patch changes empty output to "unsupported" in order that a user knows
> > > > > wakeup feature isn't supported by this device when he/she
> > > > > 'cat /sys/devices/.../power/wakeup', please consider to apply,
> > > > > thanks.
> > > >
> > > > What about simply removing "wakuep" file if wakeup is not supported?
> > > 
> > > It may not *stay* unsupported, so I think changing it in either
> > > of those permanent ways would be confusing/misleading.
> > > 
> > > For example, USB devices have multiple states ... minimally, an
> > > unconfigured state, and a configured state.  Some have multiple
> > > configurations.  Only configured states can be wakeup-capable.
> > > So a given device might have three states, but support wakeup
> > > except in one of them...
> > If so, we can change "unsupported" to "unconfigurable" or "inoperable"
> > which can cover the states "unconfigured", "unsupported" and other
> > unknown states. :-).
> 
> The main problem with your patch is that is changes a documented behavior
> visible by the user space.  That should be done very cautiously.
Which applications are using this interface? if they assume "\n" means
the unconfigurable or unavailable state, this is very fragile.
> 
> Thanks,
> Rafael

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found]         ` <1199670923.3551.10.camel@yangyi-dev.bj.intel.com>
@ 2008-01-07  3:49           ` David Brownell
  0 siblings, 0 replies; 26+ messages in thread
From: David Brownell @ 2008-01-07  3:49 UTC (permalink / raw)
  To: yi.y.yang; +Cc: linux-pm, Olivier Galibert, linux-kernel

On Sunday 06 January 2008, Yi Yang wrote:
> 
> > How about not changing a userland-visible interface gratuitously?
>
> "empty" can't tell a user the state of wakeup of a device, so it is
> necessary to change it.

Words don't say anything at all in isolation.  For example,
here the current tristate behavior has been documented for
several years now ... and that's the only thing that could
have conveyed any meaning whatever.

I can't agree that it's even slightly "necessary" to make
such a grutuitous and backwards-incompatible change.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device
       [not found]         ` <1199671545.3551.16.camel@yangyi-dev.bj.intel.com>
@ 2008-01-07 16:46           ` Rafael J. Wysocki
  0 siblings, 0 replies; 26+ messages in thread
From: Rafael J. Wysocki @ 2008-01-07 16:46 UTC (permalink / raw)
  To: yi.y.yang; +Cc: linux-pm, linux-kernel

On Monday, 7 of January 2008, Yi Yang wrote:
> On Mon, 2008-01-07 at 02:57 +0100, Rafael J. Wysocki wrote:
> > On Monday, 7 of January 2008, Yi Yang wrote:
> > > On Fri, 2008-01-04 at 08:09 -0800, David Brownell wrote:
> > > > > > This patch changes empty output to "unsupported" in order that a user knows
> > > > > > wakeup feature isn't supported by this device when he/she
> > > > > > 'cat /sys/devices/.../power/wakeup', please consider to apply,
> > > > > > thanks.
> > > > >
> > > > > What about simply removing "wakuep" file if wakeup is not supported?
> > > > 
> > > > It may not *stay* unsupported, so I think changing it in either
> > > > of those permanent ways would be confusing/misleading.
> > > > 
> > > > For example, USB devices have multiple states ... minimally, an
> > > > unconfigured state, and a configured state.  Some have multiple
> > > > configurations.  Only configured states can be wakeup-capable.
> > > > So a given device might have three states, but support wakeup
> > > > except in one of them...
> > > If so, we can change "unsupported" to "unconfigurable" or "inoperable"
> > > which can cover the states "unconfigured", "unsupported" and other
> > > unknown states. :-).
> > 
> > The main problem with your patch is that is changes a documented behavior
> > visible by the user space.  That should be done very cautiously.
> Which applications are using this interface? if they assume "\n" means
> the unconfigurable or unavailable state, this is very fragile.

I can't give you examples right now, but since the behavior has been
documented for quite some time, it's safe to assume there are some unless
proven otherwise.

Also, fragile or not, it is the user space's right to rely on documented
behavior of the kernel.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 2.6.24-rc8] cpufreq: fix obvious condition statement error
       [not found] <1199441414.19185.9.camel@yangyi-dev.bj.intel.com>
                   ` (3 preceding siblings ...)
       [not found] ` <20080104163101.EDC02115203@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
@ 2008-01-22 23:05 ` Yi Yang
       [not found] ` <1201043126.3861.5.camel@yangyi-dev.bj.intel.com>
  5 siblings, 0 replies; 26+ messages in thread
From: Yi Yang @ 2008-01-22 23:05 UTC (permalink / raw)
  To: torvalds; +Cc: davej, linux-pm, linux-kernel, cpufreq

The function __cpufreq_set_policy in file drivers/cpufreq/cpufreq.c
has a very obvious error:

        if (policy->min > data->min && policy->min > policy->max) {
                ret = -EINVAL;
                goto error_out;
        }

This condtion statement is wrong because it returns -EINVAL only if
policy->min is greater than policy->max (in this case, 
"policy->min > data->min" is true for ever.). In fact, it should
return -EINVAL as well if policy->max is less than data->min.

The correct condition should be:

	if (policy->min > data->max || policy->max < data->min) {

The following test result testifies the above conclusion:

Before applying this patch:

[root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
2394000 1596000
[root@yangyi-dev /]# echo 1596000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
[root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
1596000
[root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
1596000
[root@yangyi-dev /]# echo "2000000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
-bash: echo: write error: Invalid argument
[root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
1596000
[root@yangyi-dev /]# echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
[root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
1596000
[root@yangyi-dev /]# echo "1595000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
[root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
1596000
[root@yangyi-dev /]#


After applying this patch:

[root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
2394000 1596000
[root@yangyi-dev /]# echo 1596000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
[root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
1596000
[root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
1596000
[root@localhost /]# echo "2000000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
-bash: echo: write error: Invalid argument
[root@localhost /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
1596000
[root@localhost /]# echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
-bash: echo: write error: Invalid argument
[root@localhost /]# echo "1595000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
-bash: echo: write error: Invalid argument
[root@localhost /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
1596000
[root@localhost /]# echo "1596000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
[root@localhost /]# echo "2394000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
[root@localhost /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
2394000
[root@localhost /]


Signed-off-by: Yi Yang <yi.y.yang@intel.com>
---
 cpufreq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/cpufreq/cpufreq.c	2008-01-23 05:02:28.000000000 +0800
+++ b/drivers/cpufreq/cpufreq.c	2008-01-23 06:11:21.000000000 +0800
@@ -1608,7 +1608,7 @@ static int __cpufreq_set_policy(struct c
 	memcpy(&policy->cpuinfo, &data->cpuinfo,
 				sizeof(struct cpufreq_cpuinfo));
 
-	if (policy->min > data->min && policy->min > policy->max) {
+	if (policy->min > data->max || policy->max < data->min) {
 		ret = -EINVAL;
 		goto error_out;
 	}

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 2.6.25-rc1] cpufreq: fix cpufreq policy refcount imbalance
       [not found] ` <1201043126.3861.5.camel@yangyi-dev.bj.intel.com>
@ 2008-02-14 23:44   ` Yi Yang
  2008-02-14 23:48   ` Yi Yang
       [not found]   ` <1203032921.3897.10.camel@yangyi-dev.bj.intel.com>
  2 siblings, 0 replies; 26+ messages in thread
From: Yi Yang @ 2008-02-14 23:44 UTC (permalink / raw)
  To: akpm, torvalds, gregkh
  Cc: davej, cpufreq, elendil, linux-kernel, linux-acpi, yhlu.kernel,
	mingo, linux-pm

When one cpu is set to offline, the caller process will hang, according to
the trace data, the problem lies in the refcount error in cpufreq driver,
cpufreq_cpu_callback will wait for completion policy->kobj_unregister
which is nerver completed because a refcount error in function
__cpufreq_remove_dev in file driver/cpufreq/cpufreq.c results in not
calling kobject release method.

In driver/cpufreq/cpufreq.c, the refcount of data->kobj isn't 1 when it
will be unregistered, this problem didn't exist in 2.6.24 and earlier.

The root cause is kobject API switch, kobject_init_and_add and kobject_put
replace older kobject_register and kobject_unregister in 2.6.25-rc1,
compared to 2.6.24, kobject_unregister is deleted in function
__cpufreq_remove_dev but it isn't replaced with kobject_put.

This patch adds kobject_put to balance refcount. I noticed Greg suggests
it will fix a power-off issue to remove kobject_get statement block, but i
think that isn't the best way because those code block has existed very long
and it is helpful because the successive statements are invoking relevant
data.


Signed-off-by: Yi Yang <yi.y.yang@intel.com>
---
 cpufreq.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/cpufreq/cpufreq.c	2008-02-15 04:41:29.000000000 +0800
+++ b/drivers/cpufreq/cpufreq.c	2008-02-15 06:56:56.000000000 +0800
@@ -1057,12 +1057,17 @@ static int __cpufreq_remove_dev (struct 
 
 	unlock_policy_rwsem_write(cpu);
 
+	/* it matches the previous kobject_get */
 	kobject_put(&data->kobj);
 
 	/* we need to make sure that the underlying kobj is actually
 	 * not referenced anymore by anybody before we proceed with
 	 * unloading.
 	 */
+
+	/* unregister data->kobj, it matches kobject_init_and_add */
+	kobject_put(&data->kobj);
+
 	dprintk("waiting for dropping of refcount\n");
 	wait_for_completion(&data->kobj_unregister);
 	dprintk("wait complete\n");

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 2.6.25-rc1] cpufreq: fix cpufreq policy refcount imbalance
       [not found] ` <1201043126.3861.5.camel@yangyi-dev.bj.intel.com>
  2008-02-14 23:44   ` [PATCH 2.6.25-rc1] cpufreq: fix cpufreq policy refcount imbalance Yi Yang
@ 2008-02-14 23:48   ` Yi Yang
       [not found]   ` <1203032921.3897.10.camel@yangyi-dev.bj.intel.com>
  2 siblings, 0 replies; 26+ messages in thread
From: Yi Yang @ 2008-02-14 23:48 UTC (permalink / raw)
  To: akpm
  Cc: davej, cpufreq, gregkh, linux-kernel, linux-acpi, mingo,
	torvalds, linux-pm

When one cpu is set to offline, the caller process will hang, according to
the trace data, the problem lies in the refcount error in cpufreq driver,
cpufreq_cpu_callback will wait for completion policy->kobj_unregister
which is nerver completed because a refcount error in function
__cpufreq_remove_dev in file driver/cpufreq/cpufreq.c results in not
calling kobject release method.

In driver/cpufreq/cpufreq.c, the refcount of data->kobj isn't 1 when it
will be unregistered, this problem didn't exist in 2.6.24 and earlier.

The root cause is kobject API switch, kobject_init_and_add and kobject_put
replace older kobject_register and kobject_unregister in 2.6.25-rc1,
compared to 2.6.24, kobject_unregister is deleted in function
__cpufreq_remove_dev but it isn't replaced with kobject_put.

This patch adds kobject_put to balance refcount. I noticed Greg suggests
it will fix a power-off issue to remove kobject_get statement block, but i
think that isn't the best way because those code block has existed very long
and it is helpful because the successive statements are invoking relevant
data.


Signed-off-by: Yi Yang <yi.y.yang@intel.com>
---
 cpufreq.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/cpufreq/cpufreq.c	2008-02-15 04:41:29.000000000 +0800
+++ b/drivers/cpufreq/cpufreq.c	2008-02-15 06:56:56.000000000 +0800
@@ -1057,12 +1057,17 @@ static int __cpufreq_remove_dev (struct 
 
 	unlock_policy_rwsem_write(cpu);
 
+	/* it matches the previous kobject_get */
 	kobject_put(&data->kobj);
 
 	/* we need to make sure that the underlying kobj is actually
 	 * not referenced anymore by anybody before we proceed with
 	 * unloading.
 	 */
+
+	/* unregister data->kobj, it matches kobject_init_and_add */
+	kobject_put(&data->kobj);
+
 	dprintk("waiting for dropping of refcount\n");
 	wait_for_completion(&data->kobj_unregister);
 	dprintk("wait complete\n");

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2.6.25-rc1] cpufreq: fix cpufreq policy refcount imbalance
       [not found]   ` <1203032921.3897.10.camel@yangyi-dev.bj.intel.com>
@ 2008-02-15 15:52     ` Alan Stern
       [not found]     ` <Pine.LNX.4.44L0.0802151043230.3423-100000@iolanthe.rowland.org>
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 26+ messages in thread
From: Alan Stern @ 2008-02-15 15:52 UTC (permalink / raw)
  To: Yi Yang
  Cc: davej, cpufreq, gregkh, linux-kernel, linux-acpi, linux-pm, akpm,
	torvalds, mingo

On Fri, 15 Feb 2008, Yi Yang wrote:

> This patch adds kobject_put to balance refcount. I noticed Greg suggests
> it will fix a power-off issue to remove kobject_get statement block, but i
> think that isn't the best way because those code block has existed very long
> and it is helpful because the successive statements are invoking relevant
> data.

Are you referring to this section of code (before the region affected 
by your patch)?

	if (!kobject_get(&data->kobj)) {
		spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
		cpufreq_debug_enable_ratelimit();
		unlock_policy_rwsem_write(cpu);
		return -EFAULT;
	}

Greg is correct that the kobject_get() here is useless and should be
removed.  kobject_get() never returns NULL unless its argument is NULL.  
Since &data->kobj can never be NULL, the "if" test will never fail.  
Hence there's no point in making the test at all.

The fact that a section of code has existed for a long time doesn't 
mean that it is right.  :-)

Furthermore, there's no reason to do the kobject_get().  Holding 2 
references to a kobject is no better than holding just 1 reference.  
Assuming you know that the kobject is still registered, then you also 
know that there is already a reference to it.  So you have no reason to 
take an additional reference.

Alan Stern

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2.6.25-rc1] cpufreq: fix cpufreq policy refcount imbalance
       [not found]     ` <Pine.LNX.4.44L0.0802151043230.3423-100000@iolanthe.rowland.org>
@ 2008-02-15 18:24       ` Greg KH
  0 siblings, 0 replies; 26+ messages in thread
From: Greg KH @ 2008-02-15 18:24 UTC (permalink / raw)
  To: Alan Stern
  Cc: davej, Yi Yang, cpufreq, linux-kernel, linux-acpi, linux-pm,
	akpm, torvalds, mingo

On Fri, Feb 15, 2008 at 10:52:51AM -0500, Alan Stern wrote:
> On Fri, 15 Feb 2008, Yi Yang wrote:
> 
> > This patch adds kobject_put to balance refcount. I noticed Greg suggests
> > it will fix a power-off issue to remove kobject_get statement block, but i
> > think that isn't the best way because those code block has existed very long
> > and it is helpful because the successive statements are invoking relevant
> > data.
> 
> Are you referring to this section of code (before the region affected 
> by your patch)?
> 
> 	if (!kobject_get(&data->kobj)) {
> 		spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
> 		cpufreq_debug_enable_ratelimit();
> 		unlock_policy_rwsem_write(cpu);
> 		return -EFAULT;
> 	}
> 
> Greg is correct that the kobject_get() here is useless and should be
> removed.  kobject_get() never returns NULL unless its argument is NULL.  
> Since &data->kobj can never be NULL, the "if" test will never fail.  
> Hence there's no point in making the test at all.
> 
> The fact that a section of code has existed for a long time doesn't 
> mean that it is right.  :-)
> 
> Furthermore, there's no reason to do the kobject_get().  Holding 2 
> references to a kobject is no better than holding just 1 reference.  
> Assuming you know that the kobject is still registered, then you also 
> know that there is already a reference to it.  So you have no reason to 
> take an additional reference.

There's the additional problem that this second reference count is never
dropped, causing a bug :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2.6.25-rc1] cpufreq: fix cpufreq policy refcount imbalance
       [not found]   ` <1203032921.3897.10.camel@yangyi-dev.bj.intel.com>
  2008-02-15 15:52     ` Alan Stern
       [not found]     ` <Pine.LNX.4.44L0.0802151043230.3423-100000@iolanthe.rowland.org>
@ 2008-02-15 21:01     ` Greg KH
  2008-02-25  0:46     ` [PATCH 2.6.25-rc3] cpuidle: fix cpuidle time and usage overflow Yi Yang
       [not found]     ` <1203900372.4954.8.camel@yangyi-dev.bj.intel.com>
  4 siblings, 0 replies; 26+ messages in thread
From: Greg KH @ 2008-02-15 21:01 UTC (permalink / raw)
  To: Yi Yang
  Cc: davej, cpufreq, linux-kernel, linux-acpi, linux-pm, akpm,
	torvalds, mingo

On Fri, Feb 15, 2008 at 07:48:41AM +0800, Yi Yang wrote:
> When one cpu is set to offline, the caller process will hang, according to
> the trace data, the problem lies in the refcount error in cpufreq driver,
> cpufreq_cpu_callback will wait for completion policy->kobj_unregister
> which is nerver completed because a refcount error in function
> __cpufreq_remove_dev in file driver/cpufreq/cpufreq.c results in not
> calling kobject release method.
> 
> In driver/cpufreq/cpufreq.c, the refcount of data->kobj isn't 1 when it
> will be unregistered, this problem didn't exist in 2.6.24 and earlier.
> 
> The root cause is kobject API switch, kobject_init_and_add and kobject_put
> replace older kobject_register and kobject_unregister in 2.6.25-rc1,
> compared to 2.6.24, kobject_unregister is deleted in function
> __cpufreq_remove_dev but it isn't replaced with kobject_put.
> 
> This patch adds kobject_put to balance refcount. I noticed Greg suggests
> it will fix a power-off issue to remove kobject_get statement block, but i
> think that isn't the best way because those code block has existed very long
> and it is helpful because the successive statements are invoking relevant
> data.
> 
> 
> Signed-off-by: Yi Yang <yi.y.yang@intel.com>

No, the additional kobject_get() needs to be removed.  I posted a patch
for this last night, and so did someone else earlier at:
		http://lkml.org/lkml/2008/2/8/342

this patch should not be added, I'll get the other one in instead.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 2.6.25-rc3] cpuidle: fix cpuidle time and usage overflow
       [not found]   ` <1203032921.3897.10.camel@yangyi-dev.bj.intel.com>
                       ` (2 preceding siblings ...)
  2008-02-15 21:01     ` Greg KH
@ 2008-02-25  0:46     ` Yi Yang
       [not found]     ` <1203900372.4954.8.camel@yangyi-dev.bj.intel.com>
  4 siblings, 0 replies; 26+ messages in thread
From: Yi Yang @ 2008-02-25  0:46 UTC (permalink / raw)
  To: akpm; +Cc: cpufreq, linux-pm, linux-acpi, linux-kernel

cpuidle C-state sysfs node time and usage are very easy to overflow because
they are all of unsigned int type, time will overflow within about two hours,
usage will take longer time to overflow, but they are increasing for ever.

This patch will convert them to unsigned long long.


Signed-off-by: Yi Yang <yi.y.yang@intel.com>
---
 drivers/cpuidle/cpuidle.c |    2 +-
 drivers/cpuidle/sysfs.c   |   10 ++++++++--
 include/linux/cpuidle.h   |    4 ++--

--- a/include/linux/cpuidle.h	2008-02-25 02:31:26.000000000 -0500
+++ b/include/linux/cpuidle.h	2008-02-25 04:30:24.000000000 -0500
@@ -38,8 +38,8 @@ struct cpuidle_state {
 	unsigned int	power_usage; /* in mW */
 	unsigned int	target_residency; /* in US */
 
-	unsigned int	usage;
-	unsigned int	time; /* in US */
+	unsigned long long	usage;
+	unsigned long long	time; /* in US */
 
 	int (*enter)	(struct cpuidle_device *dev,
 			 struct cpuidle_state *state);
--- a/drivers/cpuidle/cpuidle.c	2008-02-25 02:37:14.000000000 -0500
+++ b/drivers/cpuidle/cpuidle.c	2008-02-25 04:29:19.000000000 -0500
@@ -67,7 +67,7 @@ static void cpuidle_idle_call(void)
 	/* enter the state and update stats */
 	dev->last_residency = target_state->enter(dev, target_state);
 	dev->last_state = target_state;
-	target_state->time += dev->last_residency;
+	target_state->time += (unsigned long long)dev->last_residency;
 	target_state->usage++;
 
 	/* give the governor an opportunity to reflect on the outcome */
--- a/drivers/cpuidle/sysfs.c	2008-02-25 02:33:14.000000000 -0500
+++ b/drivers/cpuidle/sysfs.c	2008-02-25 03:10:50.000000000 -0500
@@ -218,6 +218,12 @@ static ssize_t show_state_##_name(struct
 	return sprintf(buf, "%u\n", state->_name);\
 }
 
+#define define_show_state_ull_function(_name) \
+static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
+{ \
+	return sprintf(buf, "%llu\n", state->_name);\
+}
+
 #define define_show_state_str_function(_name) \
 static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
 { \
@@ -228,8 +234,8 @@ static ssize_t show_state_##_name(struct
 
 define_show_state_function(exit_latency)
 define_show_state_function(power_usage)
-define_show_state_function(usage)
-define_show_state_function(time)
+define_show_state_ull_function(usage)
+define_show_state_ull_function(time)
 define_show_state_str_function(name)
 define_show_state_str_function(desc)
 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2.6.25-rc3] cpuidle: fix cpuidle time and usage overflow
       [not found]       ` <20080225101533.GB30685@elte.hu>
@ 2008-02-25  1:10         ` Yi Yang
  0 siblings, 0 replies; 26+ messages in thread
From: Yi Yang @ 2008-02-25  1:10 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: cpufreq, linux-kernel, linux-acpi, akpm, linux-pm

On Mon, 2008-02-25 at 11:15 +0100, Ingo Molnar wrote:
> * Yi Yang <yi.y.yang@intel.com> wrote:
> 
> > cpuidle C-state sysfs node time and usage are very easy to overflow 
> > because they are all of unsigned int type, time will overflow within 
> > about two hours, usage will take longer time to overflow, but they are 
> > increasing for ever.
> > 
> > This patch will convert them to unsigned long long.
> 
> what happens if such an overflow happens - any particular regression or 
> other misbehavior, or just funny looking stats in sysfs?
They are just stats info in sysfs, cpuidle's behaviors don't depend on
them. I didn't notice any regression or misbehaviors.

> 
> 	Ingo
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2.6.25-rc3] cpuidle: fix cpuidle time and usage overflow
       [not found]     ` <1203900372.4954.8.camel@yangyi-dev.bj.intel.com>
       [not found]       ` <20080225101533.GB30685@elte.hu>
@ 2008-02-25 10:15       ` Ingo Molnar
  2008-03-26  4:46       ` Len Brown
  2 siblings, 0 replies; 26+ messages in thread
From: Ingo Molnar @ 2008-02-25 10:15 UTC (permalink / raw)
  To: Yi Yang; +Cc: cpufreq, linux-kernel, linux-acpi, akpm, linux-pm


* Yi Yang <yi.y.yang@intel.com> wrote:

> cpuidle C-state sysfs node time and usage are very easy to overflow 
> because they are all of unsigned int type, time will overflow within 
> about two hours, usage will take longer time to overflow, but they are 
> increasing for ever.
> 
> This patch will convert them to unsigned long long.

what happens if such an overflow happens - any particular regression or 
other misbehavior, or just funny looking stats in sysfs?

	Ingo

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2.6.25-rc3] cpuidle: fix cpuidle time and usage overflow
       [not found]     ` <1203900372.4954.8.camel@yangyi-dev.bj.intel.com>
       [not found]       ` <20080225101533.GB30685@elte.hu>
  2008-02-25 10:15       ` Ingo Molnar
@ 2008-03-26  4:46       ` Len Brown
  2 siblings, 0 replies; 26+ messages in thread
From: Len Brown @ 2008-03-26  4:46 UTC (permalink / raw)
  To: yi.y.yang; +Cc: cpufreq, linux-kernel, linux-acpi, akpm, linux-pm

applied

thanks,
-len

On Sunday 24 February 2008, Yi Yang wrote:
> cpuidle C-state sysfs node time and usage are very easy to overflow because
> they are all of unsigned int type, time will overflow within about two hours,
> usage will take longer time to overflow, but they are increasing for ever.
> 
> This patch will convert them to unsigned long long.
> 
> 
> Signed-off-by: Yi Yang <yi.y.yang@intel.com>
> ---
>  drivers/cpuidle/cpuidle.c |    2 +-
>  drivers/cpuidle/sysfs.c   |   10 ++++++++--
>  include/linux/cpuidle.h   |    4 ++--
> 
> --- a/include/linux/cpuidle.h	2008-02-25 02:31:26.000000000 -0500
> +++ b/include/linux/cpuidle.h	2008-02-25 04:30:24.000000000 -0500
> @@ -38,8 +38,8 @@ struct cpuidle_state {
>  	unsigned int	power_usage; /* in mW */
>  	unsigned int	target_residency; /* in US */
>  
> -	unsigned int	usage;
> -	unsigned int	time; /* in US */
> +	unsigned long long	usage;
> +	unsigned long long	time; /* in US */
>  
>  	int (*enter)	(struct cpuidle_device *dev,
>  			 struct cpuidle_state *state);
> --- a/drivers/cpuidle/cpuidle.c	2008-02-25 02:37:14.000000000 -0500
> +++ b/drivers/cpuidle/cpuidle.c	2008-02-25 04:29:19.000000000 -0500
> @@ -67,7 +67,7 @@ static void cpuidle_idle_call(void)
>  	/* enter the state and update stats */
>  	dev->last_residency = target_state->enter(dev, target_state);
>  	dev->last_state = target_state;
> -	target_state->time += dev->last_residency;
> +	target_state->time += (unsigned long long)dev->last_residency;
>  	target_state->usage++;
>  
>  	/* give the governor an opportunity to reflect on the outcome */
> --- a/drivers/cpuidle/sysfs.c	2008-02-25 02:33:14.000000000 -0500
> +++ b/drivers/cpuidle/sysfs.c	2008-02-25 03:10:50.000000000 -0500
> @@ -218,6 +218,12 @@ static ssize_t show_state_##_name(struct
>  	return sprintf(buf, "%u\n", state->_name);\
>  }
>  
> +#define define_show_state_ull_function(_name) \
> +static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
> +{ \
> +	return sprintf(buf, "%llu\n", state->_name);\
> +}
> +
>  #define define_show_state_str_function(_name) \
>  static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
>  { \
> @@ -228,8 +234,8 @@ static ssize_t show_state_##_name(struct
>  
>  define_show_state_function(exit_latency)
>  define_show_state_function(power_usage)
> -define_show_state_function(usage)
> -define_show_state_function(time)
> +define_show_state_ull_function(usage)
> +define_show_state_ull_function(time)
>  define_show_state_str_function(name)
>  define_show_state_str_function(desc)
>  
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2008-03-26  4:46 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1199441414.19185.9.camel@yangyi-dev.bj.intel.com>
2008-01-04 11:48 ` [PATCH] base: Change power/wakeup output from "" to "unsupported" if wakeup feature isn't supported by a device Pavel Machek
     [not found] ` <20080104114832.GA4114@elf.ucw.cz>
2008-01-04 16:09   ` David Brownell
2008-01-07  1:21   ` Yi Yang
     [not found]   ` <20080104160933.B01D81FBAB5@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
2008-01-04 16:38     ` Alan Stern
     [not found]     ` <Pine.LNX.4.44L0.0801041136490.4078-100000@iolanthe.rowland.org>
2008-01-04 16:52       ` Olivier Galibert
2008-01-07  1:52       ` Yi Yang
     [not found]       ` <20080104165214.GA30672@dspnet.fr.eu.org>
2008-01-04 17:20         ` Oliver Neukum
2008-01-07  2:00           ` Yi Yang
2008-01-07  1:55         ` Yi Yang
     [not found]         ` <1199670923.3551.10.camel@yangyi-dev.bj.intel.com>
2008-01-07  3:49           ` David Brownell
2008-01-07  1:37     ` Yi Yang
     [not found]     ` <1199669879.19185.20.camel@yangyi-dev.bj.intel.com>
2008-01-07  1:57       ` Rafael J. Wysocki
     [not found]       ` <200801070257.58884.rjw@sisk.pl>
2008-01-07  2:05         ` Yi Yang
     [not found]         ` <1199671545.3551.16.camel@yangyi-dev.bj.intel.com>
2008-01-07 16:46           ` Rafael J. Wysocki
2008-01-04 16:31 ` David Brownell
     [not found] ` <20080104163101.EDC02115203@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
2008-01-07  1:51   ` Yi Yang
2008-01-22 23:05 ` [PATCH 2.6.24-rc8] cpufreq: fix obvious condition statement error Yi Yang
     [not found] ` <1201043126.3861.5.camel@yangyi-dev.bj.intel.com>
2008-02-14 23:44   ` [PATCH 2.6.25-rc1] cpufreq: fix cpufreq policy refcount imbalance Yi Yang
2008-02-14 23:48   ` Yi Yang
     [not found]   ` <1203032921.3897.10.camel@yangyi-dev.bj.intel.com>
2008-02-15 15:52     ` Alan Stern
     [not found]     ` <Pine.LNX.4.44L0.0802151043230.3423-100000@iolanthe.rowland.org>
2008-02-15 18:24       ` Greg KH
2008-02-15 21:01     ` Greg KH
2008-02-25  0:46     ` [PATCH 2.6.25-rc3] cpuidle: fix cpuidle time and usage overflow Yi Yang
     [not found]     ` <1203900372.4954.8.camel@yangyi-dev.bj.intel.com>
     [not found]       ` <20080225101533.GB30685@elte.hu>
2008-02-25  1:10         ` Yi Yang
2008-02-25 10:15       ` Ingo Molnar
2008-03-26  4:46       ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).