diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-09 20:31:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-09 20:31:38 -0500 |
commit | 80c0531514516e43ae118ddf38424e06e5c3cb3c (patch) | |
tree | 2eef8cf8fdf505b18f83078d1eb41167e98f5b54 /drivers/char | |
parent | a457aa6c2bdd743bbbffd3f9e4fdbd8c71f8af1b (diff) | |
parent | 11b751ae8c8ca3fa24c85bd5a3e51dd9f95cda17 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/mingo/mutex-2.6
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/mem.c | 4 | ||||
-rw-r--r-- | drivers/char/sysrq.c | 19 | ||||
-rw-r--r-- | drivers/char/watchdog/cpu5wdt.c | 9 |
3 files changed, 26 insertions, 6 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 5b2d18035073..704c3c07f0ab 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -741,7 +741,7 @@ static loff_t memory_lseek(struct file * file, loff_t offset, int orig) | |||
741 | { | 741 | { |
742 | loff_t ret; | 742 | loff_t ret; |
743 | 743 | ||
744 | down(&file->f_dentry->d_inode->i_sem); | 744 | mutex_lock(&file->f_dentry->d_inode->i_mutex); |
745 | switch (orig) { | 745 | switch (orig) { |
746 | case 0: | 746 | case 0: |
747 | file->f_pos = offset; | 747 | file->f_pos = offset; |
@@ -756,7 +756,7 @@ static loff_t memory_lseek(struct file * file, loff_t offset, int orig) | |||
756 | default: | 756 | default: |
757 | ret = -EINVAL; | 757 | ret = -EINVAL; |
758 | } | 758 | } |
759 | up(&file->f_dentry->d_inode->i_sem); | 759 | mutex_unlock(&file->f_dentry->d_inode->i_mutex); |
760 | return ret; | 760 | return ret; |
761 | } | 761 | } |
762 | 762 | ||
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 145275ebdd7e..5765f672e853 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -153,6 +153,21 @@ static struct sysrq_key_op sysrq_mountro_op = { | |||
153 | 153 | ||
154 | /* END SYNC SYSRQ HANDLERS BLOCK */ | 154 | /* END SYNC SYSRQ HANDLERS BLOCK */ |
155 | 155 | ||
156 | #ifdef CONFIG_DEBUG_MUTEXES | ||
157 | |||
158 | static void | ||
159 | sysrq_handle_showlocks(int key, struct pt_regs *pt_regs, struct tty_struct *tty) | ||
160 | { | ||
161 | mutex_debug_show_all_locks(); | ||
162 | } | ||
163 | |||
164 | static struct sysrq_key_op sysrq_showlocks_op = { | ||
165 | .handler = sysrq_handle_showlocks, | ||
166 | .help_msg = "show-all-locks(D)", | ||
167 | .action_msg = "Show Locks Held", | ||
168 | }; | ||
169 | |||
170 | #endif | ||
156 | 171 | ||
157 | /* SHOW SYSRQ HANDLERS BLOCK */ | 172 | /* SHOW SYSRQ HANDLERS BLOCK */ |
158 | 173 | ||
@@ -294,7 +309,11 @@ static struct sysrq_key_op *sysrq_key_table[SYSRQ_KEY_TABLE_LENGTH] = { | |||
294 | #else | 309 | #else |
295 | /* c */ NULL, | 310 | /* c */ NULL, |
296 | #endif | 311 | #endif |
312 | #ifdef CONFIG_DEBUG_MUTEXES | ||
313 | /* d */ &sysrq_showlocks_op, | ||
314 | #else | ||
297 | /* d */ NULL, | 315 | /* d */ NULL, |
316 | #endif | ||
298 | /* e */ &sysrq_term_op, | 317 | /* e */ &sysrq_term_op, |
299 | /* f */ &sysrq_moom_op, | 318 | /* f */ &sysrq_moom_op, |
300 | /* g */ NULL, | 319 | /* g */ NULL, |
diff --git a/drivers/char/watchdog/cpu5wdt.c b/drivers/char/watchdog/cpu5wdt.c index e75045fe2641..3e8410b5a65e 100644 --- a/drivers/char/watchdog/cpu5wdt.c +++ b/drivers/char/watchdog/cpu5wdt.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/ioport.h> | 29 | #include <linux/ioport.h> |
30 | #include <linux/timer.h> | 30 | #include <linux/timer.h> |
31 | #include <linux/completion.h> | ||
31 | #include <linux/jiffies.h> | 32 | #include <linux/jiffies.h> |
32 | #include <asm/io.h> | 33 | #include <asm/io.h> |
33 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
@@ -57,7 +58,7 @@ static int ticks = 10000; | |||
57 | /* some device data */ | 58 | /* some device data */ |
58 | 59 | ||
59 | static struct { | 60 | static struct { |
60 | struct semaphore stop; | 61 | struct completion stop; |
61 | volatile int running; | 62 | volatile int running; |
62 | struct timer_list timer; | 63 | struct timer_list timer; |
63 | volatile int queue; | 64 | volatile int queue; |
@@ -85,7 +86,7 @@ static void cpu5wdt_trigger(unsigned long unused) | |||
85 | } | 86 | } |
86 | else { | 87 | else { |
87 | /* ticks doesn't matter anyway */ | 88 | /* ticks doesn't matter anyway */ |
88 | up(&cpu5wdt_device.stop); | 89 | complete(&cpu5wdt_device.stop); |
89 | } | 90 | } |
90 | 91 | ||
91 | } | 92 | } |
@@ -239,7 +240,7 @@ static int __devinit cpu5wdt_init(void) | |||
239 | if ( !val ) | 240 | if ( !val ) |
240 | printk(KERN_INFO PFX "sorry, was my fault\n"); | 241 | printk(KERN_INFO PFX "sorry, was my fault\n"); |
241 | 242 | ||
242 | init_MUTEX_LOCKED(&cpu5wdt_device.stop); | 243 | init_completion(&cpu5wdt_device.stop); |
243 | cpu5wdt_device.queue = 0; | 244 | cpu5wdt_device.queue = 0; |
244 | 245 | ||
245 | clear_bit(0, &cpu5wdt_device.inuse); | 246 | clear_bit(0, &cpu5wdt_device.inuse); |
@@ -269,7 +270,7 @@ static void __devexit cpu5wdt_exit(void) | |||
269 | { | 270 | { |
270 | if ( cpu5wdt_device.queue ) { | 271 | if ( cpu5wdt_device.queue ) { |
271 | cpu5wdt_device.queue = 0; | 272 | cpu5wdt_device.queue = 0; |
272 | down(&cpu5wdt_device.stop); | 273 | wait_for_completion(&cpu5wdt_device.stop); |
273 | } | 274 | } |
274 | 275 | ||
275 | misc_deregister(&cpu5wdt_misc); | 276 | misc_deregister(&cpu5wdt_misc); |