From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: David Brownell <david-b@pacbell.net>
Cc: linux-pm@lists.linux-foundation.org, linux-acpi@vger.kernel.org,
Thomas Renninger <trenn@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
Len Brown <lenb@kernel.org>
Subject: Re: [RE-RESEND patch 2.6.25-git] acpi_pm_device_sleep_state() cleanup
Date: Tue, 29 Apr 2008 23:49:01 +0200 [thread overview]
Message-ID: <200804292349.02906.rjw@sisk.pl> (raw)
In-Reply-To: <200804291333.50054.david-b@pacbell.net>
On Tuesday, 29 of April 2008, David Brownell wrote:
> From: David Brownell <dbrownell@users.sourceforge.net>
>
> Get rid of a superfluous acpi_pm_device_sleep_state() parameter. The
> only legitimate value of that parameter must be derived from the first
> parameter, which is what all the callers already do. (However, this
> does not address the fact that ACPI *still* doesn't set up those flags.)
I picked up the previous version of this patch and I'm going to push it for
2.6.27. Is this version different from the previous one?
Rafael
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
> Acked-by: Pavel Machek <pavel@ucw.cz>
> ---
> It seems patches sent to the ACPI list are often ignored. This patch
> was sent against 2.6.25-rc6 for 2.6.26-rc0 merge, then resent 18-apr
> against 2.6.25 ... maybe the third time can finally do the trick.
>
> drivers/acpi/sleep/main.c | 8 ++++----
> drivers/pci/pci-acpi.c | 3 +--
> drivers/pnp/pnpacpi/core.c | 4 +---
> include/acpi/acpi_bus.h | 4 ++--
> 4 files changed, 8 insertions(+), 11 deletions(-)
>
> --- g26.orig/drivers/acpi/sleep/main.c 2008-04-18 19:26:19.000000000 -0700
> +++ g26/drivers/acpi/sleep/main.c 2008-04-18 20:08:23.000000000 -0700
> @@ -369,8 +369,8 @@ int acpi_suspend(u32 acpi_state)
> /**
> * acpi_pm_device_sleep_state - return preferred power state of ACPI device
> * in the system sleep state given by %acpi_target_sleep_state
> - * @dev: device to examine
> - * @wake: if set, the device should be able to wake up the system
> + * @dev: device to examine; its driver model wakeup flags control
> + * whether it should be able to wake up the system
> * @d_min_p: used to store the upper limit of allowed states range
> * Return value: preferred power state of the device on success, -ENODEV on
> * failure (ie. if there's no 'struct acpi_device' for @dev)
> @@ -388,7 +388,7 @@ int acpi_suspend(u32 acpi_state)
> * via @wake.
> */
>
> -int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
> +int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
> {
> acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
> struct acpi_device *adev;
> @@ -427,7 +427,7 @@ int acpi_pm_device_sleep_state(struct de
> * can wake the system. _S0W may be valid, too.
> */
> if (acpi_target_sleep_state == ACPI_STATE_S0 ||
> - (wake && adev->wakeup.state.enabled &&
> + (device_may_wakeup(dev) && adev->wakeup.state.enabled &&
> adev->wakeup.sleep_state <= acpi_target_sleep_state)) {
> acpi_status status;
>
> --- g26.orig/drivers/pci/pci-acpi.c 2008-04-18 19:26:19.000000000 -0700
> +++ g26/drivers/pci/pci-acpi.c 2008-04-18 20:08:23.000000000 -0700
> @@ -249,8 +249,7 @@ static pci_power_t acpi_pci_choose_state
> {
> int acpi_state;
>
> - acpi_state = acpi_pm_device_sleep_state(&pdev->dev,
> - device_may_wakeup(&pdev->dev), NULL);
> + acpi_state = acpi_pm_device_sleep_state(&pdev->dev, NULL);
> if (acpi_state < 0)
> return PCI_POWER_ERROR;
>
> --- g26.orig/drivers/pnp/pnpacpi/core.c 2008-04-18 19:26:19.000000000 -0700
> +++ g26/drivers/pnp/pnpacpi/core.c 2008-04-18 20:08:23.000000000 -0700
> @@ -132,9 +132,7 @@ static int pnpacpi_suspend(struct pnp_de
> {
> int power_state;
>
> - power_state = acpi_pm_device_sleep_state(&dev->dev,
> - device_may_wakeup(&dev->dev),
> - NULL);
> + power_state = acpi_pm_device_sleep_state(&dev->dev, NULL);
> if (power_state < 0)
> power_state = (state.event == PM_EVENT_ON) ?
> ACPI_STATE_D0 : ACPI_STATE_D3;
> --- g26.orig/include/acpi/acpi_bus.h 2008-04-18 19:26:19.000000000 -0700
> +++ g26/include/acpi/acpi_bus.h 2008-04-18 20:08:23.000000000 -0700
> @@ -376,9 +376,9 @@ acpi_handle acpi_get_pci_rootbridge_hand
> #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
>
> #ifdef CONFIG_PM_SLEEP
> -int acpi_pm_device_sleep_state(struct device *, int, int *);
> +int acpi_pm_device_sleep_state(struct device *, int *);
> #else /* !CONFIG_PM_SLEEP */
> -static inline int acpi_pm_device_sleep_state(struct device *d, int w, int *p)
> +static inline int acpi_pm_device_sleep_state(struct device *d, int *p)
> {
> if (p)
> *p = ACPI_STATE_D0;
> --
> 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
>
>
--
"Premature optimization is the root of all evil." - Donald Knuth
next prev parent reply other threads:[~2008-04-29 21:49 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-20 21:08 [patch 2.6.25-rc6 0/7] misc pm wake patches David Brownell
2008-03-20 21:09 ` [patch 2.6.25-rc6 1/7] crosslink ACPI and "real" device nodes David Brownell
2008-03-21 6:43 ` Zhao Yakui
2008-03-21 7:31 ` David Brownell
2008-03-21 8:34 ` Zhao Yakui
2008-03-21 9:04 ` David Brownell
2008-03-20 21:10 ` [patch 2.6.25-rc6 2/7] acpi_pm_device_sleep_state() cleanup David Brownell
2008-03-24 16:30 ` [linux-pm] " Pavel Machek
2008-04-19 4:11 ` [RESEND patch 2.6.25] " David Brownell
2008-04-29 20:33 ` [RE-RESEND patch 2.6.25-git] " David Brownell
2008-04-29 21:49 ` Rafael J. Wysocki [this message]
2008-04-29 22:12 ` David Brownell
2008-04-30 12:07 ` Rafael J. Wysocki
2008-03-20 21:12 ` [patch 2.6.25-rc6 3/7] pci_choose_state() cleanup and fixes David Brownell
2008-03-20 22:37 ` Rafael J. Wysocki
2008-03-20 23:03 ` David Brownell
2008-03-21 0:22 ` Rafael J. Wysocki
2008-03-21 0:55 ` [linux-pm] " Alan Stern
2008-03-21 1:47 ` Rafael J. Wysocki
2008-03-21 8:15 ` David Brownell
2008-03-21 16:23 ` Rafael J. Wysocki
2008-03-22 17:55 ` David Brownell
2008-03-22 18:11 ` Rafael J. Wysocki
2008-03-22 18:29 ` David Brownell
2008-03-21 7:53 ` David Brownell
2008-03-21 16:38 ` Rafael J. Wysocki
2008-03-22 17:49 ` David Brownell
2008-03-22 18:34 ` Rafael J. Wysocki
2008-04-14 4:59 ` David Brownell
2008-03-20 21:15 ` [patch 2.6.25-rc6 4/7] USB uses pci_choose_state() David Brownell
2008-03-20 21:20 ` [patch 2.6.25-rc6 5/7] ACPI sets up device.power.can_wakeup flags David Brownell
2008-03-21 7:43 ` Zhao Yakui
2008-04-19 4:14 ` [RESEND patch 2.6.25] " David Brownell
2008-04-22 2:48 ` Zhang Rui
2008-03-20 21:22 ` [patch 2.6.25-rc6 6/7] ACPI uses device_may_wakeup() policy inputs David Brownell
2008-04-19 4:18 ` [RESEND patch 2.6.25] " David Brownell
2008-04-22 2:42 ` Zhang Rui
2008-04-26 19:29 ` David Brownell
2008-04-22 13:30 ` Zhao Yakui
2008-04-26 19:37 ` David Brownell
2008-04-28 12:48 ` Zhao Yakui
2008-04-28 8:50 ` Zhang Rui
2008-04-28 13:43 ` [linux-pm] " Alan Stern
2008-04-29 23:38 ` David Brownell
2008-04-30 13:58 ` Alan Stern
2008-05-14 14:56 ` Pavel Machek
2008-04-28 22:28 ` David Brownell
2008-04-28 21:35 ` Henrique de Moraes Holschuh
2008-04-28 22:20 ` David Brownell
2008-04-28 22:54 ` Henrique de Moraes Holschuh
2008-04-29 0:20 ` David Brownell
2008-04-29 20:32 ` David Brownell
2008-04-28 22:24 ` David Brownell
2008-04-28 22:26 ` David Brownell
2008-03-20 21:25 ` [patch 2.6.25-rc6 7/7] PCI set up device.power.can_wakeup flags David Brownell
2008-03-20 21:53 ` [linux-pm] " Alan Stern
2008-03-20 22:22 ` David Brownell
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=200804292349.02906.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=akpm@linux-foundation.org \
--cc=david-b@pacbell.net \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=trenn@suse.de \
/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