2.5.69+bk: oops in apmd after waking up from suspend mode
Hi,
I have an old Compaq Armada 1592DT. The thing goes automagically into suspend mode after being forgotten for a while. And there is this button to wake it up (the blue one, above the keyboard).
Last time i tried to wake it up it produced the attached oops. "Unknown key"s are probable the blue button.
After printing out the oops, the system went back into suspend.
-alex
Suspending devices
Suspending device c03219ac
Unable to handle kernel NULL pointer dereference at virtual address 00000090 printing eip: c011459f *pde = 00000000 Oops: 0000 [#1] CPU: 0 EIP: 0060:[<c011459f>] Not tainted EFLAGS: 00010202
EIP is at fix_processor_context+0x5f/0x100
eax: 0000007c ebx: c5f0e000 ecx: 00000002 edx: 00000000
esi: 00000060 edi: 00000000 ebp: c5f0ff5c esp: c5f0ff54
ds: 007b es: 007b ss: 0068
Process kapmd (pid: 4, threadinfo=c5f0e000 task=c5fbc640)
Stack: c5f0e000 00000060 c5f0ff64 c0114529 c5f0ff78 c01135c8 00000002 00000000
00000002 c5f0ff8c c0113845 00000001 c5f0e000 c5f0ffb4 c5f0ffdc c0113aa4
00000000 c5fbc640 c0117950 00000000 00000000 c0290000 c030f6b4 00000000
Call Trace:
[<c0114529>] restore_processor_state+0x69/0x80
[<c01135c8>] suspend+0x138/0x200
[<c0113845>] check_events+0xf5/0x230
[<c0113aa4>] apm_mainloop+0x94/0xb0
[<c0117950>] default_wake_function+0x0/0x20
[<c0117950>] default_wake_function+0x0/0x20
[<c01141a0>] apm+0x0/0x280
[<c0114262>] apm+0xc2/0x280
[<c0107255>] kernel_thread_helper+0x5/0x10
Code: 8b 48 14 8b 42 7c 85 c0 75 0a b9 00 10 29 c0 b8 05 00 00 00
<6>note: kapmd[4] exited with preempt_count 2hda: dma_timer_expiry: dma status == 0x61atkbd.c: Unknown key (set 2, scancode 0xb6, on isa0060/serio0) pressed. atkbd.c: Unknown key (set 2, scancode 0x9d, on isa0060/serio0) pressed. atkbd.c: Unknown key (set 2, scancode 0x19d, on isa0060/serio0) pressed. atkbd.c: Unknown key (set 2, scancode 0xb8, on isa0060/serio0) pressed.
hda: timeout waiting for DMA
hda: timeout waiting for DMA
hda: (__ide_dma_test_irq) called while not waitingatkbd.c: Unknown key (set 2, scancode 0x1b8, on isa0060/serio0) pressed.
Quoted 27 lines · Alex Riesen
Hi,
I have an old Compaq Armada 1592DT. The thing goes automagically into suspend mode after being forgotten for a while. And there is this button to wake it up (the blue one, above the keyboard).
Last time i tried to wake it up it produced the attached oops. "Unknown key"s are probable the blue button.
After printing out the oops, the system went back into suspend.-alex
Suspending devices
Suspending devicec03219acUnable to handle kernel NULL pointer dereference at virtual address 00000090 printing eip: c011459f *pde = 00000000 Oops: 0000 [#1] CPU: 0 EIP: 0060:[<c011459f>] Not tainted EFLAGS: 00010202EIP is at
fix_processor_context+0x5f/0x100
eax:0000007cebx:c5f0e000ecx: 00000002 edx: 00000000
esi: 00000060 edi: 00000000 ebp:c5f0ff5cesp:c5f0ff54
ds: 007b es: 007b ss: 0068
Process kapmd (pid: 4, threadinfo=c5f0e000 task=c5fbc640)
Quoted 15 lines
Stack: c5f0e000 00000060 c5f0ff64 c0114529 c5f0ff78 c01135c8 00000002 00000000
00000002 c5f0ff8c c0113845 00000001 c5f0e000 c5f0ffb4 c5f0ffdc c0113aa4
00000000 c5fbc640 c0117950 00000000 00000000 c0290000 c030f6b4 00000000
Call Trace:
[<c0114529>] restore_processor_state+0x69/0x80
[<c01135c8>] suspend+0x138/0x200
[<c0113845>] check_events+0xf5/0x230
[<c0113aa4>] apm_mainloop+0x94/0xb0
[<c0117950>] default_wake_function+0x0/0x20
[<c0117950>] default_wake_function+0x0/0x20
[<c01141a0>] apm+0x0/0x280
[<c0114262>] apm+0xc2/0x280
[<c0107255>] kernel_thread_helper+0x5/0x10
Code: 8b 48 14 8b 42 7c 85 c0 75 0a b9 00 10 29 c0 b8 05 00 00 00 Since 2.5.69-bk8 or so, apm.c will invoke restore_processor_state() at resume-time. This is needed to reinitialise the SYSENTER MSRs used by 2.5's new system call mechanism.
Quoted 1 line
<6>note: kapmd[4] exited with
preempt_count2
This I don't like. I'm not convinced the resume path is preempt-safe. Please try again, either with CONFIG_PREEMPT disabled, or with a preempt_disable() / preempt_enable() pair around apm.c's suspend code, like in the patch below. (Untested, you may need to stick an #include <preempt.h> somewhere in apm.c to make it compile.)
/Mikael
arch/i386/kernel/apm.c renamed from arch/i386/kernel/apm.c.~1~ +2 -0
@@ -1213,9 +1213,11 @@spin_unlock (&i8253_lock);write_sequnlock_irq (&xtime_lock); +preempt_disable ();save_processor_state (); err =set_system_power_state (APM_STATE_SUSPEND );restore_processor_state (); +preempt_enable ();write_seqlock_irq (&xtime_lock);spin_lock (&i8253_lock);
[email protected], Wed, May 14, 2003 15:04:38 +0200:
Quoted 11 lines
Quoted 11 lines
I have an old Compaq Armada 1592DT. The thing goes automagically into suspend mode after being forgotten for a while. And there is this button to wake it up (the blue one, above the keyboard).
Last time i tried to wake it up it produced the attached oops. "Unknown key"s are probable the blue button.
After printing out the oops, the system went back into suspend.Suspending devices
Suspending devicec03219acUnable to handle kernel NULL pointer dereference at virtual address 00000090
...
Quoted 1 line
Quoted 1 line
EIP is at
fix_processor_context+0x5f/0x100
...
Quoted 11 lines
Quoted 10 lines
Call Trace: [<c0114529>] restore_processor_state+0x69/0x80 [<c01135c8>] suspend+0x138/0x200 [<c0113845>] check_events+0xf5/0x230 [<c0113aa4>] apm_mainloop+0x94/0xb0 [<c0117950>] default_wake_function+0x0/0x20 [<c0117950>] default_wake_function+0x0/0x20 [<c01141a0>] apm+0x0/0x280 [<c0114262>] apm+0xc2/0x280 [<c0107255>] kernel_thread_helper+0x5/0x10
Quoted 3 lines
Since 2.5.69-bk8 or so,
apm.cwill invokerestore_processor_state()at resume-time. This is needed to reinitialise the SYSENTER MSRs used by 2.5's new system call mechanism.
and it supposed to go oops?
Quoted 6 lines
Quoted 1 line
<6>note: kapmd[4] exited with
preempt_count2This I don't like. I'm not convinced the resume path is preempt-safe. Please try again, either with
CONFIG_PREEMPTdisabled, or with apreempt_disable()/preempt_enable()pair around apm.c's suspend code, like in the patch below. (Untested, you may need to stick an #include <preempt.h> somewhere inapm.cto make it compile.)
It changed things a bit. preempt_count is 3 now.
Oops didn't change.
The system still works, afaict. Didn't notice any ill effects.
-alex
Quoted 6 lines · Alex Riesen
[email protected], Wed, May 14, 2003 15:04:38 +0200:
Quoted 3 lines
Since 2.5.69-bk8 or so,
apm.cwill invokerestore_processor_state()at resume-time. This is needed to reinitialise the SYSENTER MSRs used by 2.5's new system call mechanism.and it supposed to go oops?
Of course not. It doesn't oops my Dell Latitude: on that laptop it prevents oopses since otherwise user-space processes will oops the kernel as soon as they make a system call or return from a system call. But this only happens if both the CPU and glibc are capable of using SYSENTER.
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
<6>note: kapmd[4] exited with
preempt_count2This I don't like. I'm not convinced the resume path is preempt-safe. Please try again, either with
CONFIG_PREEMPTdisabled, or with apreempt_disable()/preempt_enable()pair around apm.c's suspend code, like in the patch below. (Untested, you may need to stick an #include <preempt.h> somewhere inapm.cto make it compile.)It changed things a bit.
preempt_countis 3 now.
Oops didn't change.
Ok so it wasn't preempt.
Can you identify in which statement the oops occurs?
And can you confirm that commenting out the calls in apm.c to save_processor_state() and restore_processor_state() eliminates the oops?
/Mikael
[email protected], Wed, May 14, 2003 16:03:55 +0200:
Quoted 11 lines
Quoted 5 lines
Quoted 3 lines
Since 2.5.69-bk8 or so,
apm.cwill invokerestore_processor_state()at resume-time. This is needed to reinitialise the SYSENTER MSRs used by 2.5's new system call mechanism.and it supposed to go oops?
Of course not. It doesn't oops my Dell Latitude: on that laptop it prevents oopses since otherwise user-space processes will oops the kernel as soon as they make a system call or return from a system call. But this only happens if both the CPU and glibc are capable of using SYSENTER.
I'm not sure if my glibc uses sysenter. But I'd like to have the system prepared if I eventually get one which does.
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 1 line
<6>note: kapmd[4] exited with
preempt_count2This I don't like. I'm not convinced the resume path is preempt-safe. Please try again, either with
CONFIG_PREEMPTdisabled, or with apreempt_disable()/preempt_enable()pair around apm.c's suspend code, like in the patch below. (Untested, you may need to stick an #include <preempt.h> somewhere inapm.cto make it compile.)
Quoted 5 lines
Quoted 2 lines
It changed things a bit.
preempt_countis 3 now.
Oops didn't change.Ok so it wasn't preempt.
Can you identify in which statement the oops occurs?
not really. Somewhere fix_processor_context+0x5f/0x100, that's where EIP points. But latest bk doesn't have this anymore, so I think I'll try it first.
Quoted 2 lines
And can you confirm that commenting out the calls in
apm.ctosave_processor_state()andrestore_processor_state()eliminates the oops?
after I have tried it.
Quoted 2 lines · Alex Riesen
I'm not sure if my glibc uses sysenter. But I'd like to have the system prepared if I eventually get one which does.
RH9 on a P6/K7 or higher will use sysenter. Old P5s don't have it.
Quoted 2 lines
not really. Somewhere
fix_processor_context+0x5f/0x100, that's where EIP points.
I need to know your .config and gcc version if I'm to investigate this. Otherwise I can't build a kernel similar to yours, and without that, the EIP address you quoted is meaningless to me.
/Mikael
[email protected], Wed, May 14, 2003 16:37:58 +0200:
Quoted 6 lines
Quoted 2 lines · Alex Riesen
I'm not sure if my glibc uses sysenter. But I'd like to have the system prepared if I eventually get one which does.
RH9 on a P6/K7 or higher will use sysenter. Old P5s don't have it.
P5-233. Dunno how old it really is (model 8, Mobile Pentium MMX, stepping 1).
Quoted 7 lines
Quoted 2 lines
not really. Somewhere
fix_processor_context+0x5f/0x100, that's where EIP points.I need to know your .config and gcc version if I'm to investigate this. Otherwise I can't build a kernel similar to yours, and without that, the EIP address you quoted is meaningless to me.
Sorry. Here it goes (comments stripped):
CONFIG_X86=yCONFIG_MMU=yCONFIG_UID16=yCONFIG_GENERIC_ISA_DMA=yCONFIG_EXPERIMENTAL=yCONFIG_SWAP=yCONFIG_SYSVIPC=yCONFIG_BSD_PROCESS_ACCT=yCONFIG_SYSCTL=yCONFIG_LOG_BUF_SHIFT=14CONFIG_MODULES=yCONFIG_MODULE_UNLOAD=yCONFIG_MODULE_FORCE_UNLOAD=yCONFIG_OBSOLETE_MODPARM=yCONFIG_KMOD=yCONFIG_X86_PC=yCONFIG_M586MMX=yCONFIG_X86_CMPXCHG=yCONFIG_X86_XADD=yCONFIG_X86_L1_CACHE_SHIFT=5CONFIG_RWSEM_XCHGADD_ALGORITHM=yCONFIG_X86_PPRO_FENCE=yCONFIG_X86_F00F_BUG=yCONFIG_X86_WP_WORKS_OK=yCONFIG_X86_INVLPG=yCONFIG_X86_BSWAP=yCONFIG_X86_POPAD_OK=yCONFIG_X86_ALIGNMENT_16=yCONFIG_X86_GOOD_APIC=yCONFIG_X86_INTEL_USERCOPY=yCONFIG_PREEMPT=yCONFIG_X86_TSC=yCONFIG_X86_MSR=mCONFIG_X86_CPUID=mCONFIG_EDD=yCONFIG_NOHIGHMEM=yCONFIG_MTRR=yCONFIG_HAVE_DEC_LOCK=yCONFIG_PM=yCONFIG_APM=yCONFIG_APM_CPU_IDLE=yCONFIG_APM_DISPLAY_BLANK=yCONFIG_PCI=yCONFIG_PCI_GOANY=yCONFIG_PCI_BIOS=yCONFIG_PCI_DIRECT=yCONFIG_PCI_NAMES=yCONFIG_ISA=yCONFIG_HOTPLUG=yCONFIG_PCMCIA=mCONFIG_CARDBUS=yCONFIG_I82092=mCONFIG_I82365=mCONFIG_PCMCIA_PROBE=yCONFIG_KCORE_ELF=yCONFIG_BINFMT_ELF=yCONFIG_BINFMT_MISC=mCONFIG_PARPORT=mCONFIG_PARPORT_PC=mCONFIG_PARPORT_PC_CML1=mCONFIG_PARPORT_SERIAL=mCONFIG_PARPORT_PC_FIFO=yCONFIG_PARPORT_PC_SUPERIO=yCONFIG_PARPORT_1284=yCONFIG_PNP=yCONFIG_PNP_NAMES=yCONFIG_PNP_DEBUG=yCONFIG_ISAPNP=yCONFIG_PNPBIOS=yCONFIG_BLK_DEV_FD=mCONFIG_BLK_DEV_LOOP=mCONFIG_IDE=yCONFIG_BLK_DEV_IDE=yCONFIG_BLK_DEV_IDEDISK=yCONFIG_IDEDISK_MULTI_MODE=yCONFIG_BLK_DEV_IDECS=mCONFIG_BLK_DEV_IDECD=yCONFIG_BLK_DEV_IDESCSI=mCONFIG_BLK_DEV_IDEPCI=yCONFIG_BLK_DEV_GENERIC=yCONFIG_IDEPCI_SHARE_IRQ=yCONFIG_BLK_DEV_IDEDMA_PCI=yCONFIG_IDEDMA_PCI_AUTO=yCONFIG_BLK_DEV_IDEDMA=yCONFIG_BLK_DEV_ADMA=yCONFIG_BLK_DEV_OPTI621=yCONFIG_IDEDMA_AUTO=yCONFIG_BLK_DEV_IDE_MODES=yCONFIG_SCSI=mCONFIG_BLK_DEV_SD=mCONFIG_BLK_DEV_SR=mCONFIG_CHR_DEV_SG=mCONFIG_SCSI_MULTI_LUN=yCONFIG_SCSI_REPORT_LUNS=yCONFIG_SCSI_CONSTANTS=yCONFIG_NET=yCONFIG_PACKET=yCONFIG_PACKET_MMAP=yCONFIG_NETFILTER=yCONFIG_UNIX=yCONFIG_NET_KEY=mCONFIG_INET=yCONFIG_IP_MULTICAST=yCONFIG_INET_ECN=yCONFIG_SYN_COOKIES=yCONFIG_IP_NF_CONNTRACK=mCONFIG_IP_NF_FTP=mCONFIG_IP_NF_IRC=mCONFIG_IP_NF_IPTABLES=mCONFIG_IP_NF_MATCH_LIMIT=mCONFIG_IP_NF_MATCH_MAC=mCONFIG_IP_NF_MATCH_PKTTYPE=mCONFIG_IP_NF_MATCH_MARK=mCONFIG_IP_NF_MATCH_MULTIPORT=mCONFIG_IP_NF_MATCH_TOS=mCONFIG_IP_NF_MATCH_ECN=mCONFIG_IP_NF_MATCH_DSCP=mCONFIG_IP_NF_MATCH_AH_ESP=mCONFIG_IP_NF_MATCH_LENGTH=mCONFIG_IP_NF_MATCH_TTL=mCONFIG_IP_NF_MATCH_TCPMSS=mCONFIG_IP_NF_MATCH_HELPER=mCONFIG_IP_NF_MATCH_STATE=mCONFIG_IP_NF_MATCH_CONNTRACK=mCONFIG_IP_NF_MATCH_UNCLEAN=mCONFIG_IP_NF_MATCH_OWNER=mCONFIG_IP_NF_FILTER=mCONFIG_IP_NF_TARGET_REJECT=mCONFIG_IP_NF_TARGET_MIRROR=mCONFIG_IP_NF_NAT=mCONFIG_IP_NF_NAT_NEEDED=yCONFIG_IP_NF_TARGET_MASQUERADE=mCONFIG_IP_NF_TARGET_REDIRECT=mCONFIG_IP_NF_NAT_IRC=mCONFIG_IP_NF_NAT_FTP=mCONFIG_IP_NF_MANGLE=mCONFIG_IP_NF_TARGET_TOS=mCONFIG_IP_NF_TARGET_ECN=mCONFIG_IP_NF_TARGET_DSCP=mCONFIG_IP_NF_TARGET_MARK=mCONFIG_IP_NF_TARGET_LOG=mCONFIG_IP_NF_TARGET_ULOG=mCONFIG_IP_NF_TARGET_TCPMSS=mCONFIG_IPV6=mCONFIG_IPV6_SCTP__=mCONFIG_NETDEVICES=yCONFIG_DUMMY=mCONFIG_NET_PCMCIA=yCONFIG_PCMCIA_3C589=mCONFIG_PCMCIA_3C574=mCONFIG_PCMCIA_FMVJ18X=mCONFIG_PCMCIA_PCNET=mCONFIG_PCMCIA_NMCLAN=mCONFIG_PCMCIA_SMC91C92=mCONFIG_PCMCIA_XIRC2PS=mCONFIG_IRDA=mCONFIG_IRLAN=mCONFIG_IRCOMM=mCONFIG_IRDA_ULTRA=yCONFIG_IRDA_CACHE_LAST_LSAP=yCONFIG_IRDA_FAST_RR=yCONFIG_IRDA_DEBUG=yCONFIG_IRTTY_SIR=mCONFIG_NSC_FIR=mCONFIG_WINBOND_FIR=mCONFIG_TOSHIBA_OLD=mCONFIG_TOSHIBA_FIR=mCONFIG_SMC_IRCC_FIR=mCONFIG_ALI_FIR=mCONFIG_VLSI_FIR=mCONFIG_INPUT=yCONFIG_INPUT_MOUSEDEV=mCONFIG_INPUT_MOUSEDEV_SCREEN_X=1024CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768CONFIG_SOUND_GAMEPORT=yCONFIG_SERIO=yCONFIG_SERIO_I8042=yCONFIG_INPUT_KEYBOARD=yCONFIG_KEYBOARD_ATKBD=yCONFIG_INPUT_MOUSE=yCONFIG_MOUSE_PS2=mCONFIG_INPUT_MISC=yCONFIG_INPUT_PCSPKR=yCONFIG_VT=yCONFIG_VT_CONSOLE=yCONFIG_HW_CONSOLE=yCONFIG_SERIAL_8250=yCONFIG_SERIAL_8250_CONSOLE=yCONFIG_SERIAL_CORE=yCONFIG_SERIAL_CORE_CONSOLE=yCONFIG_UNIX98_PTYS=yCONFIG_UNIX98_PTY_COUNT=256CONFIG_RTC=yCONFIG_EXT2_FS=yCONFIG_EXT2_FS_XATTR=yCONFIG_EXT3_FS=yCONFIG_EXT3_FS_XATTR=yCONFIG_EXT3_FS_POSIX_ACL=yCONFIG_JBD=yCONFIG_FS_MBCACHE=yCONFIG_FS_POSIX_ACL=yCONFIG_ISO9660_FS=mCONFIG_JOLIET=yCONFIG_ZISOFS=yCONFIG_ZISOFS_FS=mCONFIG_FAT_FS=mCONFIG_MSDOS_FS=mCONFIG_VFAT_FS=mCONFIG_PROC_FS=yCONFIG_DEVPTS_FS=yCONFIG_TMPFS=yCONFIG_RAMFS=yCONFIG_NFS_FS=mCONFIG_NFS_V3=yCONFIG_LOCKD=mCONFIG_LOCKD_V4=yCONFIG_SUNRPC=mCONFIG_SMB_FS=mCONFIG_CIFS=mCONFIG_MSDOS_PARTITION=yCONFIG_SMB_NLS=yCONFIG_NLS=yCONFIG_NLS_DEFAULT="iso8859-1"CONFIG_NLS_CODEPAGE_437=yCONFIG_NLS_CODEPAGE_850=mCONFIG_NLS_CODEPAGE_852=mCONFIG_NLS_CODEPAGE_855=mCONFIG_NLS_CODEPAGE_866=mCONFIG_NLS_CODEPAGE_1250=mCONFIG_NLS_CODEPAGE_1251=mCONFIG_NLS_ISO8859_1=yCONFIG_NLS_ISO8859_2=mCONFIG_NLS_ISO8859_5=mCONFIG_NLS_ISO8859_15=mCONFIG_NLS_KOI8_R=mCONFIG_NLS_KOI8_U=mCONFIG_NLS_UTF8=mCONFIG_FB=yCONFIG_FB_VESA=yCONFIG_VIDEO_SELECT=yCONFIG_VGA_CONSOLE=yCONFIG_DUMMY_CONSOLE=yCONFIG_FRAMEBUFFER_CONSOLE=yCONFIG_PCI_CONSOLE=yCONFIG_FONTS=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=yCONFIG_LOGO=yCONFIG_LOGO_LINUX_CLUT224=yCONFIG_SOUND=mCONFIG_SND=mCONFIG_SND_SEQUENCER=mCONFIG_SND_OSSEMUL=yCONFIG_SND_MIXER_OSS=mCONFIG_SND_PCM_OSS=mCONFIG_SND_SEQUENCER_OSS=yCONFIG_SND_DEBUG=yCONFIG_SND_DEBUG_DETECT=yCONFIG_SND_DUMMY=mCONFIG_SND_SB8=mCONFIG_SND_SB16=mCONFIG_SOUND_PRIME=mCONFIG_SOUND_OSS=mCONFIG_SOUND_TRACEINIT=yCONFIG_SOUND_VMIDI=mCONFIG_SOUND_SB=mCONFIG_USB=mCONFIG_USB_DEVICEFS=yCONFIG_USB_BANDWIDTH=yCONFIG_USB_OHCI_HCD=mCONFIG_USB_PRINTER=mCONFIG_USB_STORAGE=mCONFIG_USB_STORAGE_DATAFAB=yCONFIG_USB_STORAGE_FREECOM=yCONFIG_USB_STORAGE_ISD200=yCONFIG_USB_STORAGE_DPCM=y
CONFIG_USB_STORAGE_HP8200e=yCONFIG_USB_STORAGE_SDDR09=yCONFIG_USB_STORAGE_SDDR55=yCONFIG_USB_STORAGE_JUMPSHOT=yCONFIG_USB_HID=mCONFIG_USB_HIDINPUT=yCONFIG_USB_SCANNER=mCONFIG_DEBUG_KERNEL=yCONFIG_DEBUG_SLAB=yCONFIG_MAGIC_SYSRQ=yCONFIG_KALLSYMS=yCONFIG_DEBUG_SPINLOCK_SLEEP=yCONFIG_FRAME_POINTER=yCONFIG_CRC32=mCONFIG_ZLIB_INFLATE=mCONFIG_X86_BIOS_REBOOT=y