diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-09 03:02:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-09 03:02:35 -0400 |
commit | 1236d6bb6e19fc72ffc6bbcdeb1bfefe450e54ee (patch) | |
tree | 47da3feee8e263e8c9352c85cf518e624be3c211 /include/linux/nmi.h | |
parent | 750b1a6894ecc9b178c6e3d0a1170122971b2036 (diff) | |
parent | 8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff) |
Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/nmi.h')
-rw-r--r-- | include/linux/nmi.h | 121 |
1 files changed, 62 insertions, 59 deletions
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index a36abe2da13e..27e249ed7c5c 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
@@ -12,11 +12,31 @@ | |||
12 | 12 | ||
13 | #ifdef CONFIG_LOCKUP_DETECTOR | 13 | #ifdef CONFIG_LOCKUP_DETECTOR |
14 | void lockup_detector_init(void); | 14 | void lockup_detector_init(void); |
15 | void lockup_detector_soft_poweroff(void); | ||
16 | void lockup_detector_cleanup(void); | ||
17 | bool is_hardlockup(void); | ||
18 | |||
19 | extern int watchdog_user_enabled; | ||
20 | extern int nmi_watchdog_user_enabled; | ||
21 | extern int soft_watchdog_user_enabled; | ||
22 | extern int watchdog_thresh; | ||
23 | extern unsigned long watchdog_enabled; | ||
24 | |||
25 | extern struct cpumask watchdog_cpumask; | ||
26 | extern unsigned long *watchdog_cpumask_bits; | ||
27 | #ifdef CONFIG_SMP | ||
28 | extern int sysctl_softlockup_all_cpu_backtrace; | ||
29 | extern int sysctl_hardlockup_all_cpu_backtrace; | ||
15 | #else | 30 | #else |
16 | static inline void lockup_detector_init(void) | 31 | #define sysctl_softlockup_all_cpu_backtrace 0 |
17 | { | 32 | #define sysctl_hardlockup_all_cpu_backtrace 0 |
18 | } | 33 | #endif /* !CONFIG_SMP */ |
19 | #endif | 34 | |
35 | #else /* CONFIG_LOCKUP_DETECTOR */ | ||
36 | static inline void lockup_detector_init(void) { } | ||
37 | static inline void lockup_detector_soft_poweroff(void) { } | ||
38 | static inline void lockup_detector_cleanup(void) { } | ||
39 | #endif /* !CONFIG_LOCKUP_DETECTOR */ | ||
20 | 40 | ||
21 | #ifdef CONFIG_SOFTLOCKUP_DETECTOR | 41 | #ifdef CONFIG_SOFTLOCKUP_DETECTOR |
22 | extern void touch_softlockup_watchdog_sched(void); | 42 | extern void touch_softlockup_watchdog_sched(void); |
@@ -24,29 +44,17 @@ extern void touch_softlockup_watchdog(void); | |||
24 | extern void touch_softlockup_watchdog_sync(void); | 44 | extern void touch_softlockup_watchdog_sync(void); |
25 | extern void touch_all_softlockup_watchdogs(void); | 45 | extern void touch_all_softlockup_watchdogs(void); |
26 | extern unsigned int softlockup_panic; | 46 | extern unsigned int softlockup_panic; |
27 | extern int soft_watchdog_enabled; | ||
28 | extern atomic_t watchdog_park_in_progress; | ||
29 | #else | 47 | #else |
30 | static inline void touch_softlockup_watchdog_sched(void) | 48 | static inline void touch_softlockup_watchdog_sched(void) { } |
31 | { | 49 | static inline void touch_softlockup_watchdog(void) { } |
32 | } | 50 | static inline void touch_softlockup_watchdog_sync(void) { } |
33 | static inline void touch_softlockup_watchdog(void) | 51 | static inline void touch_all_softlockup_watchdogs(void) { } |
34 | { | ||
35 | } | ||
36 | static inline void touch_softlockup_watchdog_sync(void) | ||
37 | { | ||
38 | } | ||
39 | static inline void touch_all_softlockup_watchdogs(void) | ||
40 | { | ||
41 | } | ||
42 | #endif | 52 | #endif |
43 | 53 | ||
44 | #ifdef CONFIG_DETECT_HUNG_TASK | 54 | #ifdef CONFIG_DETECT_HUNG_TASK |
45 | void reset_hung_task_detector(void); | 55 | void reset_hung_task_detector(void); |
46 | #else | 56 | #else |
47 | static inline void reset_hung_task_detector(void) | 57 | static inline void reset_hung_task_detector(void) { } |
48 | { | ||
49 | } | ||
50 | #endif | 58 | #endif |
51 | 59 | ||
52 | /* | 60 | /* |
@@ -54,12 +62,12 @@ static inline void reset_hung_task_detector(void) | |||
54 | * 'watchdog_enabled' variable. Each lockup detector has its dedicated bit - | 62 | * 'watchdog_enabled' variable. Each lockup detector has its dedicated bit - |
55 | * bit 0 for the hard lockup detector and bit 1 for the soft lockup detector. | 63 | * bit 0 for the hard lockup detector and bit 1 for the soft lockup detector. |
56 | * | 64 | * |
57 | * 'watchdog_user_enabled', 'nmi_watchdog_enabled' and 'soft_watchdog_enabled' | 65 | * 'watchdog_user_enabled', 'nmi_watchdog_user_enabled' and |
58 | * are variables that are only used as an 'interface' between the parameters | 66 | * 'soft_watchdog_user_enabled' are variables that are only used as an |
59 | * in /proc/sys/kernel and the internal state bits in 'watchdog_enabled'. The | 67 | * 'interface' between the parameters in /proc/sys/kernel and the internal |
60 | * 'watchdog_thresh' variable is handled differently because its value is not | 68 | * state bits in 'watchdog_enabled'. The 'watchdog_thresh' variable is |
61 | * boolean, and the lockup detectors are 'suspended' while 'watchdog_thresh' | 69 | * handled differently because its value is not boolean, and the lockup |
62 | * is equal zero. | 70 | * detectors are 'suspended' while 'watchdog_thresh' is equal zero. |
63 | */ | 71 | */ |
64 | #define NMI_WATCHDOG_ENABLED_BIT 0 | 72 | #define NMI_WATCHDOG_ENABLED_BIT 0 |
65 | #define SOFT_WATCHDOG_ENABLED_BIT 1 | 73 | #define SOFT_WATCHDOG_ENABLED_BIT 1 |
@@ -73,17 +81,41 @@ extern unsigned int hardlockup_panic; | |||
73 | static inline void hardlockup_detector_disable(void) {} | 81 | static inline void hardlockup_detector_disable(void) {} |
74 | #endif | 82 | #endif |
75 | 83 | ||
84 | #if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR) | ||
85 | # define NMI_WATCHDOG_SYSCTL_PERM 0644 | ||
86 | #else | ||
87 | # define NMI_WATCHDOG_SYSCTL_PERM 0444 | ||
88 | #endif | ||
89 | |||
76 | #if defined(CONFIG_HARDLOCKUP_DETECTOR_PERF) | 90 | #if defined(CONFIG_HARDLOCKUP_DETECTOR_PERF) |
77 | extern void arch_touch_nmi_watchdog(void); | 91 | extern void arch_touch_nmi_watchdog(void); |
92 | extern void hardlockup_detector_perf_stop(void); | ||
93 | extern void hardlockup_detector_perf_restart(void); | ||
94 | extern void hardlockup_detector_perf_disable(void); | ||
95 | extern void hardlockup_detector_perf_enable(void); | ||
96 | extern void hardlockup_detector_perf_cleanup(void); | ||
97 | extern int hardlockup_detector_perf_init(void); | ||
78 | #else | 98 | #else |
79 | #if !defined(CONFIG_HAVE_NMI_WATCHDOG) | 99 | static inline void hardlockup_detector_perf_stop(void) { } |
100 | static inline void hardlockup_detector_perf_restart(void) { } | ||
101 | static inline void hardlockup_detector_perf_disable(void) { } | ||
102 | static inline void hardlockup_detector_perf_enable(void) { } | ||
103 | static inline void hardlockup_detector_perf_cleanup(void) { } | ||
104 | # if !defined(CONFIG_HAVE_NMI_WATCHDOG) | ||
105 | static inline int hardlockup_detector_perf_init(void) { return -ENODEV; } | ||
80 | static inline void arch_touch_nmi_watchdog(void) {} | 106 | static inline void arch_touch_nmi_watchdog(void) {} |
107 | # else | ||
108 | static inline int hardlockup_detector_perf_init(void) { return 0; } | ||
109 | # endif | ||
81 | #endif | 110 | #endif |
82 | #endif | 111 | |
112 | void watchdog_nmi_stop(void); | ||
113 | void watchdog_nmi_start(void); | ||
114 | int watchdog_nmi_probe(void); | ||
83 | 115 | ||
84 | /** | 116 | /** |
85 | * touch_nmi_watchdog - restart NMI watchdog timeout. | 117 | * touch_nmi_watchdog - restart NMI watchdog timeout. |
86 | * | 118 | * |
87 | * If the architecture supports the NMI watchdog, touch_nmi_watchdog() | 119 | * If the architecture supports the NMI watchdog, touch_nmi_watchdog() |
88 | * may be used to reset the timeout - for code which intentionally | 120 | * may be used to reset the timeout - for code which intentionally |
89 | * disables interrupts for a long time. This call is stateless. | 121 | * disables interrupts for a long time. This call is stateless. |
@@ -153,22 +185,6 @@ static inline bool trigger_single_cpu_backtrace(int cpu) | |||
153 | u64 hw_nmi_get_sample_period(int watchdog_thresh); | 185 | u64 hw_nmi_get_sample_period(int watchdog_thresh); |
154 | #endif | 186 | #endif |
155 | 187 | ||
156 | #ifdef CONFIG_LOCKUP_DETECTOR | ||
157 | extern int nmi_watchdog_enabled; | ||
158 | extern int watchdog_user_enabled; | ||
159 | extern int watchdog_thresh; | ||
160 | extern unsigned long watchdog_enabled; | ||
161 | extern struct cpumask watchdog_cpumask; | ||
162 | extern unsigned long *watchdog_cpumask_bits; | ||
163 | extern int __read_mostly watchdog_suspended; | ||
164 | #ifdef CONFIG_SMP | ||
165 | extern int sysctl_softlockup_all_cpu_backtrace; | ||
166 | extern int sysctl_hardlockup_all_cpu_backtrace; | ||
167 | #else | ||
168 | #define sysctl_softlockup_all_cpu_backtrace 0 | ||
169 | #define sysctl_hardlockup_all_cpu_backtrace 0 | ||
170 | #endif | ||
171 | |||
172 | #if defined(CONFIG_HARDLOCKUP_CHECK_TIMESTAMP) && \ | 188 | #if defined(CONFIG_HARDLOCKUP_CHECK_TIMESTAMP) && \ |
173 | defined(CONFIG_HARDLOCKUP_DETECTOR) | 189 | defined(CONFIG_HARDLOCKUP_DETECTOR) |
174 | void watchdog_update_hrtimer_threshold(u64 period); | 190 | void watchdog_update_hrtimer_threshold(u64 period); |
@@ -176,7 +192,6 @@ void watchdog_update_hrtimer_threshold(u64 period); | |||
176 | static inline void watchdog_update_hrtimer_threshold(u64 period) { } | 192 | static inline void watchdog_update_hrtimer_threshold(u64 period) { } |
177 | #endif | 193 | #endif |
178 | 194 | ||
179 | extern bool is_hardlockup(void); | ||
180 | struct ctl_table; | 195 | struct ctl_table; |
181 | extern int proc_watchdog(struct ctl_table *, int , | 196 | extern int proc_watchdog(struct ctl_table *, int , |
182 | void __user *, size_t *, loff_t *); | 197 | void __user *, size_t *, loff_t *); |
@@ -188,18 +203,6 @@ extern int proc_watchdog_thresh(struct ctl_table *, int , | |||
188 | void __user *, size_t *, loff_t *); | 203 | void __user *, size_t *, loff_t *); |
189 | extern int proc_watchdog_cpumask(struct ctl_table *, int, | 204 | extern int proc_watchdog_cpumask(struct ctl_table *, int, |
190 | void __user *, size_t *, loff_t *); | 205 | void __user *, size_t *, loff_t *); |
191 | extern int lockup_detector_suspend(void); | ||
192 | extern void lockup_detector_resume(void); | ||
193 | #else | ||
194 | static inline int lockup_detector_suspend(void) | ||
195 | { | ||
196 | return 0; | ||
197 | } | ||
198 | |||
199 | static inline void lockup_detector_resume(void) | ||
200 | { | ||
201 | } | ||
202 | #endif | ||
203 | 206 | ||
204 | #ifdef CONFIG_HAVE_ACPI_APEI_NMI | 207 | #ifdef CONFIG_HAVE_ACPI_APEI_NMI |
205 | #include <asm/nmi.h> | 208 | #include <asm/nmi.h> |