Two problems with system sleep
Subsystems (5)
Quoted 1 line · Rafael J. Wysocki
Quoted 1 line
Quoted 1 line
Anyway, we need to check if control gets back to
acpi_suspend_enter().
Would PM_TRACE_RTC help? What would I have to add in order to insert an appropriate tracepoint?
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
BTW, does anything change if you put acpi_sleep=sci_force_enable into the kernel command line?
Nothing changes. I also added "pci=use_crs", based on a suggestion in the log, but that didn't make any difference either.
The failure to resume may be graphics-related, so please try to compile i915 statically into the kernel and set
CONFIG_DRM_I915_KMS.
Odd -- when I use "make menuconfig", that part of the menu doesn't show up. Navigating through "Device Drivers -> Graphics support" gives me this screen:
<*> /dev/agpgart (AGP Support) --->
<*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI suppor
-*- Lowlevel video output switch controls
-*- Support for frame buffer devices --->
[ ] Backlight & LCD device support --->
Display device support --->
Console display driver support --->
[ ] Bootup logo ---> None of the entries in drivers/gpu/drm/Kconfig show up beyond the first one. I had to go in and edit .config by hand to set CONFIG_DRM, CONFIG_DRM_KMS_HELPER, CONFIG_DRM_I915, and CONFIG_DRM_I915_KMS all to "y". Is this a bug in menuconfig? CC'ing the mailing list...
Anyway, it didn't make any difference. The behavior was exactly the same. Pressing the power button during suspend causes an almost-instant hang, before the screen or anything else revives.
By concentrating on the video drivers, you may be missing part of the problem. Have you considered why pressing a key on the keyboard doesn't wake the system up? Nothing happens -- the power LED on the desktop case just keeps on blinking.
Alan Stern
Quoted 1 line · Rafael J. Wysocki
Quoted 1 line
Quoted 1 line
Anyway, we need to check if control gets back to
acpi_suspend_enter().
Would PM_TRACE_RTC help? What would I have to add in order to insert an appropriate tracepoint?
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
BTW, does anything change if you put acpi_sleep=sci_force_enable into the kernel command line?
Nothing changes. I also added "pci=use_crs", based on a suggestion in the log, but that didn't make any difference either.
The failure to resume may be graphics-related, so please try to compile i915 statically into the kernel and set
CONFIG_DRM_I915_KMS.
Odd -- when I use "make menuconfig", that part of the menu doesn't show up. Navigating through "Device Drivers -> Graphics support" gives me this screen:
<*> /dev/agpgart (AGP Support) --->
<*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI suppor
-*- Lowlevel video output switch controls
-*- Support for frame buffer devices --->
[ ] Backlight & LCD device support --->
Display device support --->
Console display driver support --->
[ ] Bootup logo ---> None of the entries in drivers/gpu/drm/Kconfig show up beyond the first one. I had to go in and edit .config by hand to set CONFIG_DRM, CONFIG_DRM_KMS_HELPER, CONFIG_DRM_I915, and CONFIG_DRM_I915_KMS all to "y". Is this a bug in menuconfig? CC'ing the mailing list...
Anyway, it didn't make any difference. The behavior was exactly the same. Pressing the power button during suspend causes an almost-instant hang, before the screen or anything else revives.
By concentrating on the video drivers, you may be missing part of the problem. Have you considered why pressing a key on the keyboard doesn't wake the system up? Nothing happens -- the power LED on the desktop case just keeps on blinking.
Alan Stern
Quoted 5 lines · Alan Stern
Quoted 1 line · Rafael J. Wysocki
Quoted 1 line
Quoted 1 line
Anyway, we need to check if control gets back to
acpi_suspend_enter().Would
PM_TRACE_RTChelp?
In my opinion that's worth doing.
Quoted 1 line
What would I have to add in order to insert an appropriate tracepoint?
Please follow Documentation/power/s2ram.txt .
Quoted 27 lines
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
BTW, does anything change if you put acpi_sleep=sci_force_enable into the kernel command line?
Nothing changes. I also added "pci=use_crs", based on a suggestion in the log, but that didn't make any difference either.
The failure to resume may be graphics-related, so please try to compile i915 statically into the kernel and set
CONFIG_DRM_I915_KMS.Odd -- when I use "make menuconfig", that part of the menu doesn't show up. Navigating through "Device Drivers -> Graphics support" gives me this screen:
<*> /dev/agpgart (AGP Support) ---> <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI suppor -*- Lowlevel video output switch controls -*- Support for frame buffer devices ---> [ ] Backlight & LCD device support ---> Display device support ---> Console display driver support ---> [ ] Bootup logo --->None of the entries in
drivers/gpu/drm/Kconfigshow up beyond the first one. I had to go in and edit .config by hand to setCONFIG_DRM,CONFIG_DRM_KMS_HELPER,CONFIG_DRM_I915, andCONFIG_DRM_I915_KMSall to "y". Is this a bug in menuconfig? CC'ing the mailing list...
Quoted 8 lines
Anyway, it didn't make any difference. The behavior was exactly the same. Pressing the power button during suspend causes an almost-instant hang, before the screen or anything else revives.
By concentrating on the video drivers, you may be missing part of the problem. Have you considered why pressing a key on the keyboard doesn't wake the system up? Nothing happens -- the power LED on the desktop case just keeps on blinking.
We may just not set up the keyboard as a wakeup device. The other option is that the BIOS has a problem with resume handling, in which case I have no idea what to do.
Rafael
Quoted 5 lines · Alan Stern
Quoted 1 line · Rafael J. Wysocki
Quoted 1 line
Quoted 1 line
Anyway, we need to check if control gets back to
acpi_suspend_enter().Would
PM_TRACE_RTChelp?
In my opinion that's worth doing.
Quoted 1 line
What would I have to add in order to insert an appropriate tracepoint?
Please follow Documentation/power/s2ram.txt .
Quoted 27 lines
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
BTW, does anything change if you put acpi_sleep=sci_force_enable into the kernel command line?
Nothing changes. I also added "pci=use_crs", based on a suggestion in the log, but that didn't make any difference either.
The failure to resume may be graphics-related, so please try to compile i915 statically into the kernel and set
CONFIG_DRM_I915_KMS.Odd -- when I use "make menuconfig", that part of the menu doesn't show up. Navigating through "Device Drivers -> Graphics support" gives me this screen:
<*> /dev/agpgart (AGP Support) ---> <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI suppor -*- Lowlevel video output switch controls -*- Support for frame buffer devices ---> [ ] Backlight & LCD device support ---> Display device support ---> Console display driver support ---> [ ] Bootup logo --->None of the entries in
drivers/gpu/drm/Kconfigshow up beyond the first one. I had to go in and edit .config by hand to setCONFIG_DRM,CONFIG_DRM_KMS_HELPER,CONFIG_DRM_I915, andCONFIG_DRM_I915_KMSall to "y". Is this a bug in menuconfig? CC'ing the mailing list...
Quoted 8 lines
Anyway, it didn't make any difference. The behavior was exactly the same. Pressing the power button during suspend causes an almost-instant hang, before the screen or anything else revives.
By concentrating on the video drivers, you may be missing part of the problem. Have you considered why pressing a key on the keyboard doesn't wake the system up? Nothing happens -- the power LED on the desktop case just keeps on blinking.
We may just not set up the keyboard as a wakeup device. The other option is that the BIOS has a problem with resume handling, in which case I have no idea what to do.
Rafael
Quoted 8 lines · Rafael J. Wysocki
Quoted 5 lines · Alan Stern
Quoted 1 line · Rafael J. Wysocki
Quoted 1 line
Quoted 1 line
Anyway, we need to check if control gets back to
acpi_suspend_enter().Would
PM_TRACE_RTChelp?In my opinion that's worth doing.
Here's what I got:
[ 3.349334] PM: Resume from disk failed. [ 3.350060] Magic number: 0:141:321 [ 3.352583] hash matches drivers/base/power/main.c:477 [ 3.355144] tty tty46: hash matches [ 3.357742] i915 0000:00:02.0: hash matches
So it appears that the video driver is indeed the culprit. Is there any way to narrow it down further?
Quoted 8 lines
Quoted 4 lines
By concentrating on the video drivers, you may be missing part of the problem. Have you considered why pressing a key on the keyboard doesn't wake the system up? Nothing happens -- the power LED on the desktop case just keeps on blinking.
We may just not set up the keyboard as a wakeup device. The other option is that the BIOS has a problem with resume handling, in which case I have no idea what to do.
Here's my /proc/acpi/wakeup:
Device S-state Status Sysfs node
P0P4 S4 disabled pci:0000:00:1e.0 MC97 S4 disabled USB1 S4 disabled pci:0000:00:1d.0 USB2 S4 disabled pci:0000:00:1d.1 USB3 S4 disabled pci:0000:00:1d.2 USB4 S4 disabled pci:0000:00:1d.3 EUSB S4 disabled pci:0000:00:1d.7 PS2K S4 disabled pnp:00:09 PS2M S4 disabled pnp:00:0a GBEN S4 disabled
It appears that PS2K is the keyboard. If I write "PS2K" to /proc/acpi/wakeup, I get:
ACPI: 'PS2M' and 'PS2K' have the same GPE, can't disable/enable one seperately
Apart from the misspelling, this doesn't bode well for making the keyboard a wakeup device. Furthermore, these values are not properly tied to the values in sysfs. For example, after
echo enabled >/sys/devices/pci0000:00/0000:00:1d.7/power/wakeup
the EUSB line in /proc/acpi/wakeup still says disabled.
What next?
Alan Stern
Quoted 13 lines · Alan Stern
Quoted 8 lines · Rafael J. Wysocki
Quoted 5 lines · Alan Stern
Quoted 1 line · Rafael J. Wysocki
Quoted 1 line
Quoted 1 line
Anyway, we need to check if control gets back to
acpi_suspend_enter().Would
PM_TRACE_RTChelp?In my opinion that's worth doing.
Here's what I got:
Quoted 8 lines
[ 3.349334] PM: Resume from disk failed. [ 3.350060] Magic number: 0:141:321 [ 3.352583] hash matches drivers/base/power/main.c:477 [ 3.355144] tty tty46: hash matches [ 3.357742] i915 0000:00:02.0: hash matchesSo it appears that the video driver is indeed the culprit. Is there any way to narrow it down further?
Not without adding some debug code to the driver.
Which version of the kernel is this?
Quoted 23 lines
Quoted 8 lines
Quoted 4 lines
By concentrating on the video drivers, you may be missing part of the problem. Have you considered why pressing a key on the keyboard doesn't wake the system up? Nothing happens -- the power LED on the desktop case just keeps on blinking.
We may just not set up the keyboard as a wakeup device. The other option is that the BIOS has a problem with resume handling, in which case I have no idea what to do.
Here's my
/proc/acpi/wakeup:Device S-state Status Sysfs node
P0P4 S4 disabled pci:0000:00:1e.0 MC97 S4 disabled USB1 S4 disabled pci:0000:00:1d.0 USB2 S4 disabled pci:0000:00:1d.1 USB3 S4 disabled pci:0000:00:1d.2 USB4 S4 disabled pci:0000:00:1d.3 EUSB S4 disabled pci:0000:00:1d.7 PS2K S4 disabled pnp:00:09 PS2M S4 disabled pnp:00:0a GBEN S4 disabled
Quoted 7 lines
It appears that PS2K is the keyboard. If I write "PS2K" to
/proc/acpi/wakeup, I get:ACPI: 'PS2M' and 'PS2K' have the same GPE, can't disable/enable one seperately
Apart from the misspelling, this doesn't bode well for making the keyboard a wakeup device.
This only means both will be enabled at the same time.
Quoted 1 line
Furthermore, these values are not properly tied to the values in sysfs.
They are independent and the sysfs values probably don't matter for these devices. What are the contents of /proc/acpi/wakeup after writing PS2K to it?
Rafael
Quoted 8 lines · Rafael J. Wysocki
Quoted 8 lines
Here's what I got:
[ 3.349334] PM: Resume from disk failed. [ 3.350060] Magic number: 0:141:321 [ 3.352583] hash matches drivers/base/power/main.c:477 [ 3.355144] tty tty46: hash matches [ 3.357742] i915 0000:00:02.0: hash matches
Quoted 6 lines
Quoted 2 lines
So it appears that the video driver is indeed the culprit. Is there any way to narrow it down further?
Not without adding some debug code to the driver.
Which version of the kernel is this?
2.6.33-rc8. The same problem occurs with earlier versions, such as Fedora 12's 2.6.31.9 (which is what I'm running now).
Quoted 22 lines
Quoted 14 lines
Here's my
/proc/acpi/wakeup:Device S-state Status Sysfs node
P0P4 S4 disabled pci:0000:00:1e.0 MC97 S4 disabled USB1 S4 disabled pci:0000:00:1d.0 USB2 S4 disabled pci:0000:00:1d.1 USB3 S4 disabled pci:0000:00:1d.2 USB4 S4 disabled pci:0000:00:1d.3 EUSB S4 disabled pci:0000:00:1d.7 PS2K S4 disabled pnp:00:09 PS2M S4 disabled pnp:00:0a GBEN S4 disabledQuoted 7 lines
It appears that PS2K is the keyboard. If I write "PS2K" to
/proc/acpi/wakeup, I get:ACPI: 'PS2M' and 'PS2K' have the same GPE, can't disable/enable one seperately
Apart from the misspelling, this doesn't bode well for making the keyboard a wakeup device.
Quoted 6 lines
This only means both will be enabled at the same time.
Quoted 1 line
Furthermore, these values are not properly tied to the values in sysfs.
They are independent and the sysfs values probably don't matter for these devices. What are the contents of
/proc/acpi/wakeupafter writing PS2K to it?
Unchanged -- both PS2K and PS2M continue to be disabled.
Why are the values independent from the wakeup settings in sysfs? Aren't they supposed to mean the same thing?
Alan Stern
Quoted 13 lines · you
Quoted 11 lines · Rafael J. Wysocki
Quoted 10 lines
Here's what I got:
[ 3.349334] PM: Resume from disk failed. [ 3.350060] Magic number: 0:141:321 [ 3.352583] hash matches drivers/base/power/main.c:477 [ 3.355144] tty tty46: hash matches [ 3.357742] i915 0000:00:02.0: hash matchesSo it appears that the video driver is indeed the culprit. Is there any way to narrow it down further?
Quoted 6 lines
Quoted 3 lines
Not without adding some debug code to the driver.
Which version of the kernel is this?
2.6.33-rc8. The same problem occurs with earlier versions, such as Fedora 12's 2.6.31.9 (which is what I'm running now).
I _think_ think the i915 KMS doesn't work on your box for some reason.
Doesn the screen switch to the graphics framebuffer when booted with vga=0?
If not, you probably need to enable framebuffer console in .config (the i915 KMS depends on that actually).
Quoted 22 lines
Quoted 22 lines
Quoted 21 lines
Here's my
/proc/acpi/wakeup:Device S-state Status Sysfs node
P0P4 S4 disabled pci:0000:00:1e.0 MC97 S4 disabled USB1 S4 disabled pci:0000:00:1d.0 USB2 S4 disabled pci:0000:00:1d.1 USB3 S4 disabled pci:0000:00:1d.2 USB4 S4 disabled pci:0000:00:1d.3 EUSB S4 disabled pci:0000:00:1d.7 PS2K S4 disabled pnp:00:09 PS2M S4 disabled pnp:00:0a GBEN S4 disabledIt appears that PS2K is the keyboard. If I write "PS2K" to
/proc/acpi/wakeup, I get:ACPI: 'PS2M' and 'PS2K' have the same GPE, can't disable/enable one seperately
Apart from the misspelling, this doesn't bode well for making the keyboard a wakeup device.
Quoted 8 lines
Quoted 6 lines
This only means both will be enabled at the same time.
Quoted 1 line
Furthermore, these values are not properly tied to the values in sysfs.
They are independent and the sysfs values probably don't matter for these devices. What are the contents of
/proc/acpi/wakeupafter writing PS2K to it?Unchanged -- both PS2K and PS2M continue to be disabled.
That sounds like a bug. Please try to write 'PS2M' to it too.
Quoted 2 lines
Why are the values independent from the wakeup settings in sysfs? Aren't they supposed to mean the same thing?
Not really. There are two separate flags for wakeup. One of them is a property of the "physical" device object (eg. PCI device structure) and that one is set/unset via sysfs. The other is a property of the device's ACPI "shadow" object and is set/unset through /proc/acpi/wakeup (this mechanism is regarded as obsolete, but it looks like some devices have not been converted to the sysfs-based one yet).
Rafael
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
Quoted 13 lines · you
Quoted 11 lines · Rafael J. Wysocki
Quoted 10 lines
Here's what I got:
[ 3.349334] PM: Resume from disk failed. [ 3.350060] Magic number: 0:141:321 [ 3.352583] hash matches drivers/base/power/main.c:477 [ 3.355144] tty tty46: hash matches [ 3.357742] i915 0000:00:02.0: hash matchesSo it appears that the video driver is indeed the culprit. Is there any way to narrow it down further?
Quoted 6 lines
Quoted 3 lines
Not without adding some debug code to the driver.
Which version of the kernel is this?
2.6.33-rc8. The same problem occurs with earlier versions, such as Fedora 12's 2.6.31.9 (which is what I'm running now).
I _think_ think the i915 KMS doesn't work on your box for some reason.
Doesn the screen switch to the graphics framebuffer when booted with vga=0?
If not, you probably need to enable framebuffer console in .config (the i915 KMS depends on that actually).
Quoted 22 lines
Quoted 22 lines
Quoted 21 lines
Here's my
/proc/acpi/wakeup:Device S-state Status Sysfs node
P0P4 S4 disabled pci:0000:00:1e.0 MC97 S4 disabled USB1 S4 disabled pci:0000:00:1d.0 USB2 S4 disabled pci:0000:00:1d.1 USB3 S4 disabled pci:0000:00:1d.2 USB4 S4 disabled pci:0000:00:1d.3 EUSB S4 disabled pci:0000:00:1d.7 PS2K S4 disabled pnp:00:09 PS2M S4 disabled pnp:00:0a GBEN S4 disabledIt appears that PS2K is the keyboard. If I write "PS2K" to
/proc/acpi/wakeup, I get:ACPI: 'PS2M' and 'PS2K' have the same GPE, can't disable/enable one seperately
Apart from the misspelling, this doesn't bode well for making the keyboard a wakeup device.
Quoted 8 lines
Quoted 6 lines
This only means both will be enabled at the same time.
Quoted 1 line
Furthermore, these values are not properly tied to the values in sysfs.
They are independent and the sysfs values probably don't matter for these devices. What are the contents of
/proc/acpi/wakeupafter writing PS2K to it?Unchanged -- both PS2K and PS2M continue to be disabled.
That sounds like a bug. Please try to write 'PS2M' to it too.
Quoted 2 lines
Why are the values independent from the wakeup settings in sysfs? Aren't they supposed to mean the same thing?
Not really. There are two separate flags for wakeup. One of them is a property of the "physical" device object (eg. PCI device structure) and that one is set/unset via sysfs. The other is a property of the device's ACPI "shadow" object and is set/unset through /proc/acpi/wakeup (this mechanism is regarded as obsolete, but it looks like some devices have not been converted to the sysfs-based one yet).
Rafael
Quoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · you
Quoted 14 lines · Rafael J. Wysocki
Quoted 10 lines
Here's what I got:
[ 3.349334] PM: Resume from disk failed. [ 3.350060] Magic number: 0:141:321 [ 3.352583] hash matches drivers/base/power/main.c:477 [ 3.355144] tty tty46: hash matches [ 3.357742] i915 0000:00:02.0: hash matchesSo it appears that the video driver is indeed the culprit. Is there any way to narrow it down further?
Not without adding some debug code to the driver.
Which version of the kernel is this?
Quoted 7 lines
Quoted 2 lines
2.6.33-rc8. The same problem occurs with earlier versions, such as Fedora 12's 2.6.31.9 (which is what I'm running now).
I _think_ think the i915 KMS doesn't work on your box for some reason.
Doesn the screen switch to the graphics framebuffer when booted with vga=0?
Yes, it does switch.
Quoted 2 lines
If not, you probably need to enable framebuffer console in .config (the i915 KMS depends on that actually).
It's already enabled. That is, CONFIG_FB andCONFIG_FRAMEBUFFER_CONSOLE are both set to 'y'.
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 14 lines
Here's my
/proc/acpi/wakeup:Device S-state Status Sysfs node
P0P4 S4 disabled pci:0000:00:1e.0 MC97 S4 disabled USB1 S4 disabled pci:0000:00:1d.0 USB2 S4 disabled pci:0000:00:1d.1 USB3 S4 disabled pci:0000:00:1d.2 USB4 S4 disabled pci:0000:00:1d.3 EUSB S4 disabled pci:0000:00:1d.7 PS2K S4 disabled pnp:00:09 PS2M S4 disabled pnp:00:0a GBEN S4 disabledQuoted 7 lines
It appears that PS2K is the keyboard. If I write "PS2K" to
/proc/acpi/wakeup, I get:ACPI: 'PS2M' and 'PS2K' have the same GPE, can't disable/enable one seperately
Apart from the misspelling, this doesn't bode well for making the keyboard a wakeup device.
This only means both will be enabled at the same time.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Furthermore, these values are not properly tied to the values in sysfs.
They are independent and the sysfs values probably don't matter for these devices. What are the contents of
/proc/acpi/wakeupafter writing PS2K to it?Unchanged -- both PS2K and PS2M continue to be disabled.
That sounds like a bug. Please try to write 'PS2M' to it too.
I was wrong (don't know why). Writing PS2K does indeed enable both. And sure enough, doing that allows the system to wake up in response to a key press. It still hangs during the video resume, though.
Quoted 9 lines
Quoted 2 lines
Why are the values independent from the wakeup settings in sysfs? Aren't they supposed to mean the same thing?
Not really. There are two separate flags for wakeup. One of them is a property of the "physical" device object (eg. PCI device structure) and that one is set/unset via sysfs. The other is a property of the device's ACPI "shadow" object and is set/unset through
/proc/acpi/wakeup(this mechanism is regarded as obsolete, but it looks like some devices have not been converted to the sysfs-based one yet).
It looks like the inline routines defined in include/linux/pm_wakeup.h should call corresponding platform-specific routines. Apparently _no_ drivers have been converted in this way -- since the conversion needs to be part of the core. In fact, there isn't even a platform-specific hook for enabling or disabling wakeup devices; we should have a platform_wakeup_ops structure.
Would such a thing be acceptable?
Alan Stern
Quoted 23 lines · Alan Stern
Quoted 21 lines · Rafael J. Wysocki
Quoted 19 lines · you
Quoted 8 lines · Rafael J. Wysocki
Quoted 8 lines
Here's what I got:
[ 3.349334] PM: Resume from disk failed. [ 3.350060] Magic number: 0:141:321 [ 3.352583] hash matches drivers/base/power/main.c:477 [ 3.355144] tty tty46: hash matches [ 3.357742] i915 0000:00:02.0: hash matchesQuoted 6 lines
Quoted 2 lines
So it appears that the video driver is indeed the culprit. Is there any way to narrow it down further?
Not without adding some debug code to the driver.
Which version of the kernel is this?
2.6.33-rc8. The same problem occurs with earlier versions, such as Fedora 12's 2.6.31.9 (which is what I'm running now).
Quoted 6 lines
Quoted 4 lines
I _think_ think the i915 KMS doesn't work on your box for some reason.
Doesn the screen switch to the graphics framebuffer when booted with vga=0?
Yes, it does switch.
OK
Quoted 5 lines
Quoted 2 lines
If not, you probably need to enable framebuffer console in .config (the i915 KMS depends on that actually).
It's already enabled. That is,
CONFIG_FBandCONFIG_FRAMEBUFFER_CONSOLEare both set to 'y'.
Well, so the KMS suspend-resume doesn't work on your system.
I guess that would require some detailed debugging, so it may be a good idea to open a Bugzilla entry for this issue.
...
Quoted 14 lines
I was wrong (don't know why). Writing PS2K does indeed enable both. And sure enough, doing that allows the system to wake up in response to a key press. It still hangs during the video resume, though.
Quoted 9 lines
Quoted 2 lines
Why are the values independent from the wakeup settings in sysfs? Aren't they supposed to mean the same thing?
Not really. There are two separate flags for wakeup. One of them is a property of the "physical" device object (eg. PCI device structure) and that one is set/unset via sysfs. The other is a property of the device's ACPI "shadow" object and is set/unset through
/proc/acpi/wakeup(this mechanism is regarded as obsolete, but it looks like some devices have not been converted to the sysfs-based one yet).
Quoted 6 lines
It looks like the inline routines defined in
include/linux/pm_wakeup.hshould call corresponding platform-specific routines. Apparently _no_ drivers have been converted in this way -- since the conversion needs to be part of the core. In fact, there isn't even a platform-specific hook for enabling or disabling wakeup devices; we should have aplatform_wakeup_opsstructure.
There is one for PCI devices, actually. It's struct pci_platform_pm_ops() defined in drivers/pci/pci.h.
For PCI devices we have pci_enable_wake() that sets up the platform to wake up the system using given device on the basis of the device's sysfs setting. The ACPI flag shown by /proc/acpi/wakeup is not taken into account in that case.
Generally, you can think of two levels one can enable wakeup at. First, there is the device level controlled by the sysfs wakeup setting. This is how we would like to control wakeup. Second, however, there is the /proc/acpi/wakeup interface allowing you to access the _internal_ ACPI representation of devices directly and you can use that to set up the platform to use the device for wakeup even if the device level mechanism doesn't work or is not implemented for it (like in your case).
IOW, the /proc/acpi/wakeup thing only tells us if the device is forced to do the wakeup at the low level and it only takes the ACPI aspect of the wakeup into account, which may not be sufficient. For exmaple, network adapters (and other PCI devices) generally need to have the PME signaling enabled in addition to the platform setup and the chip has to be enabled to take wakeup packets from the network.
If /proc/acpi/wakeup shows "enabled" this means "turn on the wakeup power for this devices and enable its wakeup GPE unconditionally before suspend". If it shows "disabled", it means "leave that to someone else" (that's analogous to the "on" and "auto" settings for devices/.../power/control, but the names are misleading for historical reasons).
So, it looks like we need a counterpart of pci_enable_wake() for PNP devices.
I guess it's better to invite Dmitry into the discussion at this point.
Rafael
Quoted 12 lines · Rafael J. Wysocki
Quoted 6 lines
Quoted 4 lines
I _think_ think the i915 KMS doesn't work on your box for some reason.
Doesn the screen switch to the graphics framebuffer when booted with vga=0?
Yes, it does switch.
OK
Quoted 3 lines
Quoted 2 lines
If not, you probably need to enable framebuffer console in .config (the i915 KMS depends on that actually).
Quoted 7 lines
Quoted 2 lines
It's already enabled. That is,
CONFIG_FBandCONFIG_FRAMEBUFFER_CONSOLEare both set to 'y'.Well, so the KMS suspend-resume doesn't work on your system.
I guess that would require some detailed debugging, so it may be a good idea to open a Bugzilla entry for this issue.
Okay, I'll set it up later.
Quoted 17 lines
Quoted 10 lines
Quoted 9 lines
Quoted 2 lines
Why are the values independent from the wakeup settings in sysfs? Aren't they supposed to mean the same thing?
Not really. There are two separate flags for wakeup. One of them is a property of the "physical" device object (eg. PCI device structure) and that one is set/unset via sysfs. The other is a property of the device's ACPI "shadow" object and is set/unset through
/proc/acpi/wakeup(this mechanism is regarded as obsolete, but it looks like some devices have not been converted to the sysfs-based one yet).Quoted 6 lines
It looks like the inline routines defined in
include/linux/pm_wakeup.hshould call corresponding platform-specific routines. Apparently _no_ drivers have been converted in this way -- since the conversion needs to be part of the core. In fact, there isn't even a platform-specific hook for enabling or disabling wakeup devices; we should have aplatform_wakeup_opsstructure.
Quoted 7 lines
There is one for PCI devices, actually. It's struct
pci_platform_pm_ops()defined indrivers/pci/pci.h.For PCI devices we have
pci_enable_wake()that sets up the platform to wake up the system using given device on the basis of the device's sysfs setting. The ACPI flag shown by/proc/acpi/wakeupis not taken into account in that case.
That's not what I meant. Writing to /sys/devices/.../power/wakeup should have the same effect as writing to /proc/acpi/wakeup (if the device has a "shadow" ACPI counterpart, of course). It looks like /proc/acpi/wakeup does nothing but set acpidev->wakeup.state.enabled and warn about duplicate GPE usage.
It would make sense to issue the warning when writing to the sysfs file. And wakeup.state.enabled shouldn't be needed at all; the ACPI code should always use the physical device's may_wakeup flag instead (unless there is no corresponding physical device).
If writes to the sysfs file called a platform hook, we could warn about duplicate GPEs when the wakeup setting is changed.
Quoted 15 lines
Generally, you can think of two levels one can enable wakeup at. First, there is the device level controlled by the sysfs wakeup setting. This is how we would like to control wakeup. Second, however, there is the
/proc/acpi/wakeupinterface allowing you to access the _internal_ ACPI representation of devices directly and you can use that to set up the platform to use the device for wakeup even if the device level mechanism doesn't work or is not implemented for it (like in your case).IOW, the
/proc/acpi/wakeupthing only tells us if the device is forced to do the wakeup at the low level and it only takes the ACPI aspect of the wakeup into account, which may not be sufficient. For exmaple, network adapters (and other PCI devices) generally need to have the PME signaling enabled in addition to the platform setup and the chip has to be enabled to take wakeup packets from the network.
Quoted 7 lines
If
/proc/acpi/wakeupshows "enabled" this means "turn on the wakeup power for this devices and enable its wakeup GPE unconditionally before suspend". If it shows "disabled", it means "leave that to someone else" (that's analogous to the "on" and "auto" settings for devices/.../power/control, but the names are misleading for historical reasons).So, it looks like we need a counterpart of
pci_enable_wake()for PNP devices.
That sounds reasonable. ACPI could be made to work without such a thing, but other platforms probably would need it.
Alan Stern
Dmitry Torokhov
maintainerQuoted 95 lines · Rafael J. Wysocki
Quoted 23 lines · Alan Stern
Quoted 21 lines · Rafael J. Wysocki
Quoted 19 lines · you
Quoted 8 lines · Rafael J. Wysocki
Quoted 8 lines
Here's what I got:
[ 3.349334] PM: Resume from disk failed. [ 3.350060] Magic number: 0:141:321 [ 3.352583] hash matches drivers/base/power/main.c:477 [ 3.355144] tty tty46: hash matches [ 3.357742] i915 0000:00:02.0: hash matchesQuoted 6 lines
Quoted 2 lines
So it appears that the video driver is indeed the culprit. Is there any way to narrow it down further?
Not without adding some debug code to the driver.
Which version of the kernel is this?
2.6.33-rc8. The same problem occurs with earlier versions, such as Fedora 12's 2.6.31.9 (which is what I'm running now).
Quoted 6 lines
Quoted 4 lines
I _think_ think the i915 KMS doesn't work on your box for some reason.
Doesn the screen switch to the graphics framebuffer when booted with vga=0?
Yes, it does switch.
OK
Quoted 5 lines
Quoted 2 lines
If not, you probably need to enable framebuffer console in .config (the i915 KMS depends on that actually).
It's already enabled. That is,
CONFIG_FBandCONFIG_FRAMEBUFFER_CONSOLEare both set to 'y'.Well, so the KMS suspend-resume doesn't work on your system.
I guess that would require some detailed debugging, so it may be a good idea to open a Bugzilla entry for this issue.
...
Quoted 14 lines
I was wrong (don't know why). Writing PS2K does indeed enable both. And sure enough, doing that allows the system to wake up in response to a key press. It still hangs during the video resume, though.
Quoted 9 lines
Quoted 2 lines
Why are the values independent from the wakeup settings in sysfs? Aren't they supposed to mean the same thing?
Not really. There are two separate flags for wakeup. One of them is a property of the "physical" device object (eg. PCI device structure) and that one is set/unset via sysfs. The other is a property of the device's ACPI "shadow" object and is set/unset through
/proc/acpi/wakeup(this mechanism is regarded as obsolete, but it looks like some devices have not been converted to the sysfs-based one yet).Quoted 6 lines
It looks like the inline routines defined in
include/linux/pm_wakeup.hshould call corresponding platform-specific routines. Apparently _no_ drivers have been converted in this way -- since the conversion needs to be part of the core. In fact, there isn't even a platform-specific hook for enabling or disabling wakeup devices; we should have aplatform_wakeup_opsstructure.There is one for PCI devices, actually. It's struct
pci_platform_pm_ops()defined indrivers/pci/pci.h.For PCI devices we have
pci_enable_wake()that sets up the platform to wake up the system using given device on the basis of the device's sysfs setting. The ACPI flag shown by/proc/acpi/wakeupis not taken into account in that case.Generally, you can think of two levels one can enable wakeup at. First, there is the device level controlled by the sysfs wakeup setting. This is how we would like to control wakeup. Second, however, there is the
/proc/acpi/wakeupinterface allowing you to access the _internal_ ACPI representation of devices directly and you can use that to set up the platform to use the device for wakeup even if the device level mechanism doesn't work or is not implemented for it (like in your case).IOW, the
/proc/acpi/wakeupthing only tells us if the device is forced to do the wakeup at the low level and it only takes the ACPI aspect of the wakeup into account, which may not be sufficient. For exmaple, network adapters (and other PCI devices) generally need to have the PME signaling enabled in addition to the platform setup and the chip has to be enabled to take wakeup packets from the network.If
/proc/acpi/wakeupshows "enabled" this means "turn on the wakeup power for this devices and enable its wakeup GPE unconditionally before suspend". If it shows "disabled", it means "leave that to someone else" (that's analogous to the "on" and "auto" settings for devices/.../power/control, but the names are misleading for historical reasons).
Quoted 4 lines
So, it looks like we need a counterpart of
pci_enable_wake()for PNP devices.I guess it's better to invite Dmitry into the discussion at this point.
Yes, I agree, we need a genric mechanism for PNP to emable wakups. It was discussed a bit here:
http://bugzilla.kernel.org/show_bug.cgi?id=8286
but David was too hung up on the fact that number of devices in ACPI does not map directly onto number of serio ports when i8042 is in active multiplexing mode that it id not go anywhere.
Signature · 1 line
Dmitry
Quoted 44 lines · Alan Stern
Quoted 12 lines · Rafael J. Wysocki
Quoted 6 lines
Quoted 4 lines
I _think_ think the i915 KMS doesn't work on your box for some reason.
Doesn the screen switch to the graphics framebuffer when booted with vga=0?
Yes, it does switch.
OK
Quoted 3 lines
Quoted 2 lines
If not, you probably need to enable framebuffer console in .config (the i915 KMS depends on that actually).
Quoted 7 lines
Quoted 2 lines
It's already enabled. That is,
CONFIG_FBandCONFIG_FRAMEBUFFER_CONSOLEare both set to 'y'.Well, so the KMS suspend-resume doesn't work on your system.
I guess that would require some detailed debugging, so it may be a good idea to open a Bugzilla entry for this issue.
Okay, I'll set it up later.
Quoted 20 lines
Quoted 10 lines
Quoted 9 lines
Quoted 2 lines
Why are the values independent from the wakeup settings in sysfs? Aren't they supposed to mean the same thing?
Not really. There are two separate flags for wakeup. One of them is a property of the "physical" device object (eg. PCI device structure) and that one is set/unset via sysfs. The other is a property of the device's ACPI "shadow" object and is set/unset through
/proc/acpi/wakeup(this mechanism is regarded as obsolete, but it looks like some devices have not been converted to the sysfs-based one yet).Quoted 6 lines
It looks like the inline routines defined in
include/linux/pm_wakeup.hshould call corresponding platform-specific routines. Apparently _no_ drivers have been converted in this way -- since the conversion needs to be part of the core. In fact, there isn't even a platform-specific hook for enabling or disabling wakeup devices; we should have aplatform_wakeup_opsstructure.There is one for PCI devices, actually. It's struct
pci_platform_pm_ops()defined indrivers/pci/pci.h.
Quoted 8 lines
Quoted 4 lines
For PCI devices we have
pci_enable_wake()that sets up the platform to wake up the system using given device on the basis of the device's sysfs setting. The ACPI flag shown by/proc/acpi/wakeupis not taken into account in that case.That's not what I meant. Writing to
/sys/devices/.../power/wakeupshould have the same effect as writing to/proc/acpi/wakeup(if the device has a "shadow" ACPI counterpart, of course).
That really is not worth it. The information about the sharing of a GPE is only useful for debugging purposes and only in "really broken" cases.
Quoted 2 lines
It looks like
/proc/acpi/wakeupdoes nothing but setacpidev->wakeup.state.enabledand warn about duplicate GPE usage.
That's correct, although the warning itself doesn't really make sense, because the sharing of the GPE doesn't mean we _have_ _to_ enable both devices to wake up (the devices usually require some more preparations than just setting the GPE).
Quoted 1 line
It would make sense to issue the warning when writing to the sysfs file.
That's not worth the added code complexity IMO.
Quoted 1 line
And wakeup.state.enabled shouldn't be needed at all;
Right, but it was there before.
Quoted 2 lines
the ACPI code should always use the physical device's
may_wakeupflag instead (unless there is no corresponding physical device).
No, it shouldn't, because it doesn't know if the device has actually been set up for wakeup at its bus type level.
Quoted 2 lines
If writes to the sysfs file called a platform hook, we could warn about duplicate GPEs when the wakeup setting is changed.
As I wrote above, this is not worth it IMO. Moreover, that doesn't really matter, because the GPEs will be enabled as needed anyway and there's no real need to tell the user which of them are shared except for debugging (at the fairly low level). Furthermore, the GPE refrence counting code we're going to add shortly changes that quite a bit.
Generally speaking, I'd like to get rid of /proc/acpi/wakeup altogether or maybe leave it as read-only without the "disabled/enabled" column.
However, there still are devices that don't have an alternative mechanism for enabling wakeup, so we can't just drop it right now.
Rafael
Quoted 8 lines · Dmitry Torokhov
Yes, I agree, we need a genric mechanism for PNP to emable wakups. It was discussed a bit here:
http://bugzilla.kernel.org/show_bug.cgi?id=8286but David was too hung up on the fact that number of devices in ACPI does not map directly onto number of serio ports when i8042 is in active multiplexing mode that it id not go anywhere.
I tend to agree with your views. Although there still is a question about why my system has both /sys/devices/pnp0/00:09 and /sys/devices/platform/i8042/serio0. Since they refer to the same keyboard device, why should there be two different sysfs nodes and two different drivers?
(Somewhat tangentially, why do the "i8042 aux" and "i8042 kbd" drivers on the pnp bus have names containing space characters? Isn't that likely to mess up shell scripts?)
At any rate, can the wakeup matter get fixed? On my system I see two issues related to the keyboard/mouse devices. The first is that they are not enabled for wakeup by default. The second is that doing
echo enabled >/sys/devices/pnp0/00:09/power/wakeup
does not actually enable the keyboard for wakeup; only writing to /proc/acpi/wakeup works.
Rafael's suggestion for a PNP analog of pci_enable_wake() should solve the second issue. I don't know what's needed to solve the first.
Alan Stern
Quoted 6 lines · Rafael J. Wysocki
Quoted 6 lines
Quoted 4 lines
Well, so the KMS suspend-resume doesn't work on your system.
I guess that would require some detailed debugging, so it may be a good idea to open a Bugzilla entry for this issue.
Okay, I'll set it up later.
Created as Bugzilla #15385. I added you to the CC: list. Further communication should be CC'ed to linux-pm and dri-devel.
Alan Stern
RFC 1/1 Wakeup for PNP
In reply to Dmitry TorokhovQuoted 8 lines · Dmitry Torokhov
Yes, I agree, we need a genric mechanism for PNP to emable wakups. It was discussed a bit here:
http://bugzilla.kernel.org/show_bug.cgi?id=8286but David was too hung up on the fact that number of devices in ACPI does not map directly onto number of serio ports when i8042 is in active multiplexing mode that it id not go anywhere.
Does this look reasonable? I don't know anything about PNPBIOS or ISAPNP, so it handles only PNPACPI. But at least it's a starting point -- and it does enable my system to wake up in response to hitting a key.
(This combines changes to the PNP core with changes to the i8042 drivers. For submission they can be broken out into separate patches.)
Alan Stern
drivers/input/serio/i8042-x86ia64io.h +4 -2
@@ -625,6 +625,7 @@ static int i8042_pnp_kbd_probe(struct pn } i8042_pnp_kbd_devices++; +device_set_wakeup_enable (&dev->dev, true);return 0 ; }
@@ -646,6 +647,7 @@ static int i8042_pnp_aux_probe(struct pn } i8042_pnp_aux_devices++; +device_set_wakeup_enable (&dev->dev, true);return 0 ; }
@@ -656,7 +658,7 @@ static struct pnp_device_id pnp_kbd_devi };static struct pnp_driver i8042_pnp_kbd_driver = { - .name ="i8042 kbd" , + .name ="i8042-kbd" , .id_table = pnp_kbd_devids, .probe = i8042_pnp_kbd_probe, };
@@ -676,7 +678,7 @@ static struct pnp_device_id pnp_aux_devi };static struct pnp_driver i8042_pnp_aux_driver = { - .name ="i8042 aux" , + .name ="i8042-aux" , .id_table = pnp_aux_devids, .probe = i8042_pnp_aux_probe, };
drivers/pnp/core.c +3 -0
@@ -164,6 +164,9 @@ int __pnp_add_device(struct pnp_dev *devlist_add_tail (&dev->global_list, &pnp_global);list_add_tail (&dev->protocol_list, &dev->protocol->devices);spin_unlock (&pnp_lock); +device_set_wakeup_capable (&dev->dev, + dev->protocol->can_wakeup && + dev->protocol->can_wakeup (dev));return device_register (&dev->dev); }
drivers/pnp/pnpacpi/core.c +18 -0
@@ -121,12 +121,27 @@ static int pnpacpi_disable_resources(str }#ifdef CONFIG_ACPI_SLEEP +static bool pnpacpi_can_wakeup (struct pnp_dev *dev) +{ +acpi_handle handle =DEVICE_ACPI_HANDLE (&dev->dev); + +return handle &&acpi_bus_can_wakeup (handle); +} +static int pnpacpi_suspend (struct pnp_dev *dev,pm_message_t state) {struct acpi_device *acpi_dev = dev->data;acpi_handle handle = acpi_dev->handle;int power_state; +if (device_can_wakeup (&dev->dev)) { +int ret; + + ret =acpi_pm_device_sleep_wake (&dev->dev, +device_may_wakeup (&dev->dev)); +if (ret) +return ret; + } power_state =acpi_pm_device_sleep_state (&dev->dev,NULL );if (power_state <0 ) power_state = (state.event == PM_EVENT_ON) ?
@@ -140,6 +155,8 @@ static int pnpacpi_resume(struct pnp_devstruct acpi_device *acpi_dev = dev->data;acpi_handle handle = acpi_dev->handle; +if (device_can_wakeup (&dev->dev)) +acpi_pm_device_sleep_wake (&dev->dev, false); return acpi_bus_set_power(handle, ACPI_STATE_D0); }#endif
@@ -150,6 +167,7 @@ struct pnp_protocol pnpacpi_protocol = { .set = pnpacpi_set_resources, .disable = pnpacpi_disable_resources, #ifdef CONFIG_ACPI_SLEEP + .can_wakeup = pnpacpi_can_wakeup, .suspend = pnpacpi_suspend, .resume = pnpacpi_resume, #endif
include/linux/pnp.h +1 -0
@@ -414,6 +414,7 @@ struct pnp_protocol {int (*disable) (struct pnp_dev *dev);/* protocol specific suspend/resume */ +bool (*can_wakeup) (struct pnp_dev *dev);int (*suspend) (struct pnp_dev * dev,pm_message_t state);int (*resume) (struct pnp_dev * dev);
Re: [RFC] Wakeup for PNP
Quoted 7 lines · Alan Stern
Quoted 5 lines · Dmitry Torokhov
Yes, I agree, we need a genric mechanism for PNP to emable wakups. It was discussed a bit here:
http://bugzilla.kernel.org/show_bug.cgi?id=8286
Quoted 8 lines
Quoted 3 lines
but David was too hung up on the fact that number of devices in ACPI does not map directly onto number of serio ports when i8042 is in active multiplexing mode that it id not go anywhere.
Does this look reasonable? I don't know anything about PNPBIOS or ISAPNP, so it handles only PNPACPI. But at least it's a starting point -- and it does enable my system to wake up in response to hitting a key.
I don't know much about power management, but your patch looks reasonable to me.
drivers/pnp/pnpacpi/core.c static int pnpacpi_disable_resources(str · line 126
Quoted 9 lines
drivers/pnp/pnpacpi/core.c +3
-0@@ -121,12 +121,27 @@ static int pnpacpi_disable_resources(str }#ifdef CONFIG_ACPI_SLEEP +static bool pnpacpi_can_wakeup (struct pnp_dev *dev) +{ +acpi_handle handle =DEVICE_ACPI_HANDLE (&dev->dev);
I would have used:
struct acpi_device *acpi_dev = dev->data; acpi_handle handle = acpi_dev->handle;
here because that's what the rest of the PNPACPI code does.
Bjorn
Re: [RFC] Wakeup for PNP
In reply to Alan SternQuoted 7 lines · Alan Stern
Quoted 5 lines · Dmitry Torokhov
Yes, I agree, we need a genric mechanism for PNP to emable wakups. It was discussed a bit here:
http://bugzilla.kernel.org/show_bug.cgi?id=8286
Quoted 8 lines
Quoted 3 lines
but David was too hung up on the fact that number of devices in ACPI does not map directly onto number of serio ports when i8042 is in active multiplexing mode that it id not go anywhere.
Does this look reasonable? I don't know anything about PNPBIOS or ISAPNP, so it handles only PNPACPI. But at least it's a starting point -- and it does enable my system to wake up in response to hitting a key.
I don't know much about power management, but your patch looks reasonable to me.
drivers/pnp/pnpacpi/core.c static int pnpacpi_disable_resources(str · line 126
Quoted 9 lines
drivers/pnp/pnpacpi/core.c +3
-0@@ -121,12 +121,27 @@ static int pnpacpi_disable_resources(str }#ifdef CONFIG_ACPI_SLEEP +static bool pnpacpi_can_wakeup (struct pnp_dev *dev) +{ +acpi_handle handle =DEVICE_ACPI_HANDLE (&dev->dev);
I would have used:
struct acpi_device *acpi_dev = dev->data; acpi_handle handle = acpi_dev->handle;
here because that's what the rest of the PNPACPI code does.
Bjorn
Re: [RFC] Wakeup for PNP
Quoted 7 lines · Bjorn Helgaas
Quoted 4 lines
Does this look reasonable? I don't know anything about PNPBIOS or ISAPNP, so it handles only PNPACPI. But at least it's a starting point -- and it does enable my system to wake up in response to hitting a key.
I don't know much about power management, but your patch looks reasonable to me.
Thanks.
Quoted 12 lines
drivers/pnp/pnpacpi/core.c static int pnpacpi_disable_resources(str · line 126
Quoted 9 lines
drivers/pnp/pnpacpi/core.c +3
-0@@ -121,12 +121,27 @@ static int pnpacpi_disable_resources(str }#ifdef CONFIG_ACPI_SLEEP +static bool pnpacpi_can_wakeup (struct pnp_dev *dev) +{ +acpi_handle handle =DEVICE_ACPI_HANDLE (&dev->dev);I would have used:
Quoted 4 lines
struct acpi_device *acpi_dev = dev->data; acpi_handle handle = acpi_dev->handle;here because that's what the rest of the PNPACPI code does.
Ah yes. I just copied the code from the corresponding PCI function without thinking about it very much. I'll update the patch and wait to hear from other people.
Alan Stern
Re: [RFC] Wakeup for PNP
In reply to Bjorn HelgaasQuoted 7 lines · Bjorn Helgaas
Quoted 4 lines
Does this look reasonable? I don't know anything about PNPBIOS or ISAPNP, so it handles only PNPACPI. But at least it's a starting point -- and it does enable my system to wake up in response to hitting a key.
I don't know much about power management, but your patch looks reasonable to me.
Thanks.
Quoted 12 lines
drivers/pnp/pnpacpi/core.c static int pnpacpi_disable_resources(str · line 126
Quoted 9 lines
drivers/pnp/pnpacpi/core.c +3
-0@@ -121,12 +121,27 @@ static int pnpacpi_disable_resources(str }#ifdef CONFIG_ACPI_SLEEP +static bool pnpacpi_can_wakeup (struct pnp_dev *dev) +{ +acpi_handle handle =DEVICE_ACPI_HANDLE (&dev->dev);I would have used:
Quoted 4 lines
struct acpi_device *acpi_dev = dev->data; acpi_handle handle = acpi_dev->handle;here because that's what the rest of the PNPACPI code does.
Ah yes. I just copied the code from the corresponding PCI function without thinking about it very much. I'll update the patch and wait to hear from other people.
Alan Stern
Dmitry Torokhov
maintainerRe: [RFC] Wakeup for PNP
In reply to Alan SternQuoted 43 lines · Alan Stern
Quoted 8 lines · Dmitry Torokhov
Yes, I agree, we need a genric mechanism for PNP to emable wakups. It was discussed a bit here:
http://bugzilla.kernel.org/show_bug.cgi?id=8286but David was too hung up on the fact that number of devices in ACPI does not map directly onto number of serio ports when i8042 is in active multiplexing mode that it id not go anywhere.
Does this look reasonable? I don't know anything about PNPBIOS or ISAPNP, so it handles only PNPACPI. But at least it's a starting point -- and it does enable my system to wake up in response to hitting a key.
(This combines changes to the PNP core with changes to the i8042 drivers. For submission they can be broken out into separate patches.)
Alan Stern
Index:
usb-2.6/drivers/input/serio/i8042-x86ia64io.h
===================================================================drivers/input/serio/i8042-x86ia64io.h +2
-0@@ -625,6 +625,7 @@ static int i8042_pnp_kbd_probe(struct pn } i8042_pnp_kbd_devices++; +device_set_wakeup_enable (&dev->dev, true);return 0 ; }@@ -646,6 +647,7 @@ static int i8042_pnp_aux_probe(struct pn } i8042_pnp_aux_devices++; +device_set_wakeup_enable (&dev->dev, true);return 0 ; }
drivers/input/serio/i8042-x86ia64io.h static struct pnp_device_id pnp_kbd_devi · line 661
Quoted 5 lines
drivers/input/serio/i8042-x86ia64io.h +1
-1@@ -656,7 +658,7 @@ static struct pnp_device_id pnp_kbd_devi };static struct pnp_driver i8042_pnp_kbd_driver = { - .name ="i8042 kbd" , + .name ="i8042-kbd" ,
Why is this needed? I don't think spaces are more dangerous than a colon which we do use...
Other than that - looks reasonable to me...
Signature · 1 line
Dmitry
Dmitry Torokhov
maintainerRe: [RFC] Wakeup for PNP
In reply to Alan SternQuoted 43 lines · Alan Stern
Quoted 8 lines · Dmitry Torokhov
Yes, I agree, we need a genric mechanism for PNP to emable wakups. It was discussed a bit here:
http://bugzilla.kernel.org/show_bug.cgi?id=8286but David was too hung up on the fact that number of devices in ACPI does not map directly onto number of serio ports when i8042 is in active multiplexing mode that it id not go anywhere.
Does this look reasonable? I don't know anything about PNPBIOS or ISAPNP, so it handles only PNPACPI. But at least it's a starting point -- and it does enable my system to wake up in response to hitting a key.
(This combines changes to the PNP core with changes to the i8042 drivers. For submission they can be broken out into separate patches.)
Alan Stern
Index:
usb-2.6/drivers/input/serio/i8042-x86ia64io.h
===================================================================drivers/input/serio/i8042-x86ia64io.h +2
-0@@ -625,6 +625,7 @@ static int i8042_pnp_kbd_probe(struct pn } i8042_pnp_kbd_devices++; +device_set_wakeup_enable (&dev->dev, true);return 0 ; }@@ -646,6 +647,7 @@ static int i8042_pnp_aux_probe(struct pn } i8042_pnp_aux_devices++; +device_set_wakeup_enable (&dev->dev, true);return 0 ; }
drivers/input/serio/i8042-x86ia64io.h static struct pnp_device_id pnp_kbd_devi · line 661
Quoted 5 lines
drivers/input/serio/i8042-x86ia64io.h +1
-1@@ -656,7 +658,7 @@ static struct pnp_device_id pnp_kbd_devi };static struct pnp_driver i8042_pnp_kbd_driver = { - .name ="i8042 kbd" , + .name ="i8042-kbd" ,
Why is this needed? I don't think spaces are more dangerous than a colon which we do use...
Other than that - looks reasonable to me...
Signature · 1 line
Dmitry
Re: [RFC] Wakeup for PNP
Quoted 9 lines · Dmitry Torokhov
drivers/input/serio/i8042-x86ia64io.h static struct pnp_device_id pnp_kbd_devi · line 661
Quoted 6 lines
drivers/input/serio/i8042-x86ia64io.h +1
-1@@ -656,7 +658,7 @@ static struct pnp_device_id pnp_kbd_devi };static struct pnp_driver i8042_pnp_kbd_driver = { - .name ="i8042 kbd" , + .name ="i8042-kbd" ,Why is this needed? I don't think spaces are more dangerous than a colon which we do use...
This string becomes the name of a directory in sysfs. Having a ' ' character in a directory name just doesn't seem like a good idea; at the very least it's likely to confuse shell scripts. (A ':' character is a lot less subject to misinterpretation.) I could change the '-' to ':' if you prefer.
Quoted 1 line
Other than that - looks reasonable to me...
Thanks. I'll separate out the driver name change from the rest of the patch.
There are a couple of questions remaining. The patch enables wakeup on the i8042-aux device -- is this a good idea? I haven't tested that part of it yet, but we wouldn't want suspended systems waking up just because somebody moves the mouse around. On the other hand, on some machines (like mine!) it may not be possible to enable keyboard-wakeup without also enabling mouse-wakeup, since they use the same GPE.
Also, the patch effectively tells the kernel that ISAPNP and PNPBIOS devices are incapable of issuing wakeup requests. Is that going to cause trouble for people? Would it be better to change the patch so that it doesn't call device_set_wakeup_capable() if dev->protocol->can_wakeup isn't defined?
Alan Stern
Re: [RFC] Wakeup for PNP
In reply to Dmitry TorokhovQuoted 9 lines · Dmitry Torokhov
drivers/input/serio/i8042-x86ia64io.h static struct pnp_device_id pnp_kbd_devi · line 661
Quoted 6 lines
drivers/input/serio/i8042-x86ia64io.h +1
-1@@ -656,7 +658,7 @@ static struct pnp_device_id pnp_kbd_devi };static struct pnp_driver i8042_pnp_kbd_driver = { - .name ="i8042 kbd" , + .name ="i8042-kbd" ,Why is this needed? I don't think spaces are more dangerous than a colon which we do use...
This string becomes the name of a directory in sysfs. Having a ' ' character in a directory name just doesn't seem like a good idea; at the very least it's likely to confuse shell scripts. (A ':' character is a lot less subject to misinterpretation.) I could change the '-' to ':' if you prefer.
Quoted 1 line
Other than that - looks reasonable to me...
Thanks. I'll separate out the driver name change from the rest of the patch.
There are a couple of questions remaining. The patch enables wakeup on the i8042-aux device -- is this a good idea? I haven't tested that part of it yet, but we wouldn't want suspended systems waking up just because somebody moves the mouse around. On the other hand, on some machines (like mine!) it may not be possible to enable keyboard-wakeup without also enabling mouse-wakeup, since they use the same GPE.
Also, the patch effectively tells the kernel that ISAPNP and PNPBIOS devices are incapable of issuing wakeup requests. Is that going to cause trouble for people? Would it be better to change the patch so that it doesn't call device_set_wakeup_capable() if dev->protocol->can_wakeup isn't defined?
Alan Stern
Dmitry Torokhov
maintainerRe: [RFC] Wakeup for PNP
Hi Alan,
Quoted 12 lines · Alan Stern
Quoted 9 lines · Dmitry Torokhov
drivers/input/serio/i8042-x86ia64io.h static struct pnp_device_id pnp_kbd_devi · line 661
Quoted 6 lines
drivers/input/serio/i8042-x86ia64io.h +1
-1@@ -656,7 +658,7 @@ static struct pnp_device_id pnp_kbd_devi };static struct pnp_driver i8042_pnp_kbd_driver = { - .name ="i8042 kbd" , + .name ="i8042-kbd" ,Why is this needed? I don't think spaces are more dangerous than a colon which we do use...
Quoted 6 lines
This string becomes the name of a directory in sysfs. Having a ' ' character in a directory name just doesn't seem like a good idea; at the very least it's likely to confuse shell scripts. (A ':' character is a lot less subject to misinterpretation.) I could change the '-' to ':' if you prefer.
We have not heard complains about this causing trouble ever since PNP support was added (so what 5 years at least?). At this point I'd be more worried about breaking existing users...
Thanks.
Signature · 1 line
Dmitry
Dmitry Torokhov
maintainerRe: [RFC] Wakeup for PNP
In reply to Alan SternHi Alan,
Quoted 12 lines · Alan Stern
Quoted 9 lines · Dmitry Torokhov
drivers/input/serio/i8042-x86ia64io.h static struct pnp_device_id pnp_kbd_devi · line 661
Quoted 6 lines
drivers/input/serio/i8042-x86ia64io.h +1
-1@@ -656,7 +658,7 @@ static struct pnp_device_id pnp_kbd_devi };static struct pnp_driver i8042_pnp_kbd_driver = { - .name ="i8042 kbd" , + .name ="i8042-kbd" ,Why is this needed? I don't think spaces are more dangerous than a colon which we do use...
Quoted 6 lines
This string becomes the name of a directory in sysfs. Having a ' ' character in a directory name just doesn't seem like a good idea; at the very least it's likely to confuse shell scripts. (A ':' character is a lot less subject to misinterpretation.) I could change the '-' to ':' if you prefer.
We have not heard complains about this causing trouble ever since PNP support was added (so what 5 years at least?). At this point I'd be more worried about breaking existing users...
Thanks.
Signature · 1 line
Dmitry