linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: /proc/acpi/wakeup regression in 2.6.39-rc3
       [not found] <20110414222525.GA24365@mac.home>
@ 2011-04-14 22:53 ` Rafael J. Wysocki
  2011-04-15 14:38   ` [linux-pm] " Alan Stern
  0 siblings, 1 reply; 8+ messages in thread
From: Rafael J. Wysocki @ 2011-04-14 22:53 UTC (permalink / raw)
  To: Tino Keitel; +Cc: linux-kernel, ACPI Devel Mailing List, Linux PM mailing list

On Friday, April 15, 2011, Tino Keitel wrote:
> Hi,
> 
> with 2.6.38, I enabled wakeup from suspend to RAM with the USB keyboard
> this way:
> 
> echo USB2 > /proc/acpi/wakeup
> 
> This does not work anymore with 2.6.39-rc3. Wakeup using the keyboard
> won't work, and the USB2 line in /proc/acpi/wakeup doesn't change to
> "enabled" after the echo command.
> 
> Is this intended? If yes, what is the new way to enable keyboard
> wakeup?

No, it's supposed to work IIRC.  I'll have a look at that code tomorrow.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-pm] /proc/acpi/wakeup regression in 2.6.39-rc3
  2011-04-14 22:53 ` /proc/acpi/wakeup regression in 2.6.39-rc3 Rafael J. Wysocki
@ 2011-04-15 14:38   ` Alan Stern
  2011-04-15 14:54     ` Tino Keitel
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Stern @ 2011-04-15 14:38 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Tino Keitel, ACPI Devel Mailing List, Linux PM mailing list,
	linux-kernel

On Fri, 15 Apr 2011, Rafael J. Wysocki wrote:

> On Friday, April 15, 2011, Tino Keitel wrote:
> > Hi,
> > 
> > with 2.6.38, I enabled wakeup from suspend to RAM with the USB keyboard
> > this way:
> > 
> > echo USB2 > /proc/acpi/wakeup
> > 
> > This does not work anymore with 2.6.39-rc3. Wakeup using the keyboard
> > won't work, and the USB2 line in /proc/acpi/wakeup doesn't change to
> > "enabled" after the echo command.
> > 
> > Is this intended? If yes, what is the new way to enable keyboard
> > wakeup?
> 
> No, it's supposed to work IIRC.  I'll have a look at that code tomorrow.

Tino, can you check the contents of the power/wakeup files in the
appropriate sysfs directories?  That would be the directory for the
keyboard device itself and the directory for the USB host controller
for the bus the keyboard is on.

By default, power/wakeup should be "enabled" for the keyboard device 
and "disabled" for the host controller.  If you write "enabled" into 
the host controller's file by hand, does that fix the problem?

Alan Stern


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-pm] /proc/acpi/wakeup regression in 2.6.39-rc3
  2011-04-15 14:38   ` [linux-pm] " Alan Stern
@ 2011-04-15 14:54     ` Tino Keitel
  2011-04-19 20:22       ` Tino Keitel
  2011-04-20 20:57       ` Rafael J. Wysocki
  0 siblings, 2 replies; 8+ messages in thread
From: Tino Keitel @ 2011-04-15 14:54 UTC (permalink / raw)
  To: Alan Stern
  Cc: Rafael J. Wysocki, ACPI Devel Mailing List, Linux PM mailing list,
	linux-kernel

On Fri, Apr 15, 2011 at 10:38:47 -0400, Alan Stern wrote:
> On Fri, 15 Apr 2011, Rafael J. Wysocki wrote:
> 
> > On Friday, April 15, 2011, Tino Keitel wrote:
> > > Hi,
> > > 
> > > with 2.6.38, I enabled wakeup from suspend to RAM with the USB keyboard
> > > this way:
> > > 
> > > echo USB2 > /proc/acpi/wakeup
> > > 
> > > This does not work anymore with 2.6.39-rc3. Wakeup using the keyboard
> > > won't work, and the USB2 line in /proc/acpi/wakeup doesn't change to
> > > "enabled" after the echo command.
> > > 
> > > Is this intended? If yes, what is the new way to enable keyboard
> > > wakeup?
> > 
> > No, it's supposed to work IIRC.  I'll have a look at that code tomorrow.
> 
> Tino, can you check the contents of the power/wakeup files in the
> appropriate sysfs directories?  That would be the directory for the
> keyboard device itself and the directory for the USB host controller
> for the bus the keyboard is on.
> 
> By default, power/wakeup should be "enabled" for the keyboard device 
> and "disabled" for the host controller.  If you write "enabled" into 
> the host controller's file by hand, does that fix the problem?

I already tried to write "enable" into all USB related wakeup files
yesterday, not change.

I'll check again how these files look like in 2.6.38, what sysfs
wakeup files change when writing into /proc/acpi/wakeup, and what
differences to 2.6.39-rc can be seen.

Regards,
Tino

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-pm] /proc/acpi/wakeup regression in 2.6.39-rc3
  2011-04-15 14:54     ` Tino Keitel
@ 2011-04-19 20:22       ` Tino Keitel
  2011-04-19 21:28         ` Rafael J. Wysocki
  2011-04-20 23:50         ` Rafael J. Wysocki
  2011-04-20 20:57       ` Rafael J. Wysocki
  1 sibling, 2 replies; 8+ messages in thread
From: Tino Keitel @ 2011-04-19 20:22 UTC (permalink / raw)
  To: Alan Stern, Rafael J. Wysocki, ACPI Devel Mailing List,
	Linux PM mailing list

Hi,

I reverted some wakeup and ACPI related commits. When I reverted commit
7fa69baf29de8c77a6b32c054df2abb8f11f8aa4, wakeup using the keyboard
worked again and /proc/acpi/wakeup behaved as expected.

So check this, I reverted the following commits to avoid conflicts and
build failures:

c19f9a84ec807da57fd75bbd9a3f2b8269611f79
5190726765b40774c069e187a958e10ccd970e65
2a5d24286e8bdafdc272b37ec5bdd9e977b3767c
f2b56bc808addb908a5bf435d9b942c02af9a7c4
7fa69baf29de8c77a6b32c054df2abb8f11f8aa4

Regards,
Tino

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-pm] /proc/acpi/wakeup regression in 2.6.39-rc3
  2011-04-19 20:22       ` Tino Keitel
@ 2011-04-19 21:28         ` Rafael J. Wysocki
  2011-04-20 20:34           ` Rafael J. Wysocki
  2011-04-20 23:50         ` Rafael J. Wysocki
  1 sibling, 1 reply; 8+ messages in thread
From: Rafael J. Wysocki @ 2011-04-19 21:28 UTC (permalink / raw)
  To: Tino Keitel
  Cc: Alan Stern, ACPI Devel Mailing List, Linux PM mailing list,
	linux-kernel

On Tuesday, April 19, 2011, Tino Keitel wrote:
> Hi,
> 
> I reverted some wakeup and ACPI related commits. When I reverted commit
> 7fa69baf29de8c77a6b32c054df2abb8f11f8aa4, wakeup using the keyboard
> worked again and /proc/acpi/wakeup behaved as expected.

Oh, I doubt that this particular one is the problem.

> So check this, I reverted the following commits to avoid conflicts and
> build failures:
> 
> c19f9a84ec807da57fd75bbd9a3f2b8269611f79
> 5190726765b40774c069e187a958e10ccd970e65
> 2a5d24286e8bdafdc272b37ec5bdd9e977b3767c
> f2b56bc808addb908a5bf435d9b942c02af9a7c4
> 7fa69baf29de8c77a6b32c054df2abb8f11f8aa4

OK, thanks for narrowing this down, I'll have a look at it shortly.

Rafael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-pm] /proc/acpi/wakeup regression in 2.6.39-rc3
  2011-04-19 21:28         ` Rafael J. Wysocki
@ 2011-04-20 20:34           ` Rafael J. Wysocki
  0 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2011-04-20 20:34 UTC (permalink / raw)
  To: Tino Keitel
  Cc: Alan Stern, ACPI Devel Mailing List, Linux PM mailing list,
	linux-kernel

On Tuesday, April 19, 2011, Rafael J. Wysocki wrote:
> On Tuesday, April 19, 2011, Tino Keitel wrote:
> > Hi,
> > 
> > I reverted some wakeup and ACPI related commits. When I reverted commit
> > 7fa69baf29de8c77a6b32c054df2abb8f11f8aa4, wakeup using the keyboard
> > worked again and /proc/acpi/wakeup behaved as expected.
> 
> Oh, I doubt that this particular one is the problem.
> 
> > So check this, I reverted the following commits to avoid conflicts and
> > build failures:
> > 
> > c19f9a84ec807da57fd75bbd9a3f2b8269611f79
> > 5190726765b40774c069e187a958e10ccd970e65
> > 2a5d24286e8bdafdc272b37ec5bdd9e977b3767c
> > f2b56bc808addb908a5bf435d9b942c02af9a7c4
> > 7fa69baf29de8c77a6b32c054df2abb8f11f8aa4
> 
> OK, thanks for narrowing this down, I'll have a look at it shortly.

I can reproduce the problem, but it seems to affect USB controllers only
and, interestingly enough, it doesn't affect the EHCI controller on my test
system.  So, it seems to be specific to USB at least to some extent.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-pm] /proc/acpi/wakeup regression in 2.6.39-rc3
  2011-04-15 14:54     ` Tino Keitel
  2011-04-19 20:22       ` Tino Keitel
@ 2011-04-20 20:57       ` Rafael J. Wysocki
  1 sibling, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2011-04-20 20:57 UTC (permalink / raw)
  To: Tino Keitel
  Cc: Alan Stern, ACPI Devel Mailing List, Linux PM mailing list,
	linux-kernel

On Friday, April 15, 2011, Tino Keitel wrote:
> On Fri, Apr 15, 2011 at 10:38:47 -0400, Alan Stern wrote:
> > On Fri, 15 Apr 2011, Rafael J. Wysocki wrote:
> > 
> > > On Friday, April 15, 2011, Tino Keitel wrote:
> > > > Hi,
> > > > 
> > > > with 2.6.38, I enabled wakeup from suspend to RAM with the USB keyboard
> > > > this way:
> > > > 
> > > > echo USB2 > /proc/acpi/wakeup
> > > > 
> > > > This does not work anymore with 2.6.39-rc3. Wakeup using the keyboard
> > > > won't work, and the USB2 line in /proc/acpi/wakeup doesn't change to
> > > > "enabled" after the echo command.
> > > > 
> > > > Is this intended? If yes, what is the new way to enable keyboard
> > > > wakeup?
> > > 
> > > No, it's supposed to work IIRC.  I'll have a look at that code tomorrow.
> > 
> > Tino, can you check the contents of the power/wakeup files in the
> > appropriate sysfs directories?  That would be the directory for the
> > keyboard device itself and the directory for the USB host controller
> > for the bus the keyboard is on.
> > 
> > By default, power/wakeup should be "enabled" for the keyboard device 
> > and "disabled" for the host controller.  If you write "enabled" into 
> > the host controller's file by hand, does that fix the problem?
> 
> I already tried to write "enable" into all USB related wakeup files
> yesterday, not change.
> 
> I'll check again how these files look like in 2.6.38, what sysfs
> wakeup files change when writing into /proc/acpi/wakeup, and what
> differences to 2.6.39-rc can be seen.

Please post the contents of /proc/acpi/wakeup (without reverting the commits
you have identified as "bad").

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [linux-pm] /proc/acpi/wakeup regression in 2.6.39-rc3
  2011-04-19 20:22       ` Tino Keitel
  2011-04-19 21:28         ` Rafael J. Wysocki
@ 2011-04-20 23:50         ` Rafael J. Wysocki
  1 sibling, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2011-04-20 23:50 UTC (permalink / raw)
  To: Tino Keitel
  Cc: Alan Stern, ACPI Devel Mailing List, Linux PM mailing list,
	linux-kernel, Greg Kroah-Hartman

On Tuesday, April 19, 2011, Tino Keitel wrote:
> Hi,
> 
> I reverted some wakeup and ACPI related commits. When I reverted commit
> 7fa69baf29de8c77a6b32c054df2abb8f11f8aa4, wakeup using the keyboard
> worked again and /proc/acpi/wakeup behaved as expected.
> 
> So check this, I reverted the following commits to avoid conflicts and
> build failures:
> 
> c19f9a84ec807da57fd75bbd9a3f2b8269611f79
> 5190726765b40774c069e187a958e10ccd970e65
> 2a5d24286e8bdafdc272b37ec5bdd9e977b3767c
> f2b56bc808addb908a5bf435d9b942c02af9a7c4
> 7fa69baf29de8c77a6b32c054df2abb8f11f8aa4

In fact, the problem is somewhere else.

It turns out that device_is_registered() may return true before
the device's "power" directory in sysfs is created, which causes
device_set_wakeup_capable() not to set dev->power.can_wakeup and
that's why the /proc/acpi/wakeup interface doesn't work for
some devices.

Please try the patch below, it should help.

Thanks,
Rafael

---
 drivers/base/power/main.c   |    1 +
 drivers/base/power/wakeup.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/base/power/main.c
===================================================================
--- linux-2.6.orig/drivers/base/power/main.c
+++ linux-2.6/drivers/base/power/main.c
@@ -63,6 +63,7 @@ void device_pm_init(struct device *dev)
 	dev->power.wakeup = NULL;
 	spin_lock_init(&dev->power.lock);
 	pm_runtime_init(dev);
+	INIT_LIST_HEAD(&dev->power.entry);
 }
 
 /**
Index: linux-2.6/drivers/base/power/wakeup.c
===================================================================
--- linux-2.6.orig/drivers/base/power/wakeup.c
+++ linux-2.6/drivers/base/power/wakeup.c
@@ -258,7 +258,7 @@ void device_set_wakeup_capable(struct de
 	if (!!dev->power.can_wakeup == !!capable)
 		return;
 
-	if (device_is_registered(dev)) {
+	if (device_is_registered(dev) && !list_empty(&dev->power.entry)) {
 		if (capable) {
 			if (wakeup_sysfs_add(dev))
 				return;

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-04-20 23:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20110414222525.GA24365@mac.home>
2011-04-14 22:53 ` /proc/acpi/wakeup regression in 2.6.39-rc3 Rafael J. Wysocki
2011-04-15 14:38   ` [linux-pm] " Alan Stern
2011-04-15 14:54     ` Tino Keitel
2011-04-19 20:22       ` Tino Keitel
2011-04-19 21:28         ` Rafael J. Wysocki
2011-04-20 20:34           ` Rafael J. Wysocki
2011-04-20 23:50         ` Rafael J. Wysocki
2011-04-20 20:57       ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).