aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/basler/excite/excite_iodev.c9
-rw-r--r--arch/mips/kernel/rtlx.c7
-rw-r--r--arch/mips/kernel/vpe.c12
-rw-r--r--arch/mips/sibyte/common/sb_tbprof.c25
4 files changed, 41 insertions, 12 deletions
diff --git a/arch/mips/basler/excite/excite_iodev.c b/arch/mips/basler/excite/excite_iodev.c
index 476d20e08d0e..a1e3526b4a94 100644
--- a/arch/mips/basler/excite/excite_iodev.c
+++ b/arch/mips/basler/excite/excite_iodev.c
@@ -26,6 +26,7 @@
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/miscdevice.h> 28#include <linux/miscdevice.h>
29#include <linux/smp_lock.h>
29 30
30#include "excite_iodev.h" 31#include "excite_iodev.h"
31 32
@@ -110,8 +111,14 @@ static int __exit iodev_remove(struct device *dev)
110 111
111static int iodev_open(struct inode *i, struct file *f) 112static int iodev_open(struct inode *i, struct file *f)
112{ 113{
113 return request_irq(iodev_irq, iodev_irqhdl, IRQF_DISABLED, 114 int ret;
115
116 lock_kernel();
117 ret = request_irq(iodev_irq, iodev_irqhdl, IRQF_DISABLED,
114 iodev_name, &miscdev); 118 iodev_name, &miscdev);
119 unlock_kernel();
120
121 return ret;
115} 122}
116 123
117static int iodev_release(struct inode *i, struct file *f) 124static int iodev_release(struct inode *i, struct file *f)
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index b88f1c18ff4d..b55641961232 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -28,6 +28,7 @@
28#include <linux/vmalloc.h> 28#include <linux/vmalloc.h>
29#include <linux/elf.h> 29#include <linux/elf.h>
30#include <linux/seq_file.h> 30#include <linux/seq_file.h>
31#include <linux/smp_lock.h>
31#include <linux/syscalls.h> 32#include <linux/syscalls.h>
32#include <linux/moduleloader.h> 33#include <linux/moduleloader.h>
33#include <linux/interrupt.h> 34#include <linux/interrupt.h>
@@ -392,8 +393,12 @@ out:
392static int file_open(struct inode *inode, struct file *filp) 393static int file_open(struct inode *inode, struct file *filp)
393{ 394{
394 int minor = iminor(inode); 395 int minor = iminor(inode);
396 int err;
395 397
396 return rtlx_open(minor, (filp->f_flags & O_NONBLOCK) ? 0 : 1); 398 lock_kernel();
399 err = rtlx_open(minor, (filp->f_flags & O_NONBLOCK) ? 0 : 1);
400 unlock_kernel();
401 return err;
397} 402}
398 403
399static int file_release(struct inode *inode, struct file *filp) 404static int file_release(struct inode *inode, struct file *filp)
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 2794501ff302..972b2d2b8401 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -38,6 +38,7 @@
38#include <linux/vmalloc.h> 38#include <linux/vmalloc.h>
39#include <linux/elf.h> 39#include <linux/elf.h>
40#include <linux/seq_file.h> 40#include <linux/seq_file.h>
41#include <linux/smp_lock.h>
41#include <linux/syscalls.h> 42#include <linux/syscalls.h>
42#include <linux/moduleloader.h> 43#include <linux/moduleloader.h>
43#include <linux/interrupt.h> 44#include <linux/interrupt.h>
@@ -1050,17 +1051,20 @@ static int vpe_open(struct inode *inode, struct file *filp)
1050 enum vpe_state state; 1051 enum vpe_state state;
1051 struct vpe_notifications *not; 1052 struct vpe_notifications *not;
1052 struct vpe *v; 1053 struct vpe *v;
1053 int ret; 1054 int ret, err = 0;
1054 1055
1056 lock_kernel();
1055 if (minor != iminor(inode)) { 1057 if (minor != iminor(inode)) {
1056 /* assume only 1 device at the moment. */ 1058 /* assume only 1 device at the moment. */
1057 printk(KERN_WARNING "VPE loader: only vpe1 is supported\n"); 1059 printk(KERN_WARNING "VPE loader: only vpe1 is supported\n");
1058 return -ENODEV; 1060 err = -ENODEV;
1061 goto out;
1059 } 1062 }
1060 1063
1061 if ((v = get_vpe(tclimit)) == NULL) { 1064 if ((v = get_vpe(tclimit)) == NULL) {
1062 printk(KERN_WARNING "VPE loader: unable to get vpe\n"); 1065 printk(KERN_WARNING "VPE loader: unable to get vpe\n");
1063 return -ENODEV; 1066 err = -ENODEV;
1067 goto out;
1064 } 1068 }
1065 1069
1066 state = xchg(&v->state, VPE_STATE_INUSE); 1070 state = xchg(&v->state, VPE_STATE_INUSE);
@@ -1100,6 +1104,8 @@ static int vpe_open(struct inode *inode, struct file *filp)
1100 v->shared_ptr = NULL; 1104 v->shared_ptr = NULL;
1101 v->__start = 0; 1105 v->__start = 0;
1102 1106
1107out:
1108 unlock_kernel();
1103 return 0; 1109 return 0;
1104} 1110}
1105 1111
diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c
index 63b444eaf01e..28b012ab8dcb 100644
--- a/arch/mips/sibyte/common/sb_tbprof.c
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -28,6 +28,7 @@
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/smp_lock.h>
31#include <linux/vmalloc.h> 32#include <linux/vmalloc.h>
32#include <linux/fs.h> 33#include <linux/fs.h>
33#include <linux/errno.h> 34#include <linux/errno.h>
@@ -402,18 +403,26 @@ static int sbprof_zbprof_stop(void)
402static int sbprof_tb_open(struct inode *inode, struct file *filp) 403static int sbprof_tb_open(struct inode *inode, struct file *filp)
403{ 404{
404 int minor; 405 int minor;
406 int err = 0;
405 407
408 lock_kernel();
406 minor = iminor(inode); 409 minor = iminor(inode);
407 if (minor != 0) 410 if (minor != 0) {
408 return -ENODEV; 411 err = -ENODEV;
412 goto out;
413 }
409 414
410 if (xchg(&sbp.open, SB_OPENING) != SB_CLOSED) 415 if (xchg(&sbp.open, SB_OPENING) != SB_CLOSED) {
411 return -EBUSY; 416 err = -EBUSY;
417 goto out;
418 }
412 419
413 memset(&sbp, 0, sizeof(struct sbprof_tb)); 420 memset(&sbp, 0, sizeof(struct sbprof_tb));
414 sbp.sbprof_tbbuf = vmalloc(MAX_TBSAMPLE_BYTES); 421 sbp.sbprof_tbbuf = vmalloc(MAX_TBSAMPLE_BYTES);
415 if (!sbp.sbprof_tbbuf) 422 if (!sbp.sbprof_tbbuf) {
416 return -ENOMEM; 423 err = -ENOMEM;
424 goto out;
425 }
417 memset(sbp.sbprof_tbbuf, 0, MAX_TBSAMPLE_BYTES); 426 memset(sbp.sbprof_tbbuf, 0, MAX_TBSAMPLE_BYTES);
418 init_waitqueue_head(&sbp.tb_sync); 427 init_waitqueue_head(&sbp.tb_sync);
419 init_waitqueue_head(&sbp.tb_read); 428 init_waitqueue_head(&sbp.tb_read);
@@ -421,7 +430,9 @@ static int sbprof_tb_open(struct inode *inode, struct file *filp)
421 430
422 sbp.open = SB_OPEN; 431 sbp.open = SB_OPEN;
423 432
424 return 0; 433 out:
434 unlock_kernel();
435 return err;
425} 436}
426 437
427static int sbprof_tb_release(struct inode *inode, struct file *filp) 438static int sbprof_tb_release(struct inode *inode, struct file *filp)