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 598946 - suspends immediately after resuming if power is unplugged while suspended
suspends immediately after resuming if power is unplugged while suspended
Status: RESOLVED OBSOLETE
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-10-19 15:27 UTC by Martin Pitt
Modified: 2012-01-16 06:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
g-p-m log (81.31 KB, application/octet-stream)
2009-10-19 15:27 UTC, Martin Pitt
Details

Description Martin Pitt 2009-10-19 15:27:32 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.
Comment 1 Jori Hardman 2009-12-17 16:51:26 UTC
I can confirm this bug in Arch linux with the same kernel and gpm 2.28.2.
Comment 2 Chow Loong Jin 2010-01-16 17:18:00 UTC
Please merge this with #604362, which has a patch for this issue.
Comment 3 Srinivas Rao 2010-06-24 19:50:52 UTC
Same issue as bug#611805-suspends when plugged in
Comment 4 Martin Pitt 2012-01-16 06:09:54 UTC
Old bug, and the logic is now in gnome-settings-daemon, so closing this.