* [PATCH] 2.6 Altix : console fix for CONFIG_DEBUG_SHIRQ usage
@ 2007-03-07 21:57 Pat Gefre
2007-03-07 22:38 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Pat Gefre @ 2007-03-07 21:57 UTC (permalink / raw)
To: linux-kernel, akpm
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>
sn_console.c | 52 +++++++++++++++++-----------------------------------
1 file changed, 17 insertions(+), 35 deletions(-)
Index: linux-2.6/drivers/serial/sn_console.c
===================================================================
--- linux-2.6.orig/drivers/serial/sn_console.c 2007-03-07 11:59:57.853775134 -0600
+++ linux-2.6/drivers/serial/sn_console.c 2007-03-07 15:27:37.455224799 -0600
@@ -636,25 +636,6 @@
}
/**
- * 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
* @data: A pointer to our sn_cons_port (which contains the uart port)
*
@@ -746,30 +727,31 @@
* mode. We were previously in asynch/polling mode (using init_timer).
*
* 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)
{
- int irq;
unsigned long flags;
- if (!port)
- return;
-
- DPRINTF("sn_console: switching to interrupt driven console\n");
-
- spin_lock_irqsave(&port->sc_port.lock, flags);
+ if (port) {
+ DPRINTF("sn_console: switching to interrupt driven console\n");
- irq = sn_sal_connect_interrupt(port);
+ 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;
- if (irq) {
- port->sc_port.irq = irq;
- port->sc_ops = &intr_ops;
-
- /* turn on receive interrupts */
- ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV);
+ /* turn on receive interrupts */
+ ia64_sn_console_intr_enable(SAL_CONSOLE_INTR_RECV);
+ spin_unlock_irqrestore(&port->sc_port.lock, flags);
+ }
+ else {
+ printk(KERN_INFO
+ "sn_console: console proceeding in polled mode\n");
+ }
}
- spin_unlock_irqrestore(&port->sc_port.lock, flags);
}
/*
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] 2.6 Altix : console fix for CONFIG_DEBUG_SHIRQ usage
2007-03-07 21:57 [PATCH] 2.6 Altix : console fix for CONFIG_DEBUG_SHIRQ usage Pat Gefre
@ 2007-03-07 22:38 ` Andrew Morton
2007-03-08 20:15 ` Pat Gefre
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-03-07 22:38 UTC (permalink / raw)
To: Pat Gefre; +Cc: linux-kernel
On Wed, 7 Mar 2007 15:57:07 -0600 (CST)
Pat Gefre <pfg@sgi.com> wrote:
> 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.
Should this go into 2.6.20.x as well?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] 2.6 Altix : console fix for CONFIG_DEBUG_SHIRQ usage
2007-03-07 22:38 ` Andrew Morton
@ 2007-03-08 20:15 ` Pat Gefre
0 siblings, 0 replies; 3+ messages in thread
From: Pat Gefre @ 2007-03-08 20:15 UTC (permalink / raw)
To: Andrew Morton; +Cc: Pat Gefre, linux-kernel
+
+ On Wed, 7 Mar 2007 15:57:07 -0600 (CST)
+ Pat Gefre <pfg@sgi.com> wrote:
+
+ > 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.
+
+ Should this go into 2.6.20.x as well?
+
Sure. I don't see why not.
-- Pat
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-03-08 20:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-07 21:57 [PATCH] 2.6 Altix : console fix for CONFIG_DEBUG_SHIRQ usage Pat Gefre
2007-03-07 22:38 ` Andrew Morton
2007-03-08 20:15 ` Pat Gefre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox