# Suspend to RAM and resume steals a cpu

## hfk

Hi

I am using Gentoo on a Dell D630 kernel linux-2.6.23-gentoo-r1

Following the http://www.gentoo.org/doc/en/power-management-guide.xml#doc_chap7 I prepared the kernel

and emerged hibernate-script.

```
hibernate-ram
```

workes and the computer resumes.

But cpufreq-info detects only CPU 0.

CPU 1:

  no or unknown cpu-freq driver active

```
ls -d /sys/devices/system/cpu/cpu*

/sys/devices/system/cpu/cpu0:

cache  cpufreq  crash_notes  topology

/sys/devices/system/cpu/cpu1:

cache  crash_notes  online  topology
```

I am confused about what happened: is CPU 1 switched off or the kernel lost the driver?

I need some hints to solve the problem.

I'm lucky: a second hibernate-ram doesn't steal another cpu   :Wink: 

Thanks

----------

## lokik

Hi,

AFAIK SMP suspend is experimental... I guess you should be happy to have CPU 0 active after resume   :Wink: 

Anyway, I will try s2ram (from sys-power/suspend) on a multi-core system and get back to you with the results.

----------

## Rikai

You might try using sys-kernel/tuxonice-sources; the tuxonice (formerly suspend2) people have done quite a bit of extra work with regard to suspending/hibernating.

----------

## lokik

OK, I tried 

```
s2ram -f -p -m
```

 on an HP 8510p with gentoo-sources-2.6.22-r8 and I still have all my cores... You might want to have a look at your kernel logs...

----------

## hfk

Thanks for your hints.

My kernel log

```
Nov 17 19:52:20 idefix Disabling non-boot CPUs ...

Nov 17 19:52:20 idefix CPU 1 is now offline

Nov 17 19:52:20 idefix CPU1 is down

Nov 17 19:52:20 idefix Intel machine check architecture supported.

Nov 17 19:52:20 idefix Intel machine check reporting enabled on CPU#0.

Nov 17 19:52:20 idefix Back to C!

Nov 17 19:52:20 idefix Enabling non-boot CPUs ...

Nov 17 19:52:20 idefix SMP alternatives: switching to SMP code

Nov 17 19:52:20 idefix Booting processor 1/1 eip 3000

Nov 17 19:52:20 idefix Initializing CPU#1

Nov 17 19:52:20 idefix Calibrating delay using timer specific routine.. 4388.13 BogoMIPS (lpj=8776273)

Nov 17 19:52:20 idefix CPU: After generic identify, caps: bfebfbff 20100000 00000000 00000000 0000e3bd 00000000 00000001 00000001

Nov 17 19:52:20 idefix monitor/mwait feature present.

Nov 17 19:52:20 idefix CPU: L1 I cache: 32K, L1 D cache: 32K

Nov 17 19:52:20 idefix CPU: L2 cache: 4096K

Nov 17 19:52:20 idefix CPU: Physical Processor ID: 0

Nov 17 19:52:20 idefix CPU: Processor Core ID: 1

Nov 17 19:52:20 idefix CPU: After all inits, caps: bfebfbff 20100000 00000000 00003940 0000e3bd 00000000 00000001 00000001

Nov 17 19:52:20 idefix Intel machine check architecture supported.

Nov 17 19:52:20 idefix Intel machine check reporting enabled on CPU#1.

Nov 17 19:52:20 idefix CPU1: Intel(R) Core(TM)2 Duo CPU     T7500  @ 2.20GHz stepping 0a

Nov 17 19:52:20 idefix ACPI Error (psloop-0136): Found unknown opcode FE at AML address f88363ca offset 3, ignoring [20070126]

Nov 17 19:52:20 idefix ACPI Error (psloop-0136): Found unknown opcode 1F at AML address f88363cd offset 6, ignoring [20070126]

Nov 17 19:52:20 idefix ACPI Error (psloop-0136): Found unknown opcode 2 at AML address f88363d4 offset D, ignoring [20070126]

Nov 17 19:52:20 idefix ACPI Error (psloop-0136): Found unknown opcode C2 at AML address f88363d6 offset F, ignoring [20070126]

Nov 17 19:52:20 idefix ACPI Error (psargs-0355): [E] Namespace lookup failure, AE_NOT_FOUND

Nov 17 19:52:20 idefix ACPI Error (psparse-0537): Method parse/execution failed [\_PR_.CPU1._PCT] (Node c210d8c4), AE_NOT_FOUND

Nov 17 19:52:20 idefix ACPI Exception (processor_perflib-0170): AE_NOT_FOUND, Evaluating _PCT [20070126]

Nov 17 19:52:20 idefix CPU1 is up

```

oops: ACPI Error ?

/var/log/hibernate.log reported no error.

----------

## lokik

Hmm, that ACPI error must be the root of your problems...

My kernel log (this time with gentoo-sources-2.6.23-r1) 

```
Nov 15 23:12:13 [kernel] [   96.144035] Disabling non-boot CPUs ...

Nov 15 23:12:13 [kernel] [   96.249892] CPU 1 is now offline

Nov 15 23:12:13 [kernel] [   96.249897] SMP alternatives: switching to UP code

Nov 15 23:12:13 [kernel] [   96.252498] CPU1 is down

Nov 15 23:12:13 [kernel] [    0.183118] Intel machine check architecture supported.

Nov 15 23:12:13 [kernel] [    0.183126] Intel machine check reporting enabled on CPU#0.

Nov 15 23:12:13 [kernel] [    0.183644] Enabling non-boot CPUs ...

Nov 15 23:12:13 [kernel] [    0.186834] SMP alternatives: switching to SMP code

Nov 15 23:12:13 [kernel] [    0.188071] Booting processor 1/1 eip 3000

Nov 15 23:12:13 [kernel] [    0.198750] Initializing CPU#1

Nov 15 23:12:13 [kernel] [    0.258552] Calibrating delay using timer specific routine.. 4788.10 BogoMIPS (lpj=2394052)

Nov 15 23:12:13 [kernel] [    0.258561] monitor/mwait feature present.

Nov 15 23:12:13 [kernel] [    0.258563] CPU: L1 I cache: 32K, L1 D cache: 32K

Nov 15 23:12:13 [kernel] [    0.258565] CPU: L2 cache: 4096K

Nov 15 23:12:13 [kernel] [    0.258566] CPU: Physical Processor ID: 0

Nov 15 23:12:13 [kernel] [    0.258567] CPU: Processor Core ID: 1

Nov 15 23:12:13 [kernel] [    0.258572] Intel machine check architecture supported.

Nov 15 23:12:13 [kernel] [    0.258574] Intel machine check reporting enabled on CPU#1.

Nov 15 23:12:13 [kernel] [    0.259113] CPU1: Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz stepping 0b

Nov 15 23:12:13 [kernel] [    0.259388] CPU1 is up

Nov 15 23:12:13 [kernel] [    0.260143] Switched to high resolution mode on CPU 1

```

Notice that I have 

```
Nov 15 23:12:13 [kernel] [   96.249897] SMP alternatives: switching to UP code
```

 in the logs right before CPU1 is brought down... And we both have Core2 processors... maybe some kernel config change would help... but don't know where to start...

----------

## hfk

Using

  s2ram -f

I got the same result (video is fine).

I could not figure out what is the problem in my kernel config.

I'm using gentoo-sources-2.6.23-r1 the cpu is a centrino Duo T7500

dmesg:

```
Linux version 2.6.23-gentoo-r1 (root@idefix) (gcc version 4.1.1 (Gentoo 4.1.1-r3)) #37 SMP PREEMPT Sat Nov 17 16:40:53 CET 2007

...

CPU0: Intel(R) Core(TM)2 Duo CPU     T7500  @ 2.20GHz stepping 0a

...

CPU1: Intel(R) Core(TM)2 Duo CPU     T7500  @ 2.20GHz stepping 0a
```

My kernel config:

```
#

# Processor type and features

#

# CONFIG_TICK_ONESHOT is not set

# CONFIG_NO_HZ is not set

# CONFIG_HIGH_RES_TIMERS is not set

CONFIG_SMP=y

CONFIG_X86_PC=y

# CONFIG_X86_ELAN is not set

# CONFIG_X86_VOYAGER is not set

# CONFIG_X86_NUMAQ is not set

# CONFIG_X86_SUMMIT is not set

# CONFIG_X86_BIGSMP is not set

# CONFIG_X86_VISWS is not set

# CONFIG_X86_GENERICARCH is not set

# CONFIG_X86_ES7000 is not set

# CONFIG_PARAVIRT is not set

# CONFIG_M386 is not set

# CONFIG_M486 is not set

# CONFIG_M586 is not set

# CONFIG_M586TSC is not set

# CONFIG_M586MMX is not set

# CONFIG_M686 is not set

# CONFIG_MPENTIUMII is not set

# CONFIG_MPENTIUMIII is not set

# CONFIG_MPENTIUMM is not set

CONFIG_MCORE2=y

# CONFIG_MPENTIUM4 is not set

# CONFIG_MK6 is not set

# CONFIG_MK7 is not set

# CONFIG_MK8 is not set

# CONFIG_MCRUSOE is not set

# CONFIG_MEFFICEON is not set

# CONFIG_MWINCHIPC6 is not set

# CONFIG_MWINCHIP2 is not set

# CONFIG_MWINCHIP3D is not set

# CONFIG_MGEODEGX1 is not set

# CONFIG_MGEODE_LX is not set

# CONFIG_MCYRIXIII is not set

# CONFIG_MVIAC3_2 is not set

# CONFIG_MVIAC7 is not set

CONFIG_X86_GENERIC=y

CONFIG_X86_CMPXCHG=y

CONFIG_X86_L1_CACHE_SHIFT=7

CONFIG_X86_XADD=y

CONFIG_RWSEM_XCHGADD_ALGORITHM=y

# CONFIG_ARCH_HAS_ILOG2_U32 is not set

# CONFIG_ARCH_HAS_ILOG2_U64 is not set

CONFIG_GENERIC_CALIBRATE_DELAY=y

CONFIG_X86_WP_WORKS_OK=y

CONFIG_X86_INVLPG=y

CONFIG_X86_BSWAP=y

CONFIG_X86_POPAD_OK=y

CONFIG_X86_GOOD_APIC=y

CONFIG_X86_INTEL_USERCOPY=y

CONFIG_X86_USE_PPRO_CHECKSUM=y

CONFIG_X86_TSC=y

CONFIG_X86_MINIMUM_CPU_FAMILY=4

CONFIG_HPET_TIMER=y

CONFIG_HPET_EMULATE_RTC=y

CONFIG_NR_CPUS=2

# CONFIG_SCHED_SMT is not set

CONFIG_SCHED_MC=y

# CONFIG_PREEMPT_NONE is not set

# CONFIG_PREEMPT_VOLUNTARY is not set

CONFIG_PREEMPT=y

CONFIG_PREEMPT_BKL=y

CONFIG_X86_LOCAL_APIC=y

CONFIG_X86_IO_APIC=y

CONFIG_X86_MCE=y

# CONFIG_X86_MCE_NONFATAL is not set

# CONFIG_X86_MCE_P4THERMAL is not set

CONFIG_VM86=y

# CONFIG_TOSHIBA is not set

CONFIG_I8K=y

CONFIG_X86_REBOOTFIXUPS=y

CONFIG_MICROCODE=m

CONFIG_MICROCODE_OLD_INTERFACE=y

CONFIG_X86_MSR=y

CONFIG_X86_CPUID=y

```

----------

## lokik

I also have 

```
#

# Processor type and features

#

CONFIG_TICK_ONESHOT=y

CONFIG_NO_HZ=y

CONFIG_HIGH_RES_TIMERS=y

```

and

```
CONFIG_X86_MCE_NONFATAL=y

CONFIG_X86_MCE_P4THERMAL=y

```

and these are also different

```
# CONFIG_I8K is not set

# CONFIG_X86_REBOOTFIXUPS is not set

CONFIG_MICROCODE=m

CONFIG_MICROCODE_OLD_INTERFACE=y

CONFIG_X86_MSR=m

CONFIG_X86_CPUID=m

```

By the way, my ACPI and cpufreq related config is

```
#

# Power management options (ACPI, APM)

#

CONFIG_PM=y

# CONFIG_PM_LEGACY is not set

CONFIG_PM_DEBUG=y

# CONFIG_PM_VERBOSE is not set

# CONFIG_DISABLE_CONSOLE_SUSPEND is not set

CONFIG_PM_TRACE=y

CONFIG_PM_SLEEP_SMP=y

CONFIG_PM_SLEEP=y

CONFIG_SUSPEND_SMP_POSSIBLE=y

CONFIG_SUSPEND=y

CONFIG_HIBERNATION_SMP_POSSIBLE=y

# CONFIG_HIBERNATION is not set

CONFIG_ACPI=y

CONFIG_ACPI_SLEEP=y

CONFIG_ACPI_PROCFS=y

CONFIG_ACPI_PROC_EVENT=y

CONFIG_ACPI_AC=y

CONFIG_ACPI_BATTERY=y

CONFIG_ACPI_BUTTON=y

CONFIG_ACPI_VIDEO=m

CONFIG_ACPI_FAN=y

CONFIG_ACPI_DOCK=y

# CONFIG_ACPI_BAY is not set

CONFIG_ACPI_PROCESSOR=y

CONFIG_ACPI_HOTPLUG_CPU=y

CONFIG_ACPI_THERMAL=y

# CONFIG_ACPI_ASUS is not set

# CONFIG_ACPI_TOSHIBA is not set

CONFIG_ACPI_BLACKLIST_YEAR=0

# CONFIG_ACPI_DEBUG is not set

CONFIG_ACPI_EC=y

CONFIG_ACPI_POWER=y

CONFIG_ACPI_SYSTEM=y

CONFIG_X86_PM_TIMER=y

CONFIG_ACPI_CONTAINER=y

# CONFIG_ACPI_SBS is not set

# CONFIG_APM is not set

#

# CPU Frequency scaling

#

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_TABLE=y

# CONFIG_CPU_FREQ_DEBUG is not set

CONFIG_CPU_FREQ_STAT=y

CONFIG_CPU_FREQ_STAT_DETAILS=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_POWERSAVE=y

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set

#

# CPUFreq processor drivers

#

CONFIG_X86_ACPI_CPUFREQ=y

# CONFIG_X86_POWERNOW_K6 is not set

# CONFIG_X86_POWERNOW_K7 is not set

# CONFIG_X86_POWERNOW_K8 is not set

# CONFIG_X86_GX_SUSPMOD is not set

CONFIG_X86_SPEEDSTEP_CENTRINO=y

CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y

# CONFIG_X86_SPEEDSTEP_ICH is not set

# CONFIG_X86_SPEEDSTEP_SMI is not set

CONFIG_X86_P4_CLOCKMOD=y

# CONFIG_X86_CPUFREQ_NFORCE2 is not set

# CONFIG_X86_LONGRUN is not set

# CONFIG_X86_LONGHAUL is not set

# CONFIG_X86_E_POWERSAVER is not set

#

# shared options

#

# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set

CONFIG_X86_SPEEDSTEP_LIB=y

```

I'm sure some of them are not needed (like CONFIG_X86_P4_CLOCKMOD) but those have history   :Wink: 

----------

## hfk

Hello,

the CONFIG_X86_ACPI_CPUFREQ is the problem. If I deactivate no error log comes up.

CONFIG_X86_SPEEDSTEP_CENTRINO does no matter.

----------

## BlueWhisper

Hi!

I have a D630 too, and the same problem...   :Sad: 

I don't think the kernel config is the problem, but I'll be glad to test someone's working config if needed!

Thanks!

----------

## hfk

I'll do it like our famous german chancellor Helmut Kohl:

I'll sit it out.

Thanks for your help.

----------

## BlueWhisper

I found a workaround:

http://gnugeneration.epfl.ch/users/fasnacht/d630_cpufreq

----------

## hfk

Thank you http://gnugeneration.epfl.ch/users/fasnacht/d630_cpufreq works!

But:

Append the line to /etc/hibernate/ram.conf

```
EnableD630CpufreqFix On
```

By the way: if you used SuSEs s2ram reemerge sys-power/hibernate-script.

----------

## aXi

I have the same problem with the suspend to RAM and standby feature from the gentoo-sources kernel.

I figure out that if I unload and reload the acpi_cpufreq module, all works fine again (even the gnome cpu frequency applet).

Here is the few commands I launch every time I get out the suspend state (I don't use cpufred, only cpufrequtils) :

```

  /etc/init.d/cpufrequtils stop

  rmmod -f acpi_cpufreq

  modprobe acpi_cpufreq

  /etc/init.d/cpufrequtils start

```

I know it is a bit ugly, but it is better than nothing...waiting for a real fix.

Bests

[EDIT] Ok, it is basically wath does the patch above  :Smile: 

----------

