GNOME Bugzilla – Bug 598946
suspends immediately after resuming if power is unplugged while suspended
Last modified: 2012-01-16 06:09:54 UTC
Created attachment 145790 [details] g-p-m log (From https://launchpad.net/bugs/425411) When unplugging AC while the computer is suspended, a resume will immediately be followed by another suspend. Resuming again works then. The g-p-m log shows the lid-close event first: TI:16:41:50 TH:0xe1b890 FI:gpm-button.c FN:gpm_button_emit_type,81 - emitting button-pressed : lid-down TI:16:41:50 TH:0xe1b890 FI:gpm-manager.c FN:gpm_manager_button_pressed_cb,748 - Button press event type=lid-down Followed by the suspend/resume: TI:16:41:51 TH:0xe1b890 FI:gpm-control.c FN:gpm_control_suspend,282 - emitting sleep TI:16:42:03 TH:0xe1b890 FI:gpm-control.c FN:gpm_control_suspend,287 - emitting resume Which is immediately followed by another lid event which didn't physically happen: TI:16:42:03 TH:0xe1b890 FI:gpm-backlight.c FN:gpm_backlight_button_pressed_cb,357 - Button press event type=lid-down Note that in this second case there is no "emitting button-pressed : lid-down" After that there is another "emitting suspend/resume". It should also be noted that the lid-up events do _not_ happen in between those. Instead, those TI:16:42:14 TH:0xe1b890 FI:gpm-button.c FN:gpm_button_emit_type,81 - emitting button-pressed : lid-up TI:16:42:14 TH:0xe1b890 FI:gpm-manager.c FN:gpm_manager_button_pressed_cb,748 - Button press event type=lid-up [...] TI:16:42:14 TH:0xe1b890 FI:gpm-backlight.c FN:gpm_backlight_button_pressed_cb,357 - Button press event type=lid-up happen much later on (again two apparently). Just to ensure that it is not a bug in the input subsystem, I watched "sudo input-events -t 50 0" while doing "sleep 5; sudo pm-suspend", closing the lid, let it suspend, and reopen it. The output was as expected: 17:07:49.795850: EV_SW code=0 value=1 17:07:49.795864: EV_SYN code=0 value=0 17:08:00.400000: EV_SW code=0 value=0 17:08:00.400002: EV_SYN code=0 value=0 No duplication of the lid event. I don't think it's a hardware bouncing issue, since this can consistently be reproduced when removing AC power, but never when AC power stays during suspend, or suspending on battery and plugging in AC power during suspend. g-p-m 2.8.1/dk-power 011 plus the fix from bug #598243/linux 2.6.31.3.
I can confirm this bug in Arch linux with the same kernel and gpm 2.28.2.
Please merge this with #604362, which has a patch for this issue.
Same issue as bug#611805-suspends when plugged in
Old bug, and the logic is now in gnome-settings-daemon, so closing this.