diff options
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r-- | kernel/watchdog.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 9d4c8d5a1f53..c8c21be11ab4 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c | |||
@@ -116,7 +116,7 @@ static unsigned long get_timestamp(int this_cpu) | |||
116 | return cpu_clock(this_cpu) >> 30LL; /* 2^30 ~= 10^9 */ | 116 | return cpu_clock(this_cpu) >> 30LL; /* 2^30 ~= 10^9 */ |
117 | } | 117 | } |
118 | 118 | ||
119 | static unsigned long get_sample_period(void) | 119 | static u64 get_sample_period(void) |
120 | { | 120 | { |
121 | /* | 121 | /* |
122 | * convert watchdog_thresh from seconds to ns | 122 | * convert watchdog_thresh from seconds to ns |
@@ -125,7 +125,7 @@ static unsigned long get_sample_period(void) | |||
125 | * and hard thresholds) to increment before the | 125 | * and hard thresholds) to increment before the |
126 | * hardlockup detector generates a warning | 126 | * hardlockup detector generates a warning |
127 | */ | 127 | */ |
128 | return get_softlockup_thresh() * (NSEC_PER_SEC / 5); | 128 | return get_softlockup_thresh() * ((u64)NSEC_PER_SEC / 5); |
129 | } | 129 | } |
130 | 130 | ||
131 | /* Commands for resetting the watchdog */ | 131 | /* Commands for resetting the watchdog */ |
@@ -368,6 +368,9 @@ static void watchdog_disable(unsigned int cpu) | |||
368 | { | 368 | { |
369 | struct hrtimer *hrtimer = &__raw_get_cpu_var(watchdog_hrtimer); | 369 | struct hrtimer *hrtimer = &__raw_get_cpu_var(watchdog_hrtimer); |
370 | 370 | ||
371 | if (!watchdog_enabled) | ||
372 | return; | ||
373 | |||
371 | watchdog_set_prio(SCHED_NORMAL, 0); | 374 | watchdog_set_prio(SCHED_NORMAL, 0); |
372 | hrtimer_cancel(hrtimer); | 375 | hrtimer_cancel(hrtimer); |
373 | /* disable the perf event */ | 376 | /* disable the perf event */ |