* [PATCH ver. 2] PM: describe kernel policy regarding wakeup defaults
@ 2010-06-08 19:12 Alan Stern
2010-06-08 20:57 ` Rafael J. Wysocki
0 siblings, 1 reply; 4+ messages in thread
From: Alan Stern @ 2010-06-08 19:12 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Linux-pm mailing list
This patch (as1381b) updates a comment describing the kernel's policy
toward enabling wakeup by default.
It also makes device_set_wakeup_capable() actually do something when
CONFIG_PM isn't enabled. It's not clear this is necessary; however if
it isn't then device_init_wakeup() and device_can_wakeup() should also
be do-nothing routines. Furthermore, I don't expect this change to
have any noticeable effect -- but if it does then clearly the old
behavior was wrong.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
---
Rafael, I don't know if you got the earlier version of this patch.
This one applies against 2.6.35-rc1.
Index: usb-2.6/include/linux/pm_wakeup.h
===================================================================
--- usb-2.6.orig/include/linux/pm_wakeup.h
+++ usb-2.6/include/linux/pm_wakeup.h
@@ -29,8 +29,11 @@
#ifdef CONFIG_PM
-/* changes to device_may_wakeup take effect on the next pm state change.
- * by default, devices should wakeup if they can.
+/* Changes to device_may_wakeup take effect on the next pm state change.
+ *
+ * By default, most devices should leave wakeup disabled. The exceptions
+ * are devices that everyone expects to be wakeup sources: keyboards,
+ * power buttons, possibly network interfaces, etc.
*/
static inline void device_init_wakeup(struct device *dev, bool val)
{
@@ -59,7 +62,7 @@ static inline bool device_may_wakeup(str
#else /* !CONFIG_PM */
-/* For some reason the next two routines work even without CONFIG_PM */
+/* For some reason the following routines work even without CONFIG_PM */
static inline void device_init_wakeup(struct device *dev, bool val)
{
dev->power.can_wakeup = val;
@@ -67,6 +70,7 @@ static inline void device_init_wakeup(st
static inline void device_set_wakeup_capable(struct device *dev, bool capable)
{
+ dev->power.can_wakeup = capable;
}
static inline bool device_can_wakeup(struct device *dev)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH ver. 2] PM: describe kernel policy regarding wakeup defaults
2010-06-08 19:12 [PATCH ver. 2] PM: describe kernel policy regarding wakeup defaults Alan Stern
@ 2010-06-08 20:57 ` Rafael J. Wysocki
2010-06-08 21:24 ` Alan Stern
0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2010-06-08 20:57 UTC (permalink / raw)
To: Alan Stern; +Cc: Linux-pm mailing list
On Tuesday 08 June 2010, Alan Stern wrote:
> This patch (as1381b) updates a comment describing the kernel's policy
> toward enabling wakeup by default.
>
> It also makes device_set_wakeup_capable() actually do something when
> CONFIG_PM isn't enabled. It's not clear this is necessary; however if
> it isn't then device_init_wakeup() and device_can_wakeup() should also
> be do-nothing routines. Furthermore, I don't expect this change to
> have any noticeable effect -- but if it does then clearly the old
> behavior was wrong.
>
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
>
> ---
>
> Rafael, I don't know if you got the earlier version of this patch.
I did.
> This one applies against 2.6.35-rc1.
I assume I should replace the old patch with this one.
Rafael
> Index: usb-2.6/include/linux/pm_wakeup.h
> ===================================================================
> --- usb-2.6.orig/include/linux/pm_wakeup.h
> +++ usb-2.6/include/linux/pm_wakeup.h
> @@ -29,8 +29,11 @@
>
> #ifdef CONFIG_PM
>
> -/* changes to device_may_wakeup take effect on the next pm state change.
> - * by default, devices should wakeup if they can.
> +/* Changes to device_may_wakeup take effect on the next pm state change.
> + *
> + * By default, most devices should leave wakeup disabled. The exceptions
> + * are devices that everyone expects to be wakeup sources: keyboards,
> + * power buttons, possibly network interfaces, etc.
> */
> static inline void device_init_wakeup(struct device *dev, bool val)
> {
> @@ -59,7 +62,7 @@ static inline bool device_may_wakeup(str
>
> #else /* !CONFIG_PM */
>
> -/* For some reason the next two routines work even without CONFIG_PM */
> +/* For some reason the following routines work even without CONFIG_PM */
> static inline void device_init_wakeup(struct device *dev, bool val)
> {
> dev->power.can_wakeup = val;
> @@ -67,6 +70,7 @@ static inline void device_init_wakeup(st
>
> static inline void device_set_wakeup_capable(struct device *dev, bool capable)
> {
> + dev->power.can_wakeup = capable;
> }
>
> static inline bool device_can_wakeup(struct device *dev)
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH ver. 2] PM: describe kernel policy regarding wakeup defaults
2010-06-08 20:57 ` Rafael J. Wysocki
@ 2010-06-08 21:24 ` Alan Stern
2010-06-12 22:42 ` Rafael J. Wysocki
0 siblings, 1 reply; 4+ messages in thread
From: Alan Stern @ 2010-06-08 21:24 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Linux-pm mailing list
On Tue, 8 Jun 2010, Rafael J. Wysocki wrote:
> On Tuesday 08 June 2010, Alan Stern wrote:
> > This patch (as1381b) updates a comment describing the kernel's policy
> > toward enabling wakeup by default.
> >
> > It also makes device_set_wakeup_capable() actually do something when
> > CONFIG_PM isn't enabled. It's not clear this is necessary; however if
> > it isn't then device_init_wakeup() and device_can_wakeup() should also
> > be do-nothing routines. Furthermore, I don't expect this change to
> > have any noticeable effect -- but if it does then clearly the old
> > behavior was wrong.
> >
> > Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
> >
> > ---
> >
> > Rafael, I don't know if you got the earlier version of this patch.
>
> I did.
>
> > This one applies against 2.6.35-rc1.
>
> I assume I should replace the old patch with this one.
Yes. If nothing else, the merge will be simpler.
Alan Stern
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH ver. 2] PM: describe kernel policy regarding wakeup defaults
2010-06-08 21:24 ` Alan Stern
@ 2010-06-12 22:42 ` Rafael J. Wysocki
0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2010-06-12 22:42 UTC (permalink / raw)
To: Alan Stern; +Cc: Linux-pm mailing list
On Tuesday, June 08, 2010, Alan Stern wrote:
> On Tue, 8 Jun 2010, Rafael J. Wysocki wrote:
>
> > On Tuesday 08 June 2010, Alan Stern wrote:
> > > This patch (as1381b) updates a comment describing the kernel's policy
> > > toward enabling wakeup by default.
> > >
> > > It also makes device_set_wakeup_capable() actually do something when
> > > CONFIG_PM isn't enabled. It's not clear this is necessary; however if
> > > it isn't then device_init_wakeup() and device_can_wakeup() should also
> > > be do-nothing routines. Furthermore, I don't expect this change to
> > > have any noticeable effect -- but if it does then clearly the old
> > > behavior was wrong.
> > >
> > > Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
> > >
> > > ---
> > >
> > > Rafael, I don't know if you got the earlier version of this patch.
> >
> > I did.
> >
> > > This one applies against 2.6.35-rc1.
> >
> > I assume I should replace the old patch with this one.
>
> Yes. If nothing else, the merge will be simpler.
Applied to suspend-2.6/linux-next.
Rafael
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-06-12 22:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-08 19:12 [PATCH ver. 2] PM: describe kernel policy regarding wakeup defaults Alan Stern
2010-06-08 20:57 ` Rafael J. Wysocki
2010-06-08 21:24 ` Alan Stern
2010-06-12 22:42 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox