Skip to contentSkip to conversation

serial21285: fix disable_irq-from-interrupt-handler deadlock

PATCH New Simon Kagstrom 3 participants 6 messages Nov 13, 2009 – Jan 10, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial21285: fix disable_irq-from-interrupt-handler deadlock

The console hangs during bootup when disable_irq is called from the transmit interrupt handler (it will wait forever for it's "own" interrupt in synchronize_irq). Fix by using disable_irq_nosync() instead.

---
Russell: This patch is a bit of RFC since I'm not quite sure that it's the correct solution. It unbreaks booting on our footbridge-based platform. Let me know if I should look at other solutions!

 drivers/serial/21285.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/serial/21285.c +2 -2
index 1e3d193..8681f13 100644
@@ -58,7 +58,7 @@ static const char serial21285_name[] = "Footbridge UART";
 static void serial21285_stop_tx(struct uart_port *port)
 {
 	if (tx_enabled(port)) {
-		disable_irq(IRQ_CONTX);
+		disable_irq_nosync(IRQ_CONTX);
 		tx_enabled(port) = 0;
 	}
 }
@@ -74,7 +74,7 @@ static void serial21285_start_tx(struct uart_port *port)
 static void serial21285_stop_rx(struct uart_port *port)
 {
 	if (rx_enabled(port)) {
-		disable_irq(IRQ_CONRX);
+		disable_irq_nosync(IRQ_CONRX);
 		rx_enabled(port) = 0;
 	}
 }
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 serial21285: fix disable_irq-from-interrupt-handler deadlock

Quoted 3 lines · Simon Kagstrom

Russell: This patch is a bit of RFC since I'm not quite sure that it's the correct solution. It unbreaks booting on our footbridge-based platform. Let me know if I should look at other solutions!

It does look like the right thing to do - the original code will hang now that we're using genirq stuff.

#2 lore raw

PATCH 1/1 serial21285: fix disable_irq-from-interrupt-handler deadlock

Quoted 7 lines · On Fri, 13 Nov 2009 09:59:37 +0000 Russell King - ARM Linux…
Quoted 3 lines · Simon Kagstrom

Russell: This patch is a bit of RFC since I'm not quite sure that it's the correct solution. It unbreaks booting on our footbridge-based platform. Let me know if I should look at other solutions!

It does look like the right thing to do - the original code will hang now that we're using genirq stuff.

Good, thanks. I guess you'll take it into your tree then?

// Simon

#3 lore raw

PATCH 1/1 serial21285: fix disable_irq-from-interrupt-handler deadlock

In reply to Russell King - ARM Linux

Hi again Russell!

Quoted 7 lines · On Fri, 13 Nov 2009 09:59:37 +0000 Russell King - ARM Linux…
Quoted 3 lines · Simon Kagstrom

Russell: This patch is a bit of RFC since I'm not quite sure that it's the correct solution. It unbreaks booting on our footbridge-based platform. Let me know if I should look at other solutions!

It does look like the right thing to do - the original code will hang now that we're using genirq stuff.

I haven't see this patch in 2.6.33 yet, was it forgotten or is it still in the queue somewhere?

(Ping!)

// Simon

#4 lore raw

PATCH 1/1 serial21285: fix disable_irq-from-interrupt-handler deadlock

Quoted 10 lines · Simon Kagstrom

Hi again Russell!

Quoted 5 lines · On Fri, 13 Nov 2009 09:59:37 +0000 Russell King - ARM Linux…
Quoted 3 lines · Simon Kagstrom

Russell: This patch is a bit of RFC since I'm not quite sure that it's the correct solution. It unbreaks booting on our footbridge-based platform. Let me know if I should look at other solutions!

Quoted 7 lines
Quoted 2 lines

It does look like the right thing to do - the original code will hang now that we're using genirq stuff.

I haven't see this patch in 2.6.33 yet, was it forgotten or is it still in the queue somewhere?

(Ping!)

It needs to go into the patch system; I'm terrible with taking patches directly from email.

Just add a 'KernelVersion:' tag to indicate which version the patch was generated against somewhere in the patch description and forward to patches at arm.linux.org.uk

#5 lore raw

PATCH 1/1 serial21285: fix disable_irq-from-interrupt-handler deadlock

In reply to Simon Kagstrom
Quoted 6 lines · Simon Kagstrom

The console hangs during bootup when disable_irq is called from the transmit interrupt handler (it will wait forever for it's "own" interrupt in synchronize_irq). Fix by using disable_irq_nosync() instead.

Quoted 38 lines

---
Russell: This patch is a bit of RFC since I'm not quite sure that it's the correct solution. It unbreaks booting on our footbridge-based platform. Let me know if I should look at other solutions!

 drivers/serial/21285.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/serial/21285.c +2 -2
index 1e3d193..8681f13 100644
@@ -58,7 +58,7 @@ static const char serial21285_name[] = "Footbridge UART";
 static void serial21285_stop_tx(struct uart_port *port)
 {
 	if (tx_enabled(port)) {
-		disable_irq(IRQ_CONTX);
+		disable_irq_nosync(IRQ_CONTX);
 		tx_enabled(port) = 0;
 	}
 }
@@ -74,7 +74,7 @@ static void serial21285_start_tx(struct uart_port *port)
 static void serial21285_stop_rx(struct uart_port *port)
 {
 	if (rx_enabled(port)) {
-		disable_irq(IRQ_CONRX);
+		disable_irq_nosync(IRQ_CONRX);
 		rx_enabled(port) = 0;
 	}
 }
Signature · 7 lines
1.6.0.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.