All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: shaohua.li@intel.com
Cc: linux-pm@lists.linux-foundation.org, linux-acpi@vger.kernel.org,
	stern@rowland.harvard.edu
Subject: Re: [RFC 1/5] devcore introduce wakeup_event callback
Date: Mon, 8 Sep 2008 19:56:23 -0700	[thread overview]
Message-ID: <200809081956.23522.david-b@pacbell.net> (raw)
In-Reply-To: <20080908092305.221009807@sli10-desk.sh.intel.com>

On Monday 08 September 2008, shaohua.li@intel.com wrote:
> --- linux.orig/include/linux/pm.h       2008-09-08 13:55:57.000000000 +0800
> +++ linux/include/linux/pm.h    2008-09-08 13:56:51.000000000 +0800
> @@ -125,6 +125,8 @@ 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. If yes, wakeup event should
> + *      be disabled.

And ... what else??  What does the return value indicate?
Should anything be done with it other than printing it out
if it's nonzero and we're debugging?


>   *
>   * All of the above callbacks, except for @complete(), return error codes.
>   * However, the error codes returned by the resume operations, @resume(),
> @@ -151,6 +153,7 @@ struct pm_ops {
>         int (*thaw)(struct device *dev);
>         int (*poweroff)(struct device *dev);
>         int (*restore)(struct device *dev);
> +       int (*wakeup_event)(struct device *dev);

My reaction to adding this method is:  why do it here rather
than at the bus level?

In my particular experience there are two basic types of wakeup
event:

  - Regular IRQs.  Common on SOC systems; the IRQ comes in,
    the driver knows it must wake up.  Does not need any
    driver model hook; enable_irq_wake()/disable_irq_wake()
    suffice.

    I've seen USB remote wakeup working just fine on several
    different embedded Linuxes using only regular IRQ hooks.

  - Side-band signaling.  Think of this as an IRQ mechanism
    that's not used for "normal" driver operation, and you
    won't be far off.  Examples:

     * PCI PME# (and its PCIE analogue).  Bus-specific; it's
       pretty much a kind of shared IRQ line coupled with a
       special config-space register protocol.

     * ACPI GPEs.  Bus-specific ... and similar to GPIO IRQs.
       Also sharable; bytecode is used to map the GPE and
       some register state to the ACPI device(s) which
       issued that GPE.

     * Pin-change events.  Not quite isomorphic with (GPIO)
       IRQs; sometimes used with pins that aren't used for
       events (or even GPIOs!) during normal operation.
       Device-specific.

That is, I don't see why these events should expect to be
filtered through the driver core.  If there's a reason to
do that, please enlighten me!

- Dave

p.s. Related to this, I don't see the point behind
     patch 2/5 ...


>  };
>  
>  /**


--
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

  parent reply	other threads:[~2008-09-09  3:03 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08  9:19 [RFC 0/5] device wakeup event support shaohua.li
2008-09-08  9:19 ` [RFC 1/5] devcore introduce wakeup_event callback shaohua.li
2008-09-08  9:19 ` shaohua.li
2008-09-09  2:56   ` David Brownell
2008-09-09  2:56   ` David Brownell [this message]
2008-09-09  3:49     ` Li, Shaohua
2008-09-09  5:26       ` David Brownell
2008-09-09  8:36         ` Li, Shaohua
2008-09-09  8:36         ` Li, Shaohua
2008-09-09 11:45           ` Rafael J. Wysocki
2008-09-09 14:22             ` Alan Stern
2008-09-09 14:22             ` Alan Stern
2008-09-09 11:45           ` Rafael J. Wysocki
2008-09-09 14:18         ` Alan Stern
2008-09-09 14:18         ` Alan Stern
2008-09-09 15:52           ` David Brownell
2008-09-09 15:52           ` David Brownell
2008-09-09 18:39             ` Alan Stern
2008-09-09 18:39             ` Alan Stern
2008-09-09  5:26       ` David Brownell
2008-09-09  3:49     ` Li, Shaohua
2008-09-08  9:19 ` [RFC 2/5] devcore adds generic wakeup event handler shaohua.li
2008-09-08  9:19 ` shaohua.li
2008-09-08  9:19 ` [RFC 3/5] pci wakeup handler shaohua.li
2008-09-08 13:09   ` Rafael J. Wysocki
2008-09-08 13:09   ` Rafael J. Wysocki
2008-09-09  1:44     ` Li, Shaohua
2008-09-09  2:56       ` David Brownell
2008-09-09  2:56       ` David Brownell
2008-09-09  3:38         ` Li, Shaohua
2008-09-09  3:38         ` Li, Shaohua
2008-09-09  1:44     ` Li, Shaohua
2008-09-09  2:56   ` David Brownell
2008-09-09  2:56   ` David Brownell
2008-09-09  3:33     ` Li, Shaohua
2008-09-09  3:33     ` Li, Shaohua
2008-09-09  4:04       ` David Brownell
2008-09-09  4:04       ` David Brownell
2008-09-09 11:09     ` Rafael J. Wysocki
2008-09-09 11:09     ` Rafael J. Wysocki
2008-09-09 16:18       ` David Brownell
2008-09-09 16:18       ` David Brownell
2008-09-08  9:19 ` shaohua.li
2008-09-08  9:19 ` [RFC 4/5] PCIe native PME detection shaohua.li
2008-09-08 21:36   ` Rafael J. Wysocki
2008-09-08 21:36   ` Rafael J. Wysocki
2008-09-09  1:21     ` Li, Shaohua
2008-09-09  1:21     ` Li, Shaohua
2008-09-08  9:19 ` shaohua.li
2008-09-08  9:19 ` [RFC 5/5] ACPI GPE based wakeup event detection shaohua.li
2008-09-08 20:57   ` Rafael J. Wysocki
2008-09-09  1:13     ` Zhao Yakui
2008-09-09  1:13     ` Zhao Yakui
2008-09-09  1:08       ` Li, Shaohua
2008-09-09  1:08       ` Li, Shaohua
2008-09-09 11:17         ` Rafael J. Wysocki
2008-09-09 11:17         ` Rafael J. Wysocki
2008-09-09 14:08       ` Alan Stern
2008-09-09 14:08       ` Alan Stern
2008-09-08 20:57   ` Rafael J. Wysocki
2008-09-08  9:19 ` shaohua.li
2008-09-09  2:41 ` [RFC 0/5] device wakeup event support David Brownell
2008-09-09  2:41 ` David Brownell
2008-09-09  3:54   ` Li, Shaohua
2008-09-09  3:54   ` Li, Shaohua
  -- strict thread matches above, loose matches on Subject: below --
2008-09-11  6:30 [RFC 0/5] device wakeup event support v2 Shaohua Li
2008-09-11  6:30 ` [RFC 1/5] devcore introduce wakeup_event callback Shaohua Li
2008-10-19 19:04   ` Rafael J. Wysocki
2008-10-19 19:42     ` Rafael J. Wysocki
2008-10-19 19:42     ` Rafael J. Wysocki
2008-10-22  5:23     ` Shaohua Li
2008-10-22  5:23     ` Shaohua Li
2008-09-11  6:30 ` Shaohua Li

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=200809081956.23522.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=shaohua.li@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.