diff options
Diffstat (limited to 'arch/cris/arch-v32')
-rw-r--r-- | arch/cris/arch-v32/drivers/cryptocop.c | 3 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/i2c.c | 2 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/mach-a3/gpio.c | 4 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/mach-fs/gpio.c | 5 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/sync_serial.c | 33 | ||||
-rw-r--r-- | arch/cris/arch-v32/kernel/smp.c | 5 |
6 files changed, 34 insertions, 18 deletions
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c index 9fb58202be99..67c61ea86813 100644 --- a/arch/cris/arch-v32/drivers/cryptocop.c +++ b/arch/cris/arch-v32/drivers/cryptocop.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/string.h> | 11 | #include <linux/string.h> |
12 | #include <linux/fs.h> | 12 | #include <linux/fs.h> |
13 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
14 | #include <linux/smp_lock.h> | ||
14 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
15 | #include <linux/stddef.h> | 16 | #include <linux/stddef.h> |
16 | 17 | ||
@@ -2302,11 +2303,11 @@ static int cryptocop_job_setup(struct cryptocop_prio_job **pj, struct cryptocop_ | |||
2302 | return 0; | 2303 | return 0; |
2303 | } | 2304 | } |
2304 | 2305 | ||
2305 | |||
2306 | static int cryptocop_open(struct inode *inode, struct file *filp) | 2306 | static int cryptocop_open(struct inode *inode, struct file *filp) |
2307 | { | 2307 | { |
2308 | int p = iminor(inode); | 2308 | int p = iminor(inode); |
2309 | 2309 | ||
2310 | cycle_kernel_lock(); | ||
2310 | if (p != CRYPTOCOP_MINOR) return -EINVAL; | 2311 | if (p != CRYPTOCOP_MINOR) return -EINVAL; |
2311 | 2312 | ||
2312 | filp->private_data = NULL; | 2313 | filp->private_data = NULL; |
diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c index c2fb7a5c1396..179e7b804331 100644 --- a/arch/cris/arch-v32/drivers/i2c.c +++ b/arch/cris/arch-v32/drivers/i2c.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/fs.h> | 33 | #include <linux/fs.h> |
34 | #include <linux/string.h> | 34 | #include <linux/string.h> |
35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
36 | #include <linux/smp_lock.h> | ||
36 | 37 | ||
37 | #include <asm/etraxi2c.h> | 38 | #include <asm/etraxi2c.h> |
38 | 39 | ||
@@ -636,6 +637,7 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg) | |||
636 | static int | 637 | static int |
637 | i2c_open(struct inode *inode, struct file *filp) | 638 | i2c_open(struct inode *inode, struct file *filp) |
638 | { | 639 | { |
640 | cycle_kernel_lock(); | ||
639 | return 0; | 641 | return 0; |
640 | } | 642 | } |
641 | 643 | ||
diff --git a/arch/cris/arch-v32/drivers/mach-a3/gpio.c b/arch/cris/arch-v32/drivers/mach-a3/gpio.c index de107dad9f4f..ef98608e5067 100644 --- a/arch/cris/arch-v32/drivers/mach-a3/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-a3/gpio.c | |||
@@ -23,6 +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 | 27 | ||
27 | #include <asm/etraxgpio.h> | 28 | #include <asm/etraxgpio.h> |
28 | #include <hwregs/reg_map.h> | 29 | #include <hwregs/reg_map.h> |
@@ -390,6 +391,8 @@ static int gpio_open(struct inode *inode, struct file *filp) | |||
390 | 391 | ||
391 | if (!priv) | 392 | if (!priv) |
392 | return -ENOMEM; | 393 | return -ENOMEM; |
394 | |||
395 | lock_kernel(); | ||
393 | memset(priv, 0, sizeof(*priv)); | 396 | memset(priv, 0, sizeof(*priv)); |
394 | 397 | ||
395 | priv->minor = p; | 398 | priv->minor = p; |
@@ -412,6 +415,7 @@ static int gpio_open(struct inode *inode, struct file *filp) | |||
412 | spin_unlock_irq(&gpio_lock); | 415 | spin_unlock_irq(&gpio_lock); |
413 | } | 416 | } |
414 | 417 | ||
418 | unlock_kernel(); | ||
415 | return 0; | 419 | return 0; |
416 | } | 420 | } |
417 | 421 | ||
diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c index 7863fd4efc2b..fe1fde893887 100644 --- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c | |||
@@ -22,6 +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 | 26 | ||
26 | #include <asm/etraxgpio.h> | 27 | #include <asm/etraxgpio.h> |
27 | #include <hwregs/reg_map.h> | 28 | #include <hwregs/reg_map.h> |
@@ -426,9 +427,10 @@ gpio_open(struct inode *inode, struct file *filp) | |||
426 | return -EINVAL; | 427 | return -EINVAL; |
427 | 428 | ||
428 | priv = kmalloc(sizeof(struct gpio_private), GFP_KERNEL); | 429 | priv = kmalloc(sizeof(struct gpio_private), GFP_KERNEL); |
429 | |||
430 | if (!priv) | 430 | if (!priv) |
431 | return -ENOMEM; | 431 | return -ENOMEM; |
432 | |||
433 | lock_kernel(); | ||
432 | memset(priv, 0, sizeof(*priv)); | 434 | memset(priv, 0, sizeof(*priv)); |
433 | 435 | ||
434 | priv->minor = p; | 436 | priv->minor = p; |
@@ -449,6 +451,7 @@ gpio_open(struct inode *inode, struct file *filp) | |||
449 | alarmlist = priv; | 451 | alarmlist = priv; |
450 | spin_unlock_irq(&alarm_lock); | 452 | spin_unlock_irq(&alarm_lock); |
451 | 453 | ||
454 | unlock_kernel(); | ||
452 | return 0; | 455 | return 0; |
453 | } | 456 | } |
454 | 457 | ||
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index 47c377df6fb3..d2a0fbf5341f 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/major.h> | 14 | #include <linux/major.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
17 | #include <linux/smp_lock.h> | ||
17 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
18 | #include <linux/poll.h> | 19 | #include <linux/poll.h> |
19 | #include <linux/init.h> | 20 | #include <linux/init.h> |
@@ -429,23 +430,26 @@ static inline int sync_data_avail_to_end(struct sync_port *port) | |||
429 | static int sync_serial_open(struct inode *inode, struct file *file) | 430 | static int sync_serial_open(struct inode *inode, struct file *file) |
430 | { | 431 | { |
431 | int dev = iminor(inode); | 432 | int dev = iminor(inode); |
433 | int ret = -EBUSY; | ||
432 | sync_port *port; | 434 | sync_port *port; |
433 | reg_dma_rw_cfg cfg = {.en = regk_dma_yes}; | 435 | reg_dma_rw_cfg cfg = {.en = regk_dma_yes}; |
434 | reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes}; | 436 | reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes}; |
435 | 437 | ||
438 | lock_kernel(); | ||
436 | DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); | 439 | DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); |
437 | 440 | ||
438 | if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled) | 441 | if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled) |
439 | { | 442 | { |
440 | DEBUG(printk(KERN_DEBUG "Invalid minor %d\n", dev)); | 443 | DEBUG(printk(KERN_DEBUG "Invalid minor %d\n", dev)); |
441 | return -ENODEV; | 444 | ret = -ENODEV; |
445 | goto out; | ||
442 | } | 446 | } |
443 | port = &ports[dev]; | 447 | port = &ports[dev]; |
444 | /* Allow open this device twice (assuming one reader and one writer) */ | 448 | /* Allow open this device twice (assuming one reader and one writer) */ |
445 | if (port->busy == 2) | 449 | if (port->busy == 2) |
446 | { | 450 | { |
447 | DEBUG(printk(KERN_DEBUG "Device is busy.. \n")); | 451 | DEBUG(printk(KERN_DEBUG "Device is busy.. \n")); |
448 | return -EBUSY; | 452 | goto out; |
449 | } | 453 | } |
450 | 454 | ||
451 | 455 | ||
@@ -459,7 +463,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
459 | "synchronous serial 0 dma tr", | 463 | "synchronous serial 0 dma tr", |
460 | &ports[0])) { | 464 | &ports[0])) { |
461 | printk(KERN_CRIT "Can't allocate sync serial port 0 IRQ"); | 465 | printk(KERN_CRIT "Can't allocate sync serial port 0 IRQ"); |
462 | return -EBUSY; | 466 | goto out; |
463 | } else if (request_irq(DMA_IN_INTR_VECT, | 467 | } else if (request_irq(DMA_IN_INTR_VECT, |
464 | rx_interrupt, | 468 | rx_interrupt, |
465 | 0, | 469 | 0, |
@@ -467,7 +471,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
467 | &ports[0])) { | 471 | &ports[0])) { |
468 | free_irq(DMA_OUT_INTR_VECT, &port[0]); | 472 | free_irq(DMA_OUT_INTR_VECT, &port[0]); |
469 | printk(KERN_CRIT "Can't allocate sync serial port 0 IRQ"); | 473 | printk(KERN_CRIT "Can't allocate sync serial port 0 IRQ"); |
470 | return -EBUSY; | 474 | goto out; |
471 | } else if (crisv32_request_dma(OUT_DMA_NBR, | 475 | } else if (crisv32_request_dma(OUT_DMA_NBR, |
472 | "synchronous serial 0 dma tr", | 476 | "synchronous serial 0 dma tr", |
473 | DMA_VERBOSE_ON_ERROR, | 477 | DMA_VERBOSE_ON_ERROR, |
@@ -476,7 +480,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
476 | free_irq(DMA_OUT_INTR_VECT, &port[0]); | 480 | free_irq(DMA_OUT_INTR_VECT, &port[0]); |
477 | free_irq(DMA_IN_INTR_VECT, &port[0]); | 481 | free_irq(DMA_IN_INTR_VECT, &port[0]); |
478 | printk(KERN_CRIT "Can't allocate sync serial port 0 TX DMA channel"); | 482 | printk(KERN_CRIT "Can't allocate sync serial port 0 TX DMA channel"); |
479 | return -EBUSY; | 483 | goto out; |
480 | } else if (crisv32_request_dma(IN_DMA_NBR, | 484 | } else if (crisv32_request_dma(IN_DMA_NBR, |
481 | "synchronous serial 0 dma rec", | 485 | "synchronous serial 0 dma rec", |
482 | DMA_VERBOSE_ON_ERROR, | 486 | DMA_VERBOSE_ON_ERROR, |
@@ -486,7 +490,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
486 | free_irq(DMA_OUT_INTR_VECT, &port[0]); | 490 | free_irq(DMA_OUT_INTR_VECT, &port[0]); |
487 | free_irq(DMA_IN_INTR_VECT, &port[0]); | 491 | free_irq(DMA_IN_INTR_VECT, &port[0]); |
488 | printk(KERN_CRIT "Can't allocate sync serial port 1 RX DMA channel"); | 492 | printk(KERN_CRIT "Can't allocate sync serial port 1 RX DMA channel"); |
489 | return -EBUSY; | 493 | goto out; |
490 | } | 494 | } |
491 | #endif | 495 | #endif |
492 | } | 496 | } |
@@ -499,7 +503,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
499 | "synchronous serial 1 dma tr", | 503 | "synchronous serial 1 dma tr", |
500 | &ports[1])) { | 504 | &ports[1])) { |
501 | printk(KERN_CRIT "Can't allocate sync serial port 1 IRQ"); | 505 | printk(KERN_CRIT "Can't allocate sync serial port 1 IRQ"); |
502 | return -EBUSY; | 506 | goto out; |
503 | } else if (request_irq(DMA7_INTR_VECT, | 507 | } else if (request_irq(DMA7_INTR_VECT, |
504 | rx_interrupt, | 508 | rx_interrupt, |
505 | 0, | 509 | 0, |
@@ -507,7 +511,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
507 | &ports[1])) { | 511 | &ports[1])) { |
508 | free_irq(DMA6_INTR_VECT, &ports[1]); | 512 | free_irq(DMA6_INTR_VECT, &ports[1]); |
509 | printk(KERN_CRIT "Can't allocate sync serial port 3 IRQ"); | 513 | printk(KERN_CRIT "Can't allocate sync serial port 3 IRQ"); |
510 | return -EBUSY; | 514 | goto out; |
511 | } else if (crisv32_request_dma( | 515 | } else if (crisv32_request_dma( |
512 | SYNC_SER1_TX_DMA_NBR, | 516 | SYNC_SER1_TX_DMA_NBR, |
513 | "synchronous serial 1 dma tr", | 517 | "synchronous serial 1 dma tr", |
@@ -517,7 +521,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
517 | free_irq(DMA6_INTR_VECT, &ports[1]); | 521 | free_irq(DMA6_INTR_VECT, &ports[1]); |
518 | free_irq(DMA7_INTR_VECT, &ports[1]); | 522 | free_irq(DMA7_INTR_VECT, &ports[1]); |
519 | printk(KERN_CRIT "Can't allocate sync serial port 3 TX DMA channel"); | 523 | printk(KERN_CRIT "Can't allocate sync serial port 3 TX DMA channel"); |
520 | return -EBUSY; | 524 | goto out; |
521 | } else if (crisv32_request_dma( | 525 | } else if (crisv32_request_dma( |
522 | SYNC_SER1_RX_DMA_NBR, | 526 | SYNC_SER1_RX_DMA_NBR, |
523 | "synchronous serial 3 dma rec", | 527 | "synchronous serial 3 dma rec", |
@@ -528,7 +532,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
528 | free_irq(DMA6_INTR_VECT, &ports[1]); | 532 | free_irq(DMA6_INTR_VECT, &ports[1]); |
529 | free_irq(DMA7_INTR_VECT, &ports[1]); | 533 | free_irq(DMA7_INTR_VECT, &ports[1]); |
530 | printk(KERN_CRIT "Can't allocate sync serial port 3 RX DMA channel"); | 534 | printk(KERN_CRIT "Can't allocate sync serial port 3 RX DMA channel"); |
531 | return -EBUSY; | 535 | goto out; |
532 | } | 536 | } |
533 | #endif | 537 | #endif |
534 | } | 538 | } |
@@ -554,7 +558,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
554 | "synchronous serial manual irq", | 558 | "synchronous serial manual irq", |
555 | &ports[0])) { | 559 | &ports[0])) { |
556 | printk("Can't allocate sync serial manual irq"); | 560 | printk("Can't allocate sync serial manual irq"); |
557 | return -EBUSY; | 561 | goto out; |
558 | } | 562 | } |
559 | } | 563 | } |
560 | #ifdef CONFIG_ETRAXFS | 564 | #ifdef CONFIG_ETRAXFS |
@@ -565,7 +569,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
565 | "synchronous serial manual irq", | 569 | "synchronous serial manual irq", |
566 | &ports[1])) { | 570 | &ports[1])) { |
567 | printk(KERN_CRIT "Can't allocate sync serial manual irq"); | 571 | printk(KERN_CRIT "Can't allocate sync serial manual irq"); |
568 | return -EBUSY; | 572 | goto out; |
569 | } | 573 | } |
570 | } | 574 | } |
571 | #endif | 575 | #endif |
@@ -578,7 +582,10 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
578 | } /* port->init_irqs */ | 582 | } /* port->init_irqs */ |
579 | 583 | ||
580 | port->busy++; | 584 | port->busy++; |
581 | return 0; | 585 | ret = 0; |
586 | out: | ||
587 | unlock_kernel(); | ||
588 | return ret; | ||
582 | } | 589 | } |
583 | 590 | ||
584 | static int sync_serial_release(struct inode *inode, struct file *file) | 591 | static int sync_serial_release(struct inode *inode, struct file *file) |
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c index a9c3334e46c9..952a24b2f5a9 100644 --- a/arch/cris/arch-v32/kernel/smp.c +++ b/arch/cris/arch-v32/kernel/smp.c | |||
@@ -194,7 +194,7 @@ void stop_this_cpu(void* dummy) | |||
194 | /* Other calls */ | 194 | /* Other calls */ |
195 | void smp_send_stop(void) | 195 | void smp_send_stop(void) |
196 | { | 196 | { |
197 | smp_call_function(stop_this_cpu, NULL, 1, 0); | 197 | smp_call_function(stop_this_cpu, NULL, 0); |
198 | } | 198 | } |
199 | 199 | ||
200 | int setup_profiling_timer(unsigned int multiplier) | 200 | int setup_profiling_timer(unsigned int multiplier) |
@@ -316,8 +316,7 @@ int send_ipi(int vector, int wait, cpumask_t cpu_mask) | |||
316 | * You must not call this function with disabled interrupts or from a | 316 | * You must not call this function with disabled interrupts or from a |
317 | * hardware interrupt handler or from a bottom half handler. | 317 | * hardware interrupt handler or from a bottom half handler. |
318 | */ | 318 | */ |
319 | int smp_call_function(void (*func)(void *info), void *info, | 319 | int smp_call_function(void (*func)(void *info), void *info, int wait) |
320 | int nonatomic, int wait) | ||
321 | { | 320 | { |
322 | cpumask_t cpu_mask = CPU_MASK_ALL; | 321 | cpumask_t cpu_mask = CPU_MASK_ALL; |
323 | struct call_data_struct data; | 322 | struct call_data_struct data; |