Skip to contentSkip to conversation

/proc/acpi/wakeup regression in 2.6.39-rc3

DISCUSSION Tino Keitel 5 participants 17 messages Apr 14, 2011 – Apr 20, 2011

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

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?

Regards,
Tino

#1 lore raw
Quoted 5 lines · Tino Keitel

Hi,

with 2.6.38, I enabled wakeup from suspend to RAM with the USB keyboard this way:

Quoted 8 lines

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

#2 lore raw
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Tino Keitel

Hi,

with 2.6.38, I enabled wakeup from suspend to RAM with the USB keyboard this way:

echo USB2 > /proc/acpi/wakeup

Quoted 8 lines
Quoted 6 lines

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

#3 lore raw
In reply to Rafael J. Wysocki
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Tino Keitel

Hi,

with 2.6.38, I enabled wakeup from suspend to RAM with the USB keyboard this way:

echo USB2 > /proc/acpi/wakeup

Quoted 8 lines
Quoted 6 lines

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

#4 lore raw
Quoted 19 lines · Alan Stern
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Tino Keitel

Hi,

with 2.6.38, I enabled wakeup from suspend to RAM with the USB keyboard this way:

echo USB2 > /proc/acpi/wakeup

Quoted 8 lines
Quoted 6 lines

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.

Quoted 8 lines

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

#5 lore raw

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

#6 lore raw
Quoted 5 lines · Tino Keitel

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.

Quoted 8 lines

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

#7 lore raw
Quoted 12 lines · Rafael J. Wysocki
Quoted 5 lines · Tino Keitel

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.

Quoted 3 lines

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

Quoted 7 lines
Quoted 5 lines

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

#8 lore raw
In reply to Rafael J. Wysocki
Quoted 12 lines · Rafael J. Wysocki
Quoted 5 lines · Tino Keitel

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.

Quoted 3 lines

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

Quoted 7 lines
Quoted 5 lines

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

#9 lore raw
In reply to Tino Keitel
Quoted 5 lines · Tino Keitel

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.

Quoted 8 lines

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

#10 lore raw
In reply to Tino Keitel
Quoted 6 lines · Tino Keitel

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.

Quoted 8 lines

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(-)
drivers/base/power/main.c +1 -0
Index: 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);
 }
 
 /**
drivers/base/power/wakeup.c +1 -1
Index: 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;
#11 lore raw
In reply to Tino Keitel
Quoted 6 lines · Tino Keitel

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.

Quoted 8 lines

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(-)
drivers/base/power/main.c +1 -0
Index: 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);
 }
 
 /**
drivers/base/power/wakeup.c +1 -1
Index: 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;
#12 lore raw
In reply to Tino Keitel

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

#13 lore raw
In reply to Tino Keitel
Quoted 29 lines · Tino Keitel
Quoted 19 lines · Alan Stern
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Tino Keitel

Hi,

with 2.6.38, I enabled wakeup from suspend to RAM with the USB keyboard this way:

echo USB2 > /proc/acpi/wakeup

Quoted 8 lines
Quoted 6 lines

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.

Quoted 8 lines

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?

Quoted 6 lines

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

#14 lore raw
In reply to Tino Keitel
Quoted 29 lines · Tino Keitel
Quoted 19 lines · Alan Stern
Quoted 8 lines · Rafael J. Wysocki
Quoted 7 lines · Tino Keitel

Hi,

with 2.6.38, I enabled wakeup from suspend to RAM with the USB keyboard this way:

echo USB2 > /proc/acpi/wakeup

Quoted 8 lines
Quoted 6 lines

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.

Quoted 8 lines

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?

Quoted 6 lines

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

#15 lore raw
In reply to Tino Keitel
Quoted 5 lines · Tino Keitel

Hi,

with 2.6.38, I enabled wakeup from suspend to RAM with the USB keyboard this way:

Quoted 8 lines

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

#16 lore raw
In reply to Tino Keitel

I created a Bugzilla entry at
https://bugzilla.kernel.org/show_bug.cgi?id=33472
for your bug report, please add your address to the CC list in there, thanks!

Quoted 21 lines · On piątek, 15 kwietnia 2011 o 00:25:25 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?

Regards,
Tino
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 2 lines
Maciej Rutecki
http://www.maciek.unixy.pl