After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 625621 - suspends when undocking
suspends when undocking
Status: RESOLVED DUPLICATE of bug 331655
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
SVN TRUNK
Other Linux
: Normal normal
: ---
Assigned To: martin.pitt
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-07-29 21:14 UTC by Martin Pitt
Modified: 2010-07-29 21:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Martin Pitt 2010-07-29 21:14:41 UTC
From original bug report at https://launchpad.net/bugs/595985:
---------------
When booting the system with lid closed in a docking station, and then removing it from the docking station the system goes to sleep. When opening the lid the system goes to sleep again. Steps to reproduce

1) Boot with lid closed in docking station
2) Remove laptop with lid closed from docking station
3) System suspends
4) Opening the lid causes the system to resume
5) System suspends again
---------------

I created a stripped down gpm debug output:

TI:22:56:14	TH:0xb2f110	FI:gpm-engine.c	FN:gpm_engine_device_changed_cb,905
 - updating because /org/freedesktop/UPower/devices/battery_BAT0 changed
TI:22:56:14	TH:0xb2f110	FI:gpm-manager.c	FN:gpm_manager_client_changed_cb,1022
 - on_battery: 1
TI:22:56:14	TH:0xb2f110	FI:gpm-manager.c	FN:gpm_manager_perform_policy,675
 - action: /apps/gnome-power-manager/buttons/lid_battery set to suspend (The lid has been closed, and the ac adapter removed (and gconf is okay).)
TI:22:56:14	TH:0xb2f110	FI:gpm-manager.c	FN:gpm_manager_action_suspend,623
 - suspending, reason: The lid has been closed, and the ac adapter removed (and gconf is okay).
TI:22:56:31	TH:0xb2f110	FI:gpm-button.c	FN:gpm_button_emit_type,81
 - emitting button-pressed : lid-down
TI:22:56:31	TH:0xb2f110	FI:gpm-manager.c	FN:gpm_manager_button_pressed_cb,914
 - Button press event type=lid-down
*** WARNING ***
TI:22:56:31	TH:0xb2f110	FI:gpm-manager.c	FN:gpm_manager_lid_button_pressed,839
 - Performing battery policy
TI:22:56:31	TH:0xb2f110	FI:gpm-manager.c	FN:gpm_manager_perform_policy,675
 - action: /apps/gnome-power-manager/buttons/lid_battery set to suspend (The lid has been closed on battery power.)
TI:22:56:31	TH:0xb2f110	FI:gpm-manager.c	FN:gpm_manager_action_suspend,623
 - suspending, reason: The lid has been closed on battery power.
TI:22:56:32	TH:0xb2f110	FI:gpm-control.c	FN:gpm_control_suspend,178
 - emitting sleep
TI:22:56:49	TH:0xb2f110	FI:gpm-control.c	FN:gpm_control_suspend,183
 - emitting resume
TI:22:56:49	TH:0xb2f110	FI:gpm-screensaver.c	FN:gpm_screensaver_add_throttle,224
 - adding throttle reason: 'Deckel wurde geschlossen': id 46599172
TI:22:56:49	TH:0xb2f110	FI:gpm-backlight.c	FN:gpm_backlight_button_pressed_cb,436
 - Button press event type=lid-down
*** WARNING ***
TI:22:56:49	TH:0xb2f110	FI:gpm-manager.c	FN:gpm_manager_client_changed_cb,996
 - same state as before, ignoring
TI:22:56:49	TH:0xb2f110	FI:gpm-button.c	FN:gpm_button_emit_type,81
 - emitting button-pressed : lid-up


I think what happens here is that the first event is mistaking a change in status ("AC changed to battery") as "the lid got closed", although the lid was closed all the time, and it was the power status that changed. Something similar was recently fixed in bug 622026, but I have that patch, and I rather think this is a logic error.

Then it seems that the BIOS (or something else) sends a lid-closed event, in which case the second suspend would be justified and not a gpm bug. It's still not really desired to suspend on undock, but it's something that could be argued into a "feature, not a bug". But it shouldn't suspend twice, anyway.

I'll make some further investigations now.
Comment 1 Martin Pitt 2010-07-29 21:31:44 UTC
I checked with input-events that there is no input event on the Lid switch device on undock, so the second suspend is not a kernel/hardware artifact either.
Comment 2 Martin Pitt 2010-07-29 21:46:20 UTC
Ah, sorry, I was actually missing the patch from bug 622026, so what remains here is a single suspend:

TI:23:41:16     TH:0x1692110    FI:gpm-manager.c        FN:gpm_manager_client_changed_cb,1022
 - on_battery: 1
TI:23:41:16     TH:0x1692110    FI:gpm-screensaver.c    FN:gpm_screensaver_add_throttle,224
 - adding throttle reason: 'Im Akkubetrieb': id 1523641824
TI:23:41:16     TH:0x1692110    FI:gpm-manager.c        FN:gpm_manager_perform_policy,675
 - action: /apps/gnome-power-manager/buttons/lid_battery set to suspend (The lid has been closed, and the ac adapter removed (and gconf is okay).)
TI:23:41:16     TH:0x1692110    FI:gpm-manager.c        FN:gpm_manager_action_suspend,623
 - suspending, reason: The lid has been closed, and the ac adapter removed (and gconf is okay).
TI:23:41:16     TH:0x1692110    FI:gpm-control.c        FN:gpm_control_suspend,178
 - emitting sleep
TI:23:41:32     TH:0x1692110    FI:gpm-control.c        FN:gpm_control_suspend,183
 - emitting resume
TI:23:41:32     TH:0x1692110    FI:gpm-button.c FN:gpm_button_emit_type,81
 - emitting button-pressed : lid-up
TI:23:41:32     TH:0x1692110    FI:gpm-manager.c        FN:gpm_manager_button_pressed_cb,914
 - Button press event type=lid-up
Comment 3 Martin Pitt 2010-07-29 21:50:24 UTC
So it turns out that the remaining behavior actually was introduced on purpose in bug 331655, and is not a logic error. So I guess I close this as "debatable" then. Sorry for the noise.

*** This bug has been marked as a duplicate of bug 331655 ***