Commit d9a4a1d0 authored by Jon Masters's avatar Jon Masters Committed by Thomas Gleixner

hwlat: Fix Kconfig and check kthread_stop result

Signed-off-by: default avatarJon Masters <jcm@jonmasters.org>
Signed-off-by: default avatarJohn Kacur <jkacur@redhat.com>
Cc: Jon Masters <jcm@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 55443288
...@@ -79,7 +79,7 @@ config IBM_ASM ...@@ -79,7 +79,7 @@ config IBM_ASM
config HWLAT_DETECTOR config HWLAT_DETECTOR
tristate "Testing module to detect hardware-induced latencies" tristate "Testing module to detect hardware-induced latencies"
depends on DEBUG_FS depends on DEBUG_FS
select RING_BUFFER depends on RING_BUFFER
default m default m
---help--- ---help---
A simple hardware latency detector. Use this module to detect A simple hardware latency detector. Use this module to detect
......
...@@ -607,7 +607,11 @@ static ssize_t debug_enable_fwrite(struct file *filp, ...@@ -607,7 +607,11 @@ static ssize_t debug_enable_fwrite(struct file *filp,
if (!enabled) if (!enabled)
goto unlock; goto unlock;
enabled = 0; enabled = 0;
stop_kthread(); err = stop_kthread();
if (err) {
printk(KERN_ERR BANNER "cannot stop kthread\n");
return -EFAULT;
}
wake_up(&data.wq); /* reader(s) should return */ wake_up(&data.wq); /* reader(s) should return */
} }
unlock: unlock:
...@@ -1194,9 +1198,13 @@ out: ...@@ -1194,9 +1198,13 @@ out:
*/ */
static void detector_exit(void) static void detector_exit(void)
{ {
int err;
if (enabled) { if (enabled) {
enabled = 0; enabled = 0;
stop_kthread(); err = stop_kthread();
if (err)
printk(KERN_ERR BANNER "cannot stop kthread\n");
} }
free_debugfs(); free_debugfs();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment