[Bug 633496] New: /usr/lib/pm-utils/sleep.d/75modules should cancel suspend2disk when unloading a module fails
https://bugzilla.novell.com/show_bug.cgi?id=633496 https://bugzilla.novell.com/show_bug.cgi?id=633496#c0 Summary: /usr/lib/pm-utils/sleep.d/75modules should cancel suspend2disk when unloading a module fails Classification: openSUSE Product: openSUSE 11.3 Version: Final Platform: x86-64 OS/Version: openSUSE 11.3 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: td@pre-secure.de QAContact: qa@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.8) Gecko/20100723 SUSE/3.6.8-0.1.1 Firefox/3.6.8 I explicitly requested one module to be unloaded upon suspend by setting SUSPEND_MODULES: SUSPEND_MODULES="${SUSPEND_MODULES:+$SUSPEND_MODULES }em28xx" When actually suspending (via the KDE power management systray application) the script 75modules tries to unload the module and fails because it is still in use. But suspending continues - instead of aborting - only to end up in a locked system. No keypress (Backspace, Ctrl-Alt-Delete, ...) remedies the situation. Only powercycling does help. Reproducible: Always Steps to Reproduce: 1. 2. 3. Actual Results: The system is locked, nothing happens and no keypress does anything. Expected Results: Suspend should abort. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c
yang xiaoyu
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c1
Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=633496 https://bugzilla.novell.com/show_bug.cgi?id=633496#c2 --- Comment #2 from Till Dörges
For 11.3 release this does not seems so critical to be immediately fixed. Fixed in home:mvyskocil:branches:openSUSE:11.3:Update:Test/pm-utils.
Checked today and didn't find it (anymore).
As a workaround, please add the || : after the modunload call in /usr/lib/pm-utils/sleep.d/75modules
I did and it only fixes part of the issue. My notebook still freezes because unloading the module still fails but suspend is not canceled. I have a module which cannot be unloaded (see bug 633497 for details), even though explicitly requested by configuration. So my expectation is that pm-utils stops suspend if it cannot unload the module. A failed suspend is better than a frozen system. While debugging I noticed that pm-utils behave *differently* depending upon whether they are called for the first time (after a clean boot) or not. The problem is that when called for the first time, the module is not unloaded. For all consecutive calls it would have been unloaded. The setup for debugging is as follows: --- snip --- $ rpm -q pm-utils pm-utils-1.3.0-9.1.x86_64 $ rpm -V pm-utils S.5....T. /usr/lib/pm-utils/sleep.d/75modules $ cat /usr/lib/pm-utils/sleep.d/75modules #!/bin/sh # Unload requested modules. "${PM_FUNCTIONS}" suspend_modules() { [ -z "$SUSPEND_MODULES" ] && return $NA for x in $SUSPEND_MODULES ; do printf "Unloading kernel module %s..." "$x" modunload $x retval=$? if [ $retval -eq 0 ]; then echo "Done (retval=$retval)." else echo "Failed (retval=$retval)." return 1 fi done echo "Only to prevent the system from hanging, when debugging suspend." exit 1 return 0 } resume_modules() { modreload echo "Reloaded unloaded modules." } case "$1" in hibernate|suspend) suspend_modules ;; thaw|resume) resume_modules ;; *) exit $NA ;; esac --- snap --- When failing to unload a module, the 'exit 1' should never trigger. The script should 'echo "Failed..."' and 'return 1'. However, on the first try, the exit does get triggered according to the logs: --- snip --- $ grep -B1 -A5 75modules 1st-try/pm-suspend.log /usr/lib/pm-utils/sleep.d/55NetworkManager hibernate hibernate:not applicable. /usr/lib/pm-utils/sleep.d/75modules hibernate hibernate:Unloading kernel module em28xx...FATAL: Module em28xx_alsa is in use. /usr/lib/pm-utils/functions: line 87: log: command not found Done (retval=0). Only to prevent the system from hanging, when debugging suspend. Returned exit code 1. Sat Sep 4 22:08:22 CEST 2010: Inhibit found, will not perform hibernate --- snap --- On 2nd try (immediately after the first, no reboot or anything) the scripts behave the way I'd expect: --- snap --- grep -B1 -A5 75modules 2nd-try/pm-suspend.log /usr/lib/pm-utils/sleep.d/55NetworkManager hibernate hibernate:not applicable. /usr/lib/pm-utils/sleep.d/75modules hibernate hibernate:Unloading kernel module em28xx...FATAL: Module em28xx_alsa is in use. /usr/lib/pm-utils/functions: line 87: log: command not found Failed (retval=1). Returned exit code 1. Sat Sep 4 22:09:06 CEST 2010: Inhibit found, will not perform hibernate Sat Sep 4 22:09:06 CEST 2010: Running hooks for thaw --- snap --- I'm not sure what's causing this behavior, but it still looks like a bug to me. And since I don't know what other information is required for debugging this I'd appreciate any hints. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=633496 https://bugzilla.novell.com/show_bug.cgi?id=633496#c3 --- Comment #3 from Till Dörges
https://bugzilla.novell.com/show_bug.cgi?id=633496 https://bugzilla.novell.com/show_bug.cgi?id=633496#c4 --- Comment #4 from Till Dörges
I'm not sure what's causing this behavior, but it still looks like a bug to me. And since I don't know what other information is required for debugging this I'd appreciate any hints.
Just thought about it again. During the first try, one module (em28xx_dvb) is unloaded sucessfully. It's not present for the 2nd try. This means that unloading a module A doesn't fail if at least one module B which uses A can be unloaded successfully. Upon the first try we have em28xx which is used by em28xx_dvb and em28xx_alsa. Unloading em28xx_dvb succeeds and no error is returned by 75modules. Upon second try only em28xx and em28xx_alsa are left. Unloading em28xx_alsa fails and 75modules correctly returns an error. So my guess is that there's a problem with modunload() in /usr/lib/pm-utils/functions. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c5
--- Comment #5 from Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c6
Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=633496 https://bugzilla.novell.com/show_bug.cgi?id=633496#c7 Till Dörges
can you post me an output of lsmod | grep em28xx
$ lsmod | grep em28xx em28xx_dvb 9719 0 dvb_core 109809 1 em28xx_dvb em28xx_alsa 7859 1 em28xx 103963 2 em28xx_dvb,em28xx_alsa v4l2_common 19775 3 tuner,tvp5150,em28xx videodev 43636 4 tuner,tvp5150,em28xx,v4l2_common ir_common 49030 1 em28xx videobuf_vmalloc 7045 1 em28xx videobuf_core 20421 2 em28xx,videobuf_vmalloc ir_core 8158 2 em28xx,ir_common tveeprom 13945 1 em28xx snd_pcm 104441 5 em28xx_alsa,snd_pcm_oss,snd_hda_intel,snd_hda_codec snd 82622 23 em28xx_alsa,snd_pcm_oss,snd_mixer_oss,snd_seq,snd_seq_device,snd_hda_codec_conexant,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer,thinkpad_acpi usbcore 229058 13 em28xx_dvb,em28xx_alsa,em28xx,zaurus,cdc_ether,btusb,usbnet,cdc_wdm,cdc_acm,usbhid,uhci_hcd,ehci_hcd
and can you run the following sequence in shell?
source /usr/lib/pm-utils/pm-functions LOGGING=1 PM_DEBUG=1 modunload em28xx
# source /usr/lib/pm-utils/pm-functions # LOGGING=1 # PM_DEBUG=1 # modunload em28xx FATAL: Module em28xx_alsa is in use. # could not unload 'em28xx_alsa', usage count was 1 touch: cannot touch `/var/run/pm-utils//storage/module:em28xx_dvb': No such file or directory -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c8
Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=633496 https://bugzilla.novell.com/show_bug.cgi?id=633496#c9 Till Dörges
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c10
Michal Vyskocil
Here we go again:
$ lsmod | grep em28xx em28xx_dvb 9719 0 dvb_core 109809 1 em28xx_dvb em28xx_alsa 7859 2 ^^^ module used twice, but no modules printed
I think this confused the code - em28xx_alsa claims to be used by two other modules, but there were not listed. Michal: I assume this is a bug in lsmod or in kernel, what do you think? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c11
Michal Marek
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c12
Michal Vyskocil
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c13
--- Comment #13 from Vojta Dziewięcki
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c14
--- Comment #14 from Vojta Dziewięcki
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c15
--- Comment #15 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c16
--- Comment #16 from Vojta Dziewięcki
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c17
Vojta Dziewięcki
https://bugzilla.novell.com/show_bug.cgi?id=633496
https://bugzilla.novell.com/show_bug.cgi?id=633496#c18
--- Comment #18 from Swamp Workflow Management
participants (1)
-
bugzilla_noreply@novell.com