diff options
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_ctl.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_ctl.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c index b774973f0765..31cf126ed440 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c +++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include <linux/types.h> | 51 | #include <linux/types.h> |
52 | #include <linux/pci.h> | 52 | #include <linux/pci.h> |
53 | #include <linux/delay.h> | 53 | #include <linux/delay.h> |
54 | #include <linux/smp_lock.h> | 54 | #include <linux/mutex.h> |
55 | #include <linux/compat.h> | 55 | #include <linux/compat.h> |
56 | #include <linux/poll.h> | 56 | #include <linux/poll.h> |
57 | 57 | ||
@@ -61,6 +61,7 @@ | |||
61 | #include "mpt2sas_base.h" | 61 | #include "mpt2sas_base.h" |
62 | #include "mpt2sas_ctl.h" | 62 | #include "mpt2sas_ctl.h" |
63 | 63 | ||
64 | static DEFINE_MUTEX(_ctl_mutex); | ||
64 | static struct fasync_struct *async_queue; | 65 | static struct fasync_struct *async_queue; |
65 | static DECLARE_WAIT_QUEUE_HEAD(ctl_poll_wait); | 66 | static DECLARE_WAIT_QUEUE_HEAD(ctl_poll_wait); |
66 | 67 | ||
@@ -2238,9 +2239,9 @@ _ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
2238 | { | 2239 | { |
2239 | long ret; | 2240 | long ret; |
2240 | 2241 | ||
2241 | lock_kernel(); | 2242 | mutex_lock(&_ctl_mutex); |
2242 | ret = _ctl_ioctl_main(file, cmd, (void __user *)arg); | 2243 | ret = _ctl_ioctl_main(file, cmd, (void __user *)arg); |
2243 | unlock_kernel(); | 2244 | mutex_unlock(&_ctl_mutex); |
2244 | return ret; | 2245 | return ret; |
2245 | } | 2246 | } |
2246 | 2247 | ||
@@ -2309,12 +2310,12 @@ _ctl_ioctl_compat(struct file *file, unsigned cmd, unsigned long arg) | |||
2309 | { | 2310 | { |
2310 | long ret; | 2311 | long ret; |
2311 | 2312 | ||
2312 | lock_kernel(); | 2313 | mutex_lock(&_ctl_mutex); |
2313 | if (cmd == MPT2COMMAND32) | 2314 | if (cmd == MPT2COMMAND32) |
2314 | ret = _ctl_compat_mpt_command(file, cmd, arg); | 2315 | ret = _ctl_compat_mpt_command(file, cmd, arg); |
2315 | else | 2316 | else |
2316 | ret = _ctl_ioctl_main(file, cmd, (void __user *)arg); | 2317 | ret = _ctl_ioctl_main(file, cmd, (void __user *)arg); |
2317 | unlock_kernel(); | 2318 | mutex_unlock(&_ctl_mutex); |
2318 | return ret; | 2319 | return ret; |
2319 | } | 2320 | } |
2320 | #endif | 2321 | #endif |