Re: [PATCH] 2.6 Altix : console fix for CONFIG_DEBUG_SHIRQ usage

Previous thread: [PATCH] 2.6.21-rc2-mm2 Fix boot problem on IA64 with CONFIG_HOLE_IN_ZONES and CONFIG_PAGE_GROUP_BY_MOBILITY by Mel Gorman on Wednesday, March 7, 2007 - 5:13 pm. (1 message)

Next thread: blocking read in tty driver by Mockern on Wednesday, March 7, 2007 - 6:07 pm. (1 message)
To: <linux-kernel@...>, <akpm@...>
Date: Wednesday, March 7, 2007 - 5:57 pm

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) {
+ DPR...

To: Pat Gefre <pfg@...>
Cc: <linux-kernel@...>
Date: Wednesday, March 7, 2007 - 6:38 pm

On Wed, 7 Mar 2007 15:57:07 -0600 (CST)

Should this go into 2.6.20.x as well?
-

To: Andrew Morton <akpm@...>
Cc: Pat Gefre <pfg@...>, <linux-kernel@...>
Date: Thursday, March 8, 2007 - 4:15 pm

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

Previous thread: [PATCH] 2.6.21-rc2-mm2 Fix boot problem on IA64 with CONFIG_HOLE_IN_ZONES and CONFIG_PAGE_GROUP_BY_MOBILITY by Mel Gorman on Wednesday, March 7, 2007 - 5:13 pm. (1 message)

Next thread: blocking read in tty driver by Mockern on Wednesday, March 7, 2007 - 6:07 pm. (1 message)