Re: [2.6.31-git17] WARNING: at kernel/hrtimer.c:648 hres_timers_resume+0x40/0x50()/WARNING: at drivers/base/sys.c:353 __sysdev_resume+0xc3/0xe0()

From: Yong Zhang
Date: Sun Sep 27 2009 - 04:30:28 EST


On Sun, Sep 27, 2009 at 4:27 PM, Yong Zhang <yong.zhang0@xxxxxxxxx> wrote:
> On Sun, Sep 27, 2009 at 4:05 PM, Maciej Rutecki
> <maciej.rutecki@xxxxxxxxx> wrote:
>> Kernel: 2.6.31-git17
>>
>> During suspend to disk & resume I got it in dmesg:
>>
>> [ Â587.940010] ------------[ cut here ]------------
>> [ Â587.940010] WARNING: at kernel/hrtimer.c:648 hres_timers_resume+0x40/0x50()
>> [ Â587.940010] Hardware name: HP Compaq nx6310 (EY501ES#AKD)
>> [ Â587.940010] hres_timers_resume() called with IRQs enabled!
>> [ Â587.940010] Modules linked in: btusb i915 drm_kms_helper drm
>> i2c_algo_bit i2c_core sco bnep rfcomm l2cap crc16 bluetooth xt_tcpudp
>> xt_limit xt_state iptable_filter nf_conntrack_ipv4 nf_conntrack
>> nf_defrag_ipv4 ip_tables x_tables aes_i586 aes_generic cbc dm_crypt
>> dm_snapshot dm_mirror dm_region_hash dm_log dm_mod hp_wmi fuse sbp2
>> loop snd_hda_codec_si3054 snd_hda_codec_analog snd_hda_intel
>> snd_hda_codec arc4 snd_pcm_oss snd_mixer_oss snd_pcm ecb snd_seq_dummy
>> snd_seq_oss snd_seq_midi iwl3945 iwlcore snd_rawmidi
>> snd_seq_midi_event snd_seq firmware_class pcmcia snd_timer
>> snd_seq_device mac80211 b44 snd rtc_cmos video led_class ohci1394
>> uhci_hcd yenta_socket intel_agp ssb soundcore rsrc_nonstatic backlight
>> rtc_core ehci_hcd cfg80211 agpgart rtc_lib pcmcia_core mii
>> snd_page_alloc ieee1394 rfkill sg output psmouse fan button ac usbcore
>> battery serio_raw evdev
>> [ Â587.940010] Pid: 4761, comm: pm-hibernate Not tainted 2.6.31-git17 #1
>> [ Â587.940010] Call Trace:
>> [ Â587.940010] Â[<c015b340>] ? hres_timers_resume+0x40/0x50
>> [ Â587.940010] Â[<c015b340>] ? hres_timers_resume+0x40/0x50
>> [ Â587.940010] Â[<c013c3a1>] warn_slowpath_common+0x71/0xc0
>> [ Â587.940010] Â[<c015b340>] ? hres_timers_resume+0x40/0x50
>> [ Â587.940010] Â[<c013c43b>] warn_slowpath_fmt+0x2b/0x30
>> [ Â587.940010] Â[<c015b340>] hres_timers_resume+0x40/0x50
>> [ Â587.940010] Â[<c015f9b7>] timekeeping_resume+0x1a7/0x1c0
>> [ Â587.940010] Â[<c030f3fc>] __sysdev_resume+0x1c/0xe0
>> [ Â587.940010] Â[<c030f50f>] sysdev_resume+0x4f/0xc0
>> [ Â587.940010] Â[<c0176909>] ? hibernate_nvs_restore+0x19/0x60
>> [ Â587.940010] Â[<c0172ac1>] hibernation_snapshot+0x1d1/0x210
>> [ Â587.940010] Â[<c0171b54>] ? freeze_processes+0x44/0xa0
>> [ Â587.940010] Â[<c0172bef>] hibernate+0xef/0x190
>> [ Â587.940010] Â[<c0171590>] ? state_store+0x0/0xc0
>> [ Â587.940010] Â[<c017163b>] state_store+0xab/0xc0
>> [ Â587.940010] Â[<c0171590>] ? state_store+0x0/0xc0
>> [ Â587.940010] Â[<c0285e04>] kobj_attr_store+0x24/0x30
>> [ Â587.940010] Â[<c0223d82>] sysfs_write_file+0xa2/0x100
>> [ Â587.940010] Â[<c01d880c>] vfs_write+0x9c/0x150
>> [ Â587.940010] Â[<c0223ce0>] ? sysfs_write_file+0x0/0x100
>> [ Â587.940010] Â[<c01d8982>] sys_write+0x42/0x70
>> [ Â587.940010] Â[<c0102f04>] sysenter_do_call+0x12/0x22
>> [ Â587.940010] ---[ end trace d928cdf192623f0f ]---
>> [ Â587.940010] ------------[ cut here ]------------
>> [ Â587.940010] WARNING: at drivers/base/sys.c:353 __sysdev_resume+0xc3/0xe0()
>> [ Â587.940010] Hardware name: HP Compaq nx6310 (EY501ES#AKD)
>> [ Â587.940010] Interrupts enabled after timekeeping_resume+0x0/0x1c0
>> [ Â587.940010] Modules linked in: btusb i915 drm_kms_helper drm
>> i2c_algo_bit i2c_core sco bnep rfcomm l2cap crc16 bluetooth xt_tcpudp
>> xt_limit xt_state iptable_filter nf_conntrack_ipv4 nf_conntrack
>> nf_defrag_ipv4 ip_tables x_tables aes_i586 aes_generic cbc dm_crypt
>> dm_snapshot dm_mirror dm_region_hash dm_log dm_mod hp_wmi fuse sbp2
>> loop snd_hda_codec_si3054 snd_hda_codec_analog snd_hda_intel
>> snd_hda_codec arc4 snd_pcm_oss snd_mixer_oss snd_pcm ecb snd_seq_dummy
>> snd_seq_oss snd_seq_midi iwl3945 iwlcore snd_rawmidi
>> snd_seq_midi_event snd_seq firmware_class pcmcia snd_timer
>> snd_seq_device mac80211 b44 snd rtc_cmos video led_class ohci1394
>> uhci_hcd yenta_socket intel_agp ssb soundcore rsrc_nonstatic backlight
>> rtc_core ehci_hcd cfg80211 agpgart rtc_lib pcmcia_core mii
>> snd_page_alloc ieee1394 rfkill sg output psmouse fan button ac usbcore
>> battery serio_raw evdev
>> [ Â587.940010] Pid: 4761, comm: pm-hibernate Tainted: G Â Â Â ÂW
>> 2.6.31-git17 #1
>> [ Â587.940010] Call Trace:
>> [ Â587.940010] Â[<c030f4a3>] ? __sysdev_resume+0xc3/0xe0
>> [ Â587.940010] Â[<c030f4a3>] ? __sysdev_resume+0xc3/0xe0
>> [ Â587.940010] Â[<c013c3a1>] warn_slowpath_common+0x71/0xc0
>> [ Â587.940010] Â[<c030f4a3>] ? __sysdev_resume+0xc3/0xe0
>> [ Â587.940010] Â[<c013c43b>] warn_slowpath_fmt+0x2b/0x30
>> [ Â587.940010] Â[<c030f4a3>] __sysdev_resume+0xc3/0xe0
>> [ Â587.940010] Â[<c015f810>] ? timekeeping_resume+0x0/0x1c0
>> [ Â587.940010] Â[<c030f50f>] sysdev_resume+0x4f/0xc0
>> [ Â587.940010] Â[<c0176909>] ? hibernate_nvs_restore+0x19/0x60
>> [ Â587.940010] Â[<c0172ac1>] hibernation_snapshot+0x1d1/0x210
>> [ Â587.940010] Â[<c0171b54>] ? freeze_processes+0x44/0xa0
>> [ Â587.940010] Â[<c0172bef>] hibernate+0xef/0x190
>> [ Â587.940010] Â[<c0171590>] ? state_store+0x0/0xc0
>> [ Â587.940010] Â[<c017163b>] state_store+0xab/0xc0
>> [ Â587.940010] Â[<c0171590>] ? state_store+0x0/0xc0
>> [ Â587.940010] Â[<c0285e04>] kobj_attr_store+0x24/0x30
>> [ Â587.940010] Â[<c0223d82>] sysfs_write_file+0xa2/0x100
>> [ Â587.940010] Â[<c01d880c>] vfs_write+0x9c/0x150
>> [ Â587.940010] Â[<c0223ce0>] ? sysfs_write_file+0x0/0x100
>> [ Â587.940010] Â[<c01d8982>] sys_write+0x42/0x70
>> [ Â587.940010] Â[<c0102f04>] sysenter_do_call+0x12/0x22
>> [ Â587.940010] ---[ end trace d928cdf192623f10 ]---
>>
>>
>> After resume system seems works OK.
>>
>
> Does the below patch work?
>
> diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
> index fb0f46f..b39b828 100644
> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -573,7 +573,8 @@ static int timekeeping_resume(struct sys_device *dev)
>
> Â Â Â Âclocksource_resume();
>
> - Â Â Â write_seqlock_irqsave(&xtime_lock, flags);
> + Â Â Â local_irq_save(flags);
> + Â Â Â write_seqlock(&xtime_locks);
>
> Â Â Â Âif (timespec_compare(&ts, &timekeeping_suspend_time) > 0) {
> Â Â Â Â Â Â Â Âts = timespec_sub(ts, timekeeping_suspend_time);
> @@ -586,7 +587,7 @@ static int timekeeping_resume(struct sys_device *dev)
> Â Â Â Âtimekeeper.clock->cycle_last = timekeeper.clock->read(timekeeper.clock);
> Â Â Â Âtimekeeper.ntp_error = 0;
> Â Â Â Âtimekeeping_suspended = 0;
> - Â Â Â write_sequnlock_irqrestore(&xtime_lock, flags);
> + Â Â Â write_sequnlock(&xtime_locks);
>
> Â Â Â Âtouch_softlockup_watchdog();
>
> @@ -594,6 +595,7 @@ static int timekeeping_resume(struct sys_device *dev)
>
> Â Â Â Â/* Resume hrtimers */
> Â Â Â Âhres_timers_resume();
> + Â Â Â local_irq_restore(flags);
>
> Â Â Â Âreturn 0;
> Â}
>

Oops, TABLE is corrupted. Please use the attachment.

Thanks,
Yong

>
>> Dmesg, config, /proc/interrupts:
>> http://unixy.pl/maciek/download/kernel/2.6.31-git17/gumis/
>>
>> Regards
>> --
>> Maciej Rutecki
>> http://www.maciek.unixy.pl
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@xxxxxxxxxxxxxxx
>> More majordomo info at Âhttp://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at Âhttp://www.tux.org/lkml/
>>
>
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index fb0f46f..b39b828 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -573,7 +573,8 @@ static int timekeeping_resume(struct sys_device *dev)

clocksource_resume();

- write_seqlock_irqsave(&xtime_lock, flags);
+ local_irq_save(flags);
+ write_seqlock(&xtime_locks);

if (timespec_compare(&ts, &timekeeping_suspend_time) > 0) {
ts = timespec_sub(ts, timekeeping_suspend_time);
@@ -586,7 +587,7 @@ static int timekeeping_resume(struct sys_device *dev)
timekeeper.clock->cycle_last = timekeeper.clock->read(timekeeper.clock);
timekeeper.ntp_error = 0;
timekeeping_suspended = 0;
- write_sequnlock_irqrestore(&xtime_lock, flags);
+ write_sequnlock(&xtime_locks);

touch_softlockup_watchdog();

@@ -594,6 +595,7 @@ static int timekeeping_resume(struct sys_device *dev)

/* Resume hrtimers */
hres_timers_resume();
+ local_irq_restore(flags);

return 0;
}