[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>
This commit is contained in:
parent
44f5c4ced6
commit
f70c81d4dd
1 changed files with 17 additions and 35 deletions
|
@ -635,25 +635,6 @@ static irqreturn_t sn_sal_interrupt(int irq, void *dev_id)
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* sn_sal_connect_interrupt - Request interrupt, handled by sn_sal_interrupt
|
|
||||||
* @port: Our sn_cons_port (which contains the uart port)
|
|
||||||
*
|
|
||||||
* returns the console irq if interrupt is successfully registered, else 0
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static int sn_sal_connect_interrupt(struct sn_cons_port *port)
|
|
||||||
{
|
|
||||||
if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt,
|
|
||||||
IRQF_DISABLED | IRQF_SHARED,
|
|
||||||
"SAL console driver", port) >= 0) {
|
|
||||||
return SGI_UART_VECTOR;
|
|
||||||
}
|
|
||||||
|
|
||||||
printk(KERN_INFO "sn_console: console proceeding in polled mode\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sn_sal_timer_poll - this function handles polled console mode
|
* sn_sal_timer_poll - this function handles polled console mode
|
||||||
* @data: A pointer to our sn_cons_port (which contains the uart port)
|
* @data: A pointer to our sn_cons_port (which contains the uart port)
|
||||||
|
@ -746,30 +727,31 @@ static void __init sn_sal_switch_to_asynch(struct sn_cons_port *port)
|
||||||
* mode. We were previously in asynch/polling mode (using init_timer).
|
* mode. We were previously in asynch/polling mode (using init_timer).
|
||||||
*
|
*
|
||||||
* We attempt to switch to interrupt mode here by calling
|
* We attempt to switch to interrupt mode here by calling
|
||||||
* sn_sal_connect_interrupt. If that works out, we enable receive interrupts.
|
* request_irq. If that works out, we enable receive interrupts.
|
||||||
*/
|
*/
|
||||||
static void __init sn_sal_switch_to_interrupts(struct sn_cons_port *port)
|
static void __init sn_sal_switch_to_interrupts(struct sn_cons_port *port)
|
||||||
{
|
{
|
||||||
int irq;
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
if (!port)
|
if (port) {
|
||||||
return;
|
DPRINTF("sn_console: switching to interrupt driven console\n");
|
||||||
|
|
||||||
DPRINTF("sn_console: switching to interrupt driven console\n");
|
if (request_irq(SGI_UART_VECTOR, sn_sal_interrupt,
|
||||||
|
IRQF_DISABLED | IRQF_SHARED,
|
||||||
|
"SAL console driver", port) >= 0) {
|
||||||
|
spin_lock_irqsave(&port->sc_port.lock, flags);
|
||||||
|
port->sc_port.irq = SGI_UART_VECTOR;
|
||||||
|
port->sc_ops = &intr_ops;
|
||||||
|
|
||||||
spin_lock_irqsave(&port->sc_port.lock, flags);
|
/* turn on receive interrupts */
|
||||||
|
ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV);
|
||||||
irq = sn_sal_connect_interrupt(port);
|
spin_unlock_irqrestore(&port->sc_port.lock, flags);
|
||||||
|
}
|
||||||
if (irq) {
|
else {
|
||||||
port->sc_port.irq = irq;
|
printk(KERN_INFO
|
||||||
port->sc_ops = &intr_ops;
|
"sn_console: console proceeding in polled mode\n");
|
||||||
|
}
|
||||||
/* turn on receive interrupts */
|
|
||||||
ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV);
|
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&port->sc_port.lock, flags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue