diff options
author | Pat Gefre <pfg@sgi.com> | 2007-03-07 23:41:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-08 10:39:15 -0500 |
commit | f70c81d4ddb0d300abc252cb594198d3c797a5e1 (patch) | |
tree | 925163edba9bf56eb0875de46405632e8caea671 | |
parent | 44f5c4ced6ddee2f5f2e45fa45b93370245d85bd (diff) |
[PATCH] 2.6 Altix: console fix for CONFIG_DEBUG_SHIRQ usage
The sn console driver was snagged by the use of CONFIG_DEBUG_SHIRQ!
The request_irq() immediate call to the interrupt handler caused
another attempt to lock the port lock - deadlock.
This is a patch to fix that.
Signed-off-by: Patrick Gefre <pfg@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/serial/sn_console.c | 52 |
1 files changed, 17 insertions, 35 deletions
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index 253ceb895ca7..a27e9e92cb5e 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c | |||
@@ -636,25 +636,6 @@ static irqreturn_t sn_sal_interrupt(int irq, void *dev_id) | |||
636 | } | 636 | } |
637 | 637 | ||
638 | /** | 638 | /** |
639 | * sn_sal_connect_interrupt - Request interrupt, handled by sn_sal_interrupt | ||
640 | * @port: Our sn_cons_port (which contains the uart port) | ||
641 | * | ||
642 | * returns the console irq if interrupt is successfully registered, else 0 | ||
643 | * | ||
644 | */ | ||
645 | static int sn_sal_connect_interrupt(struct sn_cons_port *port) | ||
646 | { | ||
647 | if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt, | ||
648 | IRQF_DISABLED | IRQF_SHARED, | ||
649 | "SAL console driver", port) >= 0) { | ||
650 | return SGI_UART_VECTOR; | ||
651 | } | ||
652 | |||
653 | printk(KERN_INFO "sn_console: console proceeding in polled mode\n"); | ||
654 | return 0; | ||
655 | } | ||
656 | |||
657 | /** | ||
658 | * sn_sal_timer_poll - this function handles polled console mode | 639 | * sn_sal_timer_poll - this function handles polled console mode |
659 | * @data: A pointer to our sn_cons_port (which contains the uart port) | 640 | * @data: A pointer to our sn_cons_port (which contains the uart port) |
660 | * | 641 | * |
@@ -746,30 +727,31 @@ static void __init sn_sal_switch_to_asynch(struct sn_cons_port *port) | |||
746 | * mode. We were previously in asynch/polling mode (using init_timer). | 727 | * mode. We were previously in asynch/polling mode (using init_timer). |
747 | * | 728 | * |
748 | * We attempt to switch to interrupt mode here by calling | 729 | * We attempt to switch to interrupt mode here by calling |
749 | * sn_sal_connect_interrupt. If that works out, we enable receive interrupts. | 730 | * request_irq. If that works out, we enable receive interrupts. |
750 | */ | 731 | */ |
751 | static void __init sn_sal_switch_to_interrupts(struct sn_cons_port *port) | 732 | static void __init sn_sal_switch_to_interrupts(struct sn_cons_port *port) |
752 | { | 733 | { |
753 | int irq; | ||
754 | unsigned long flags; | 734 | unsigned long flags; |
755 | 735 | ||
756 | if (!port) | 736 | if (port) { |
757 | return; | 737 | DPRINTF("sn_console: switching to interrupt driven console\n"); |
758 | |||
759 | DPRINTF("sn_console: switching to interrupt driven console\n"); | ||
760 | |||
761 | spin_lock_irqsave(&port->sc_port.lock, flags); | ||
762 | 738 | ||
763 | irq = sn_sal_connect_interrupt(port); | 739 | if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt, |
740 | IRQF_DISABLED | IRQF_SHARED, | ||
741 | "SAL console driver", port) >= 0) { | ||
742 | spin_lock_irqsave(&port->sc_port.lock, flags); | ||
743 | port->sc_port.irq = SGI_UART_VECTOR; | ||
744 | port->sc_ops = &intr_ops; | ||
764 | 745 | ||
765 | if (irq) { | 746 | /* turn on receive interrupts */ |
766 | port->sc_port.irq = irq; | 747 | ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV); |
767 | port->sc_ops = &intr_ops; | 748 | spin_unlock_irqrestore(&port->sc_port.lock, flags); |
768 | 749 | } | |
769 | /* turn on receive interrupts */ | 750 | else { |
770 | ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV); | 751 | printk(KERN_INFO |
752 | "sn_console: console proceeding in polled mode\n"); | ||
753 | } | ||
771 | } | 754 | } |
772 | spin_unlock_irqrestore(&port->sc_port.lock, flags); | ||
773 | } | 755 | } |
774 | 756 | ||
775 | /* | 757 | /* |