diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig.debug | 38 | ||||
-rw-r--r-- | lib/debug_locks.c | 2 | ||||
-rw-r--r-- | lib/kobject.c | 3 | ||||
-rw-r--r-- | lib/kobject_uevent.c | 4 | ||||
-rw-r--r-- | lib/swiotlb.c | 2 | ||||
-rw-r--r-- | lib/vsprintf.c | 16 |
6 files changed, 45 insertions, 20 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 9638d99644af..c6e854f215fa 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -186,6 +186,44 @@ config BOOTPARAM_SOFTLOCKUP_PANIC_VALUE | |||
186 | default 0 if !BOOTPARAM_SOFTLOCKUP_PANIC | 186 | default 0 if !BOOTPARAM_SOFTLOCKUP_PANIC |
187 | default 1 if BOOTPARAM_SOFTLOCKUP_PANIC | 187 | default 1 if BOOTPARAM_SOFTLOCKUP_PANIC |
188 | 188 | ||
189 | config DETECT_HUNG_TASK | ||
190 | bool "Detect Hung Tasks" | ||
191 | depends on DEBUG_KERNEL | ||
192 | default DETECT_SOFTLOCKUP | ||
193 | help | ||
194 | Say Y here to enable the kernel to detect "hung tasks", | ||
195 | which are bugs that cause the task to be stuck in | ||
196 | uninterruptible "D" state indefinitiley. | ||
197 | |||
198 | When a hung task is detected, the kernel will print the | ||
199 | current stack trace (which you should report), but the | ||
200 | task will stay in uninterruptible state. If lockdep is | ||
201 | enabled then all held locks will also be reported. This | ||
202 | feature has negligible overhead. | ||
203 | |||
204 | config BOOTPARAM_HUNG_TASK_PANIC | ||
205 | bool "Panic (Reboot) On Hung Tasks" | ||
206 | depends on DETECT_HUNG_TASK | ||
207 | help | ||
208 | Say Y here to enable the kernel to panic on "hung tasks", | ||
209 | which are bugs that cause the kernel to leave a task stuck | ||
210 | in uninterruptible "D" state. | ||
211 | |||
212 | The panic can be used in combination with panic_timeout, | ||
213 | to cause the system to reboot automatically after a | ||
214 | hung task has been detected. This feature is useful for | ||
215 | high-availability systems that have uptime guarantees and | ||
216 | where a hung tasks must be resolved ASAP. | ||
217 | |||
218 | Say N if unsure. | ||
219 | |||
220 | config BOOTPARAM_HUNG_TASK_PANIC_VALUE | ||
221 | int | ||
222 | depends on DETECT_HUNG_TASK | ||
223 | range 0 1 | ||
224 | default 0 if !BOOTPARAM_HUNG_TASK_PANIC | ||
225 | default 1 if BOOTPARAM_HUNG_TASK_PANIC | ||
226 | |||
189 | config SCHED_DEBUG | 227 | config SCHED_DEBUG |
190 | bool "Collect scheduler debugging info" | 228 | bool "Collect scheduler debugging info" |
191 | depends on DEBUG_KERNEL && PROC_FS | 229 | depends on DEBUG_KERNEL && PROC_FS |
diff --git a/lib/debug_locks.c b/lib/debug_locks.c index 0218b4693dd8..bc3b11731b9c 100644 --- a/lib/debug_locks.c +++ b/lib/debug_locks.c | |||
@@ -36,7 +36,7 @@ int debug_locks_silent; | |||
36 | */ | 36 | */ |
37 | int debug_locks_off(void) | 37 | int debug_locks_off(void) |
38 | { | 38 | { |
39 | if (xchg(&debug_locks, 0)) { | 39 | if (__debug_locks_off()) { |
40 | if (!debug_locks_silent) { | 40 | if (!debug_locks_silent) { |
41 | oops_in_progress = 1; | 41 | oops_in_progress = 1; |
42 | console_verbose(); | 42 | console_verbose(); |
diff --git a/lib/kobject.c b/lib/kobject.c index a6dec32f2ddd..bacf6fe4f7a0 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
@@ -218,6 +218,9 @@ int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, | |||
218 | const char *old_name = kobj->name; | 218 | const char *old_name = kobj->name; |
219 | char *s; | 219 | char *s; |
220 | 220 | ||
221 | if (kobj->name && !fmt) | ||
222 | return 0; | ||
223 | |||
221 | kobj->name = kvasprintf(GFP_KERNEL, fmt, vargs); | 224 | kobj->name = kvasprintf(GFP_KERNEL, fmt, vargs); |
222 | if (!kobj->name) | 225 | if (!kobj->name) |
223 | return -ENOMEM; | 226 | return -ENOMEM; |
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 97a777ad4f59..920a3ca6e259 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c | |||
@@ -258,7 +258,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, | |||
258 | goto exit; | 258 | goto exit; |
259 | 259 | ||
260 | retval = call_usermodehelper(argv[0], argv, | 260 | retval = call_usermodehelper(argv[0], argv, |
261 | env->envp, UMH_NO_WAIT); | 261 | env->envp, UMH_WAIT_EXEC); |
262 | } | 262 | } |
263 | 263 | ||
264 | exit: | 264 | exit: |
@@ -328,7 +328,7 @@ static int __init kobject_uevent_init(void) | |||
328 | "kobject_uevent: unable to create netlink socket!\n"); | 328 | "kobject_uevent: unable to create netlink socket!\n"); |
329 | return -ENODEV; | 329 | return -ENODEV; |
330 | } | 330 | } |
331 | 331 | netlink_set_nonroot(NETLINK_KOBJECT_UEVENT, NL_NONROOT_RECV); | |
332 | return 0; | 332 | return 0; |
333 | } | 333 | } |
334 | 334 | ||
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 32e2bd3b1142..2b0b5a7d2ced 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
@@ -549,7 +549,7 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size, | |||
549 | dma_addr_t dev_addr; | 549 | dma_addr_t dev_addr; |
550 | void *ret; | 550 | void *ret; |
551 | int order = get_order(size); | 551 | int order = get_order(size); |
552 | u64 dma_mask = DMA_32BIT_MASK; | 552 | u64 dma_mask = DMA_BIT_MASK(32); |
553 | 553 | ||
554 | if (hwdev && hwdev->coherent_dma_mask) | 554 | if (hwdev && hwdev->coherent_dma_mask) |
555 | dma_mask = hwdev->coherent_dma_mask; | 555 | dma_mask = hwdev->coherent_dma_mask; |
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index be3001f912e4..7536acea135b 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -1051,13 +1051,6 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | |||
1051 | if (str < end) | 1051 | if (str < end) |
1052 | *str = '%'; | 1052 | *str = '%'; |
1053 | ++str; | 1053 | ++str; |
1054 | if (*fmt) { | ||
1055 | if (str < end) | ||
1056 | *str = *fmt; | ||
1057 | ++str; | ||
1058 | } else { | ||
1059 | --fmt; | ||
1060 | } | ||
1061 | break; | 1054 | break; |
1062 | 1055 | ||
1063 | case FORMAT_TYPE_NRCHARS: { | 1056 | case FORMAT_TYPE_NRCHARS: { |
@@ -1339,8 +1332,6 @@ do { \ | |||
1339 | break; | 1332 | break; |
1340 | 1333 | ||
1341 | case FORMAT_TYPE_INVALID: | 1334 | case FORMAT_TYPE_INVALID: |
1342 | if (!*fmt) | ||
1343 | --fmt; | ||
1344 | break; | 1335 | break; |
1345 | 1336 | ||
1346 | case FORMAT_TYPE_NRCHARS: { | 1337 | case FORMAT_TYPE_NRCHARS: { |
@@ -1523,13 +1514,6 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf) | |||
1523 | if (str < end) | 1514 | if (str < end) |
1524 | *str = '%'; | 1515 | *str = '%'; |
1525 | ++str; | 1516 | ++str; |
1526 | if (*fmt) { | ||
1527 | if (str < end) | ||
1528 | *str = *fmt; | ||
1529 | ++str; | ||
1530 | } else { | ||
1531 | --fmt; | ||
1532 | } | ||
1533 | break; | 1517 | break; |
1534 | 1518 | ||
1535 | case FORMAT_TYPE_NRCHARS: | 1519 | case FORMAT_TYPE_NRCHARS: |