public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Shaohua Li <shaohua.li@intel.com>
Cc: linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org,
	dbrownell@users.sourceforge.net
Subject: Re: [RFC 1/5] devcore introduce wakeup_event callback
Date: Sun, 19 Oct 2008 21:04:16 +0200	[thread overview]
Message-ID: <200810192104.17510.rjw@sisk.pl> (raw)
In-Reply-To: <20080911063822.973881418@sli10-desk.sh.intel.com>

On Thursday, 11 of September 2008, Shaohua Li wrote:
> Introduce .wakeup_event(). When a device gets a wakeup event,
> the callback is called. The callback usually should disable wakeup event.
> 
> ---
>  include/linux/pm.h |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> Index: linux/include/linux/pm.h
> ===================================================================
> --- linux.orig/include/linux/pm.h	2008-09-11 10:56:27.000000000 +0800
> +++ linux/include/linux/pm.h	2008-09-11 10:56:29.000000000 +0800
> @@ -125,6 +125,12 @@ typedef struct pm_message {
>   *	make ANY assumptions about the hardware state right prior to @restore().
>   *	On most platforms, there are no restrictions on availability of
>   *	resources like clocks during @restore().
> + * @wakeup_event: Checks if a wakeup event occurs. In bus level, the op might
> + *	check all devices under the bus and call device_receive_wakeup_event()
> + *	for devices which invoke wakeup event. In device level, the op just
> + *	returns if a wakeup event occurs. Note, if device follows standard
> + *	mechanism for wakeup which bus level can handle, device level op can be
> + *	empty.
>   *
>   * All of the above callbacks, except for @complete(), return error codes.
>   * However, the error codes returned by the resume operations, @resume(),
> @@ -151,6 +157,7 @@ struct pm_ops {
>  	int (*thaw)(struct device *dev);
>  	int (*poweroff)(struct device *dev);
>  	int (*restore)(struct device *dev);
> +	bool (*wakeup_event)(struct device *dev);
>  };
>  
>  /**

I think it will be better to place wakeup_event() in 'struct device' itself
rather than here.

Generally, the 'struct pm_ops' thing (after the simplification patch queued up
for .29 that will be 'struct dev_pm_ops') will depend on PM_SLEEP and
wakeup_event() is a run-time thing.

Thanks,
Rafael

  parent reply	other threads:[~2008-10-19 19:04 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080911063037.698427944@sli10-desk.sh.intel.com>
2008-09-11  6:30 ` [RFC 1/5] devcore introduce wakeup_event callback Shaohua Li
2008-09-11  6:30 ` [RFC 2/5] devcore adds generic wakeup event handler Shaohua Li
2008-09-11  6:30 ` [RFC 3/5] pci wakeup handler Shaohua Li
2008-09-11  6:30 ` [RFC 4/5] PCIe native PME detection Shaohua Li
2008-09-11  6:30 ` [RFC 5/5] ACPI GPE based wakeup event detection Shaohua Li
2008-09-14 23:50 ` [RFC 0/5] device wakeup event support v2 Rafael J. Wysocki
     [not found] ` <200809150150.01687.rjw@sisk.pl>
2008-10-06  1:57   ` Shaohua Li
     [not found] ` <20080911063822.973881418@sli10-desk.sh.intel.com>
2008-10-19 19:04   ` Rafael J. Wysocki [this message]
2008-10-19 19:42     ` [RFC 1/5] devcore introduce wakeup_event callback Rafael J. Wysocki
2008-10-22  5:23     ` Shaohua Li
     [not found] ` <20080911063823.083409592@sli10-desk.sh.intel.com>
2008-09-11 18:48   ` [RFC 2/5] devcore adds generic wakeup event handler Bjorn Helgaas
2008-10-19 19:06   ` Rafael J. Wysocki
     [not found]   ` <200810192106.58828.rjw@sisk.pl>
2008-10-22  5:24     ` Shaohua Li
     [not found]     ` <20081022052406.GB15271@sli10-desk.sh.intel.com>
2008-10-22 11:57       ` Rafael J. Wysocki
     [not found] ` <20080911063823.196887408@sli10-desk.sh.intel.com>
2008-10-19 19:50   ` [RFC 3/5] pci wakeup handler Rafael J. Wysocki
2008-10-22  5:34     ` Shaohua Li
     [not found]     ` <20081022053444.GC15271@sli10-desk.sh.intel.com>
2008-10-22 12:01       ` Rafael J. Wysocki
     [not found] ` <20080911063823.312142224@sli10-desk.sh.intel.com>
2008-10-19 20:30   ` [RFC 4/5] PCIe native PME detection Rafael J. Wysocki
2008-10-22  5:49     ` Shaohua Li
     [not found]     ` <20081022054907.GD15271@sli10-desk.sh.intel.com>
2008-10-22 12:08       ` Rafael J. Wysocki
     [not found] ` <20080911063823.432831198@sli10-desk.sh.intel.com>
2008-10-19 20:39   ` [RFC 5/5] ACPI GPE based wakeup event detection Rafael J. Wysocki
2008-10-22  6:51     ` Shaohua Li
     [not found]     ` <20081022065101.GE15271@sli10-desk.sh.intel.com>
2008-10-22 12:12       ` Rafael J. Wysocki
     [not found] <200809090852.59461.david-b@pacbell.net>
2008-09-09 18:39 ` [RFC 1/5] devcore introduce wakeup_event callback Alan Stern
     [not found] <Pine.LNX.4.44L0.0809091014010.2486-100000@iolanthe.rowland.org>
2008-09-09 15:52 ` David Brownell
     [not found] <200809091345.31785.rjw@sisk.pl>
2008-09-09 14:22 ` Alan Stern
     [not found] <20080908091926.785882370@sli10-desk.sh.intel.com>
2008-09-08  9:19 ` shaohua.li
     [not found] ` <20080908092305.221009807@sli10-desk.sh.intel.com>
2008-09-09  2:56   ` David Brownell
     [not found]   ` <200809081956.23522.david-b@pacbell.net>
2008-09-09  3:49     ` Li, Shaohua
     [not found]     ` <76780B19A496DC4B80439008DAD7076C01AC7F328B@PDSMSX501.ccr.corp.intel.com>
2008-09-09  5:26       ` David Brownell
     [not found]       ` <200809082226.11399.david-b@pacbell.net>
2008-09-09  8:36         ` Li, Shaohua
     [not found]         ` <76780B19A496DC4B80439008DAD7076C01AC7F34FC@PDSMSX501.ccr.corp.intel.com>
2008-09-09 11:45           ` Rafael J. Wysocki
2008-09-09 14:18         ` 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=200810192104.17510.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=dbrownell@users.sourceforge.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=shaohua.li@intel.com \
    /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