[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>

authored by Pat Gefre and committed by Linus Torvalds f70c81d4 44f5c4ce

+17 -35
+17 -35
drivers/serial/sn_console.c
··· 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 639 * sn_sal_timer_poll - this function handles polled console mode 659 640 * @data: A pointer to our sn_cons_port (which contains the uart port) 660 641 * ··· 727 746 * mode. We were previously in asynch/polling mode (using init_timer). 728 747 * 729 748 * We attempt to switch to interrupt mode here by calling 730 - * sn_sal_connect_interrupt. If that works out, we enable receive interrupts. 749 + * request_irq. If that works out, we enable receive interrupts. 731 750 */ 732 751 static void __init sn_sal_switch_to_interrupts(struct sn_cons_port *port) 733 752 { 734 - int irq; 735 753 unsigned long flags; 736 754 737 - if (!port) 738 - return; 755 + if (port) { 756 + DPRINTF("sn_console: switching to interrupt driven console\n"); 739 757 740 - DPRINTF("sn_console: switching to interrupt driven console\n"); 758 + if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt, 759 + IRQF_DISABLED | IRQF_SHARED, 760 + "SAL console driver", port) >= 0) { 761 + spin_lock_irqsave(&port->sc_port.lock, flags); 762 + port->sc_port.irq = SGI_UART_VECTOR; 763 + port->sc_ops = &intr_ops; 741 764 742 - spin_lock_irqsave(&port->sc_port.lock, flags); 743 - 744 - irq = sn_sal_connect_interrupt(port); 745 - 746 - if (irq) { 747 - port->sc_port.irq = irq; 748 - port->sc_ops = &intr_ops; 749 - 750 - /* turn on receive interrupts */ 751 - ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV); 765 + /* turn on receive interrupts */ 766 + ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV); 767 + spin_unlock_irqrestore(&port->sc_port.lock, flags); 768 + } 769 + else { 770 + printk(KERN_INFO 771 + "sn_console: console proceeding in polled mode\n"); 772 + } 752 773 } 753 - spin_unlock_irqrestore(&port->sc_port.lock, flags); 754 774 } 755 775 756 776 /*