All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Zhao Yakui <yakui.zhao@intel.com>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Len Brown <lenb@kernel.org>,
	pm list <linux-pm@lists.linux-foundation.org>,
	Zhang Rui <rui.zhang@intel.com>, Andi Kleen <andi@firstfloor.org>
Subject: Re: [PATCH 6/8] PCI ACPI: Rework PCI handling of wake-up (rev. 3)
Date: Tue, 1 Jul 2008 15:57:20 +0200	[thread overview]
Message-ID: <200807011557.21707.rjw@sisk.pl> (raw)
In-Reply-To: <1214879200.31478.10.camel@yakui_zhao.sh.intel.com>

On Tuesday, 1 of July 2008, Zhao Yakui wrote:
> On Mon, 2008-06-30 at 12:19 +0200, Rafael J. Wysocki wrote:
> > On Monday, 30 of June 2008, Zhao Yakui wrote:
> > > On Sat, 2008-06-28 at 02:40 +0200, Rafael J. Wysocki wrote:
> > > > On Friday, 27 of June 2008, Rafael J. Wysocki wrote:
> > > > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > 
> > > > @@ -107,10 +113,15 @@ void acpi_disable_wakeup_device(u8 sleep
> > > >  	list_for_each_safe(node, next, &acpi_wakeup_device_list) {
> > > >  		struct acpi_device *dev =
> > > >  		    container_of(node, struct acpi_device, wakeup_list);
> > > > +		struct device *ldev;
> > > > +		bool wakeup_enabled;
> > > >  
> > > >  		if (!dev->wakeup.flags.valid)
> > > >  			continue;
> > > > -		if (!dev->wakeup.state.enabled ||
> > > > +		ldev = acpi_get_physical_device(dev->handle);
> > > > +		wakeup_enabled = dev->wakeup.state.enabled ||
> > > > +			(ldev ? device_may_wakeup(ldev) : false);
> > > > +		if (!wakeup_enabled ||
> > > >  		    sleep_state > (u32) dev->wakeup.sleep_state) {
> > > >  			if (dev->wakeup.flags.run_wake) {
> > > >  				spin_unlock(&acpi_device_lock);
> > > It seems that the device_init_wakeup(dev,1) will be called in many
> > > drivers regardless of userspace, which will enable the corresponding
> > > GPE. Maybe some laptops will be resumed immediately from the sleeping
> > > state.
> > > 
> > > Is it more reasonable that default state is set as "wake-up disabled" in
> > > driver and userspace can change it from "disabled" to "enabled"?
> > 
> > Yes, it is, IMO.
> > 
> > One possible way to make it happen is to modify device_init_wakeup() so that
> > it always clears power.should_wakeup.
> > 
> > Still, that may lead to functional "regressions", ie. if we do that, some
> > people will have to manually write "enable" to /sys/devices/.../power/wakeup to
> > make their usual wake-up devices work.
> What you said is right. If the power.should_wakeup is clear in
> device_init_wakeup, some people need to write "enable" so that the
> device can wake up the sleeping system. 
> But it can avoid that some system will be resumed immediately from the
> sleeping state.

I think I can override this issue by using the 'prepared' bit introduced in one
of the previous patches to check whether the GPE should be enabled.

While this won't solve the problem entirely, it will restrict it to the devices
that call pci_enable_wake(dev, state, true).

Please have a look at the next iteration of the patchset that I'm going to send
later today.

Thanks,
Rafael

  parent reply	other threads:[~2008-07-01 13:55 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-26 22:22 [PATCH 0/8] PCI PM: Handling of PCI devices wake-up functionality (rev. 2) Rafael J. Wysocki
2008-06-26 22:23 ` [PATCH 1/8] ACPI: Introduce acpi_bus_power_manageable function Rafael J. Wysocki
2008-06-26 22:23 ` Rafael J. Wysocki
2008-06-26 22:24 ` [PATCH 2/8] PCI: Introduce platform_pci_power_manageable function Rafael J. Wysocki
2008-06-26 22:24 ` Rafael J. Wysocki
2008-06-26 22:25 ` [PATCH 3/8] PCI: Rework pci_set_power_state function (rev. 4) Rafael J. Wysocki
2008-06-26 22:25 ` Rafael J. Wysocki
2008-06-26 22:26 ` [PATCH 4/8] ACPI: Introduce acpi_device_sleep_wake function Rafael J. Wysocki
2008-06-26 22:26 ` Rafael J. Wysocki
2008-06-26 22:27 ` [PATCH 5/8] ACPI: Introduce new device wakeup flag 'prepared' Rafael J. Wysocki
2008-06-26 22:27 ` Rafael J. Wysocki
2008-06-26 22:28 ` [PATCH 6/8] PCI ACPI: Rework PCI handling of wake-up Rafael J. Wysocki
2008-06-26 22:28 ` Rafael J. Wysocki
2008-06-27  2:08   ` Shaohua Li
2008-06-27 13:26     ` Rafael J. Wysocki
2008-06-27 15:12       ` Rafael J. Wysocki
2008-06-27 15:12       ` Rafael J. Wysocki
2008-06-27 13:26     ` Rafael J. Wysocki
2008-06-27  2:08   ` Shaohua Li
2008-06-28  0:40   ` [PATCH 6/8] PCI ACPI: Rework PCI handling of wake-up (rev. 3) Rafael J. Wysocki
2008-06-28  0:40   ` Rafael J. Wysocki
2008-06-30  2:05     ` Zhao Yakui
2008-06-30  2:05     ` Zhao Yakui
2008-06-30 10:19       ` Rafael J. Wysocki
2008-06-30 10:19       ` Rafael J. Wysocki
2008-07-01  2:26         ` Zhao Yakui
2008-07-01  2:26         ` Zhao Yakui
2008-07-01 13:57           ` Rafael J. Wysocki
2008-07-01 13:57           ` Rafael J. Wysocki [this message]
2008-06-26 22:29 ` [PATCH 7/8] PCI PM: Introduce pci_prepare_to_sleep and pci_back_from_sleep (rev. 2) Rafael J. Wysocki
2008-06-26 22:29 ` Rafael J. Wysocki
2008-06-26 22:31 ` [PATCH 8/8] PCI: Simplify PCI device PM code " Rafael J. Wysocki
2008-06-26 22:31 ` Rafael J. Wysocki
2008-06-27 16:39   ` Rafael J. Wysocki
2008-06-27 16:39   ` Rafael J. Wysocki
2008-06-28  0:42     ` [PATCH 8/8] PCI: Simplify PCI device PM code (rev. 4) Rafael J. Wysocki
2008-06-28  0:42     ` Rafael J. Wysocki

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=200807011557.21707.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=andi@firstfloor.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rui.zhang@intel.com \
    --cc=stern@rowland.harvard.edu \
    --cc=yakui.zhao@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 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.