public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Linux-pm mailing list <linux-pm@lists.linux-foundation.org>
Subject: Re: [PATCH] PM: adjust comment regarding default wakeup policy
Date: Mon, 24 May 2010 20:58:53 +0200	[thread overview]
Message-ID: <201005242058.53092.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1005211515000.4257-100000@iolanthe.rowland.org>

On Friday 21 May 2010, Alan Stern wrote:
> This patch (as1381) 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>
> CC: David Brownell <david-b@pacbell.net>

OK by me.

Do you want me to push that in this merge window?

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
> @@ -27,8 +27,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, int val)
>  {
> @@ -57,13 +60,16 @@ static inline int device_may_wakeup(stru
>  
>  #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, int val)
>  {
>  	dev->power.can_wakeup = !!val;
>  }
>  
> -static inline void device_set_wakeup_capable(struct device *dev, int val) { }
> +static inline void device_set_wakeup_capable(struct device *dev, int val)
> +{
> +	dev->power.can_wakeup = !!val;
> +}
>  
>  static inline int device_can_wakeup(struct device *dev)
>  {
> 
> 
> 

  reply	other threads:[~2010-05-24 18:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-21 19:16 [PATCH] PM: adjust comment regarding default wakeup policy Alan Stern
2010-05-24 18:58 ` Rafael J. Wysocki [this message]
2010-05-24 20:09   ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201005242058.53092.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox