Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319895
b: refs/heads/master
c: 45226e9
h: refs/heads/master
i:
  319893: 1472d6e
  319891: 4bd04d8
  319887: 1d098e7
v: v3
  • Loading branch information
Sameer Nanda authored and Linus Torvalds committed Jul 31, 2012
1 parent 1c8f5c8 commit 9024501
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 190320c3b6640d4104650f55ff69611e050ea06b
refs/heads/master: 45226e944ce071d0231949f2fea90969437cd2dc
8 changes: 8 additions & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,14 @@ static inline void lockup_detector_init(void)
}
#endif

#if defined(CONFIG_LOCKUP_DETECTOR) && defined(CONFIG_SUSPEND)
void lockup_detector_bootcpu_resume(void);
#else
static inline void lockup_detector_bootcpu_resume(void)
{
}
#endif

#ifdef CONFIG_DETECT_HUNG_TASK
extern unsigned int sysctl_hung_task_panic;
extern unsigned long sysctl_hung_task_check_count;
Expand Down
3 changes: 3 additions & 0 deletions trunk/kernel/power/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
arch_suspend_enable_irqs();
BUG_ON(irqs_disabled());

/* Kick the lockup detector */
lockup_detector_bootcpu_resume();

Enable_cpus:
enable_nonboot_cpus();

Expand Down
21 changes: 19 additions & 2 deletions trunk/kernel/watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ int proc_dowatchdog(struct ctl_table *table, int write,
/*
* Create/destroy watchdog threads as CPUs come and go:
*/
static int __cpuinit
static int
cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
{
int hotcpu = (unsigned long)hcpu;
Expand Down Expand Up @@ -610,10 +610,27 @@ cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
return NOTIFY_OK;
}

static struct notifier_block __cpuinitdata cpu_nfb = {
static struct notifier_block cpu_nfb = {
.notifier_call = cpu_callback
};

#ifdef CONFIG_SUSPEND
/*
* On exit from suspend we force an offline->online transition on the boot CPU
* so that the PMU state that was lost while in suspended state gets set up
* properly for the boot CPU. This information is required for restarting the
* NMI watchdog.
*/
void lockup_detector_bootcpu_resume(void)
{
void *cpu = (void *)(long)smp_processor_id();

cpu_callback(&cpu_nfb, CPU_DEAD_FROZEN, cpu);
cpu_callback(&cpu_nfb, CPU_UP_PREPARE_FROZEN, cpu);
cpu_callback(&cpu_nfb, CPU_ONLINE_FROZEN, cpu);
}
#endif

void __init lockup_detector_init(void)
{
void *cpu = (void *)(long)smp_processor_id();
Expand Down

0 comments on commit 9024501

Please sign in to comment.