diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-10-30 04:43:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-10-30 04:43:08 -0400 |
commit | 169ed55bd30305b933f52bfab32a58671d44ab68 (patch) | |
tree | 32e280957474f458901abfce16fa2a1687ef7497 /arch/cris/arch-v32 | |
parent | 3d7851b3cdd43a734e5cc4c643fd886ab28ad4d5 (diff) | |
parent | 45f81b1c96d9793e47ce925d257ea693ce0b193e (diff) |
Merge branch 'tip/perf/jump-label-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent
Diffstat (limited to 'arch/cris/arch-v32')
-rw-r--r-- | arch/cris/arch-v32/drivers/cryptocop.c | 7 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/i2c.c | 1 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/mach-a3/gpio.c | 12 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/mach-fs/gpio.c | 12 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/pcf8563.c | 7 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/sync_serial.c | 14 | ||||
-rw-r--r-- | arch/cris/arch-v32/kernel/ptrace.c | 16 |
7 files changed, 39 insertions, 30 deletions
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c index b07646a30509..c03bc3bc30c2 100644 --- a/arch/cris/arch-v32/drivers/cryptocop.c +++ b/arch/cris/arch-v32/drivers/cryptocop.c | |||
@@ -281,7 +281,8 @@ const struct file_operations cryptocop_fops = { | |||
281 | .owner = THIS_MODULE, | 281 | .owner = THIS_MODULE, |
282 | .open = cryptocop_open, | 282 | .open = cryptocop_open, |
283 | .release = cryptocop_release, | 283 | .release = cryptocop_release, |
284 | .unlocked_ioctl = cryptocop_ioctl | 284 | .unlocked_ioctl = cryptocop_ioctl, |
285 | .llseek = noop_llseek, | ||
285 | }; | 286 | }; |
286 | 287 | ||
287 | 288 | ||
@@ -3139,9 +3140,9 @@ cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
3139 | struct inode *inode = file->f_path.dentry->d_inode; | 3140 | struct inode *inode = file->f_path.dentry->d_inode; |
3140 | long ret; | 3141 | long ret; |
3141 | 3142 | ||
3142 | lock_kernel(); | 3143 | mutex_lock(&cryptocop_mutex); |
3143 | ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg); | 3144 | ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg); |
3144 | unlock_kernel(); | 3145 | mutex_unlock(&cryptocop_mutex); |
3145 | 3146 | ||
3146 | return ret; | 3147 | return ret; |
3147 | } | 3148 | } |
diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c index 5a3e900c9a78..ddb23996f11a 100644 --- a/arch/cris/arch-v32/drivers/i2c.c +++ b/arch/cris/arch-v32/drivers/i2c.c | |||
@@ -698,6 +698,7 @@ static const struct file_operations i2c_fops = { | |||
698 | .unlocked_ioctl = i2c_ioctl, | 698 | .unlocked_ioctl = i2c_ioctl, |
699 | .open = i2c_open, | 699 | .open = i2c_open, |
700 | .release = i2c_release, | 700 | .release = i2c_release, |
701 | .llseek = noop_llseek, | ||
701 | }; | 702 | }; |
702 | 703 | ||
703 | static int __init i2c_init(void) | 704 | static int __init i2c_init(void) |
diff --git a/arch/cris/arch-v32/drivers/mach-a3/gpio.c b/arch/cris/arch-v32/drivers/mach-a3/gpio.c index 2dcd27adbad4..c845831e2225 100644 --- a/arch/cris/arch-v32/drivers/mach-a3/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-a3/gpio.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | #include <linux/spinlock.h> | 25 | #include <linux/spinlock.h> |
26 | #include <linux/smp_lock.h> | 26 | #include <linux/mutex.h> |
27 | 27 | ||
28 | #include <asm/etraxgpio.h> | 28 | #include <asm/etraxgpio.h> |
29 | #include <hwregs/reg_map.h> | 29 | #include <hwregs/reg_map.h> |
@@ -66,6 +66,7 @@ static int dp_cnt; | |||
66 | #define DP(x) | 66 | #define DP(x) |
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | static DEFINE_MUTEX(gpio_mutex); | ||
69 | static char gpio_name[] = "etrax gpio"; | 70 | static char gpio_name[] = "etrax gpio"; |
70 | 71 | ||
71 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO | 72 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO |
@@ -391,7 +392,7 @@ static int gpio_open(struct inode *inode, struct file *filp) | |||
391 | if (!priv) | 392 | if (!priv) |
392 | return -ENOMEM; | 393 | return -ENOMEM; |
393 | 394 | ||
394 | lock_kernel(); | 395 | mutex_lock(&gpio_mutex); |
395 | memset(priv, 0, sizeof(*priv)); | 396 | memset(priv, 0, sizeof(*priv)); |
396 | 397 | ||
397 | priv->minor = p; | 398 | priv->minor = p; |
@@ -414,7 +415,7 @@ static int gpio_open(struct inode *inode, struct file *filp) | |||
414 | spin_unlock_irq(&gpio_lock); | 415 | spin_unlock_irq(&gpio_lock); |
415 | } | 416 | } |
416 | 417 | ||
417 | unlock_kernel(); | 418 | mutex_unlock(&gpio_mutex); |
418 | return 0; | 419 | return 0; |
419 | } | 420 | } |
420 | 421 | ||
@@ -667,9 +668,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
667 | { | 668 | { |
668 | long ret; | 669 | long ret; |
669 | 670 | ||
670 | lock_kernel(); | 671 | mutex_lock(&gpio_mutex); |
671 | ret = gpio_ioctl_unlocked(file, cmd, arg); | 672 | ret = gpio_ioctl_unlocked(file, cmd, arg); |
672 | unlock_kernel(); | 673 | mutex_unlock(&gpio_mutex); |
673 | 674 | ||
674 | return ret; | 675 | return ret; |
675 | } | 676 | } |
@@ -893,6 +894,7 @@ static const struct file_operations gpio_fops = { | |||
893 | .write = gpio_write, | 894 | .write = gpio_write, |
894 | .open = gpio_open, | 895 | .open = gpio_open, |
895 | .release = gpio_release, | 896 | .release = gpio_release, |
897 | .llseek = noop_llseek, | ||
896 | }; | 898 | }; |
897 | 899 | ||
898 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO | 900 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO |
diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c index 5ec8a7d4e7d7..ee90d2659be7 100644 --- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
24 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
25 | #include <linux/smp_lock.h> | 25 | #include <linux/mutex.h> |
26 | 26 | ||
27 | #include <asm/etraxgpio.h> | 27 | #include <asm/etraxgpio.h> |
28 | #include <hwregs/reg_map.h> | 28 | #include <hwregs/reg_map.h> |
@@ -64,6 +64,7 @@ static int dp_cnt; | |||
64 | #define DP(x) | 64 | #define DP(x) |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | static DEFINE_MUTEX(gpio_mutex); | ||
67 | static char gpio_name[] = "etrax gpio"; | 68 | static char gpio_name[] = "etrax gpio"; |
68 | 69 | ||
69 | #if 0 | 70 | #if 0 |
@@ -429,7 +430,7 @@ gpio_open(struct inode *inode, struct file *filp) | |||
429 | if (!priv) | 430 | if (!priv) |
430 | return -ENOMEM; | 431 | return -ENOMEM; |
431 | 432 | ||
432 | lock_kernel(); | 433 | mutex_lock(&gpio_mutex); |
433 | memset(priv, 0, sizeof(*priv)); | 434 | memset(priv, 0, sizeof(*priv)); |
434 | 435 | ||
435 | priv->minor = p; | 436 | priv->minor = p; |
@@ -450,7 +451,7 @@ gpio_open(struct inode *inode, struct file *filp) | |||
450 | alarmlist = priv; | 451 | alarmlist = priv; |
451 | spin_unlock_irq(&alarm_lock); | 452 | spin_unlock_irq(&alarm_lock); |
452 | 453 | ||
453 | unlock_kernel(); | 454 | mutex_unlock(&gpio_mutex); |
454 | return 0; | 455 | return 0; |
455 | } | 456 | } |
456 | 457 | ||
@@ -708,9 +709,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
708 | { | 709 | { |
709 | long ret; | 710 | long ret; |
710 | 711 | ||
711 | lock_kernel(); | 712 | mutex_lock(&gpio_mutex); |
712 | ret = gpio_ioctl_unlocked(file, cmd, arg); | 713 | ret = gpio_ioctl_unlocked(file, cmd, arg); |
713 | unlock_kernel(); | 714 | mutex_unlock(&gpio_mutex); |
714 | 715 | ||
715 | return ret; | 716 | return ret; |
716 | } | 717 | } |
@@ -870,6 +871,7 @@ static const struct file_operations gpio_fops = { | |||
870 | .write = gpio_write, | 871 | .write = gpio_write, |
871 | .open = gpio_open, | 872 | .open = gpio_open, |
872 | .release = gpio_release, | 873 | .release = gpio_release, |
874 | .llseek = noop_llseek, | ||
873 | }; | 875 | }; |
874 | 876 | ||
875 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO | 877 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO |
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c index bef6eb53b153..b6e4fc0aad42 100644 --- a/arch/cris/arch-v32/drivers/pcf8563.c +++ b/arch/cris/arch-v32/drivers/pcf8563.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
26 | #include <linux/ioctl.h> | 26 | #include <linux/ioctl.h> |
27 | #include <linux/smp_lock.h> | ||
28 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
29 | #include <linux/bcd.h> | 28 | #include <linux/bcd.h> |
30 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
@@ -45,6 +44,7 @@ | |||
45 | #define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) | 44 | #define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) |
46 | #define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) | 45 | #define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) |
47 | 46 | ||
47 | static DEFINE_MUTEX(pcf8563_mutex); | ||
48 | static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ | 48 | static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ |
49 | 49 | ||
50 | static const unsigned char days_in_month[] = | 50 | static const unsigned char days_in_month[] = |
@@ -60,6 +60,7 @@ static int voltage_low; | |||
60 | static const struct file_operations pcf8563_fops = { | 60 | static const struct file_operations pcf8563_fops = { |
61 | .owner = THIS_MODULE, | 61 | .owner = THIS_MODULE, |
62 | .unlocked_ioctl = pcf8563_unlocked_ioctl, | 62 | .unlocked_ioctl = pcf8563_unlocked_ioctl, |
63 | .llseek = noop_llseek, | ||
63 | }; | 64 | }; |
64 | 65 | ||
65 | unsigned char | 66 | unsigned char |
@@ -339,9 +340,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned | |||
339 | { | 340 | { |
340 | int ret; | 341 | int ret; |
341 | 342 | ||
342 | lock_kernel(); | 343 | mutex_lock(&pcf8563_mutex); |
343 | return pcf8563_ioctl(filp, cmd, arg); | 344 | return pcf8563_ioctl(filp, cmd, arg); |
344 | unlock_kernel(); | 345 | mutex_unlock(&pcf8563_mutex); |
345 | 346 | ||
346 | return ret; | 347 | return ret; |
347 | } | 348 | } |
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index ca248f3adb80..c8637a9195ea 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | #include <linux/major.h> | 14 | #include <linux/major.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/smp_lock.h> | 16 | #include <linux/mutex.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/poll.h> | 18 | #include <linux/poll.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
@@ -145,6 +145,7 @@ typedef struct sync_port | |||
145 | spinlock_t lock; | 145 | spinlock_t lock; |
146 | } sync_port; | 146 | } sync_port; |
147 | 147 | ||
148 | static DEFINE_MUTEX(sync_serial_mutex); | ||
148 | static int etrax_sync_serial_init(void); | 149 | static int etrax_sync_serial_init(void); |
149 | static void initialize_port(int portnbr); | 150 | static void initialize_port(int portnbr); |
150 | static inline int sync_data_avail(struct sync_port *port); | 151 | static inline int sync_data_avail(struct sync_port *port); |
@@ -247,7 +248,8 @@ static const struct file_operations sync_serial_fops = { | |||
247 | .poll = sync_serial_poll, | 248 | .poll = sync_serial_poll, |
248 | .unlocked_ioctl = sync_serial_ioctl, | 249 | .unlocked_ioctl = sync_serial_ioctl, |
249 | .open = sync_serial_open, | 250 | .open = sync_serial_open, |
250 | .release = sync_serial_release | 251 | .release = sync_serial_release, |
252 | .llseek = noop_llseek, | ||
251 | }; | 253 | }; |
252 | 254 | ||
253 | static int __init etrax_sync_serial_init(void) | 255 | static int __init etrax_sync_serial_init(void) |
@@ -434,7 +436,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
434 | reg_dma_rw_cfg cfg = {.en = regk_dma_yes}; | 436 | reg_dma_rw_cfg cfg = {.en = regk_dma_yes}; |
435 | reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes}; | 437 | reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes}; |
436 | 438 | ||
437 | lock_kernel(); | 439 | mutex_lock(&sync_serial_mutex); |
438 | DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); | 440 | DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); |
439 | 441 | ||
440 | if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled) | 442 | if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled) |
@@ -583,7 +585,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
583 | port->busy++; | 585 | port->busy++; |
584 | ret = 0; | 586 | ret = 0; |
585 | out: | 587 | out: |
586 | unlock_kernel(); | 588 | mutex_unlock(&sync_serial_mutex); |
587 | return ret; | 589 | return ret; |
588 | } | 590 | } |
589 | 591 | ||
@@ -966,9 +968,9 @@ static long sync_serial_ioctl(struct file *file, | |||
966 | { | 968 | { |
967 | long ret; | 969 | long ret; |
968 | 970 | ||
969 | lock_kernel(); | 971 | mutex_lock(&sync_serial_mutex); |
970 | ret = sync_serial_ioctl_unlocked(file, cmd, arg); | 972 | ret = sync_serial_ioctl_unlocked(file, cmd, arg); |
971 | unlock_kernel(); | 973 | mutex_unlock(&sync_serial_mutex); |
972 | 974 | ||
973 | return ret; | 975 | return ret; |
974 | } | 976 | } |
diff --git a/arch/cris/arch-v32/kernel/ptrace.c b/arch/cris/arch-v32/kernel/ptrace.c index f4ebd1e7d0f5..511ece94a574 100644 --- a/arch/cris/arch-v32/kernel/ptrace.c +++ b/arch/cris/arch-v32/kernel/ptrace.c | |||
@@ -126,9 +126,11 @@ ptrace_disable(struct task_struct *child) | |||
126 | } | 126 | } |
127 | 127 | ||
128 | 128 | ||
129 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 129 | long arch_ptrace(struct task_struct *child, long request, |
130 | unsigned long addr, unsigned long data) | ||
130 | { | 131 | { |
131 | int ret; | 132 | int ret; |
133 | unsigned int regno = addr >> 2; | ||
132 | unsigned long __user *datap = (unsigned long __user *)data; | 134 | unsigned long __user *datap = (unsigned long __user *)data; |
133 | 135 | ||
134 | switch (request) { | 136 | switch (request) { |
@@ -163,10 +165,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
163 | unsigned long tmp; | 165 | unsigned long tmp; |
164 | 166 | ||
165 | ret = -EIO; | 167 | ret = -EIO; |
166 | if ((addr & 3) || addr < 0 || addr > PT_MAX << 2) | 168 | if ((addr & 3) || regno > PT_MAX) |
167 | break; | 169 | break; |
168 | 170 | ||
169 | tmp = get_reg(child, addr >> 2); | 171 | tmp = get_reg(child, regno); |
170 | ret = put_user(tmp, datap); | 172 | ret = put_user(tmp, datap); |
171 | break; | 173 | break; |
172 | } | 174 | } |
@@ -180,19 +182,17 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
180 | /* Write the word at location address in the USER area. */ | 182 | /* Write the word at location address in the USER area. */ |
181 | case PTRACE_POKEUSR: | 183 | case PTRACE_POKEUSR: |
182 | ret = -EIO; | 184 | ret = -EIO; |
183 | if ((addr & 3) || addr < 0 || addr > PT_MAX << 2) | 185 | if ((addr & 3) || regno > PT_MAX) |
184 | break; | 186 | break; |
185 | 187 | ||
186 | addr >>= 2; | 188 | if (regno == PT_CCS) { |
187 | |||
188 | if (addr == PT_CCS) { | ||
189 | /* don't allow the tracing process to change stuff like | 189 | /* don't allow the tracing process to change stuff like |
190 | * interrupt enable, kernel/user bit, dma enables etc. | 190 | * interrupt enable, kernel/user bit, dma enables etc. |
191 | */ | 191 | */ |
192 | data &= CCS_MASK; | 192 | data &= CCS_MASK; |
193 | data |= get_reg(child, PT_CCS) & ~CCS_MASK; | 193 | data |= get_reg(child, PT_CCS) & ~CCS_MASK; |
194 | } | 194 | } |
195 | if (put_reg(child, addr, data)) | 195 | if (put_reg(child, regno, data)) |
196 | break; | 196 | break; |
197 | ret = 0; | 197 | ret = 0; |
198 | break; | 198 | break; |