pm-suspend aborts if highest numbered CPU offline, as of kernel 4.2

Bug #1493156 reported by Doug Smythies
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pm-utils (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Kernel 4.2 includes a significant commit (87549141d516aee71d511138e27117c41e8aef68), after the patch the files and directory are present even if the CPU is offline. If the CPU is offline, writing to those files isn't allowed and so the echo in 94cpufreq fails.

If the failed echo is not the last pass through the loop, then
the bad exit code gets overwritten with a good one before
the loop exits. If the failed echo is the last pass through the loop, due to the highest numbered CPU being offline, then then 94cpufreq returns an error code and pm-suspend aborts.

So what is needed is something like (and this doesn't actually work yet):

hibernate_cpufreq()
{
        ( cd /sys/devices/system/cpu/
        for x in cpu[0-9]*; do
                # if cpufreq is a symlink, it is handled by another cpu. Skip.
                [ -L "$x/cpufreq" ] && continue
                gov="$x/cpufreq/scaling_governor"
                # if we do not have a scaling_governor file, skip.
                [ -f "$gov" ] || continue

+ # if the CPU is offline, skip, unless no file, i.e. CPU0.
+ [ $(cat "$x/online") = "1" -o ! -f "$x/online" ] || continue
Or
+ if [ $(cat "$x/online") = "1" ] || [ ! -f "$x/online" ]; then
+ continue;
+ fi
Or something similar that actually works.

                # if our temporary governor is not available, skip.
                grep -q "$TEMPORARY_CPUFREQ_GOVERNOR" \
                        "$x/cpufreq/scaling_available_governors" || continue
                savestate "${x}_governor" < "$gov"
                echo "$TEMPORARY_CPUFREQ_GOVERNOR" > "$gov"
        done )
}

Or just force a good return code at the end (which is what I'm doing now, so that I can move on).

Note: I also filed this same bug report upstream.
https://bugs.freedesktop.org/show_bug.cgi?id=91914

Revision history for this message
Doug Smythies (dsmythies) wrote :

As of kernel 4.4-rc1 this bug becomes invalid, as the kernel was patched such that this issue no longer occurs.
I'll wait until kernel 4.4 is finished, check again, then set the status of this bug report to invalid.

Revision history for this message
Robie Basak (racb) wrote :

Thank you for your report Doug. Let's set this Incomplete pending your check of 4.4.

Changed in pm-utils (Ubuntu):
status: New → Incomplete
Changed in pm-utils (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.