Thread (17 messages) 17 messages, 3 authors, 2015-08-06

Re: [RFC PATCH v2 0/3] genirq, serial: 8250: Workaround to avoid irq=0 for console

From: Peter Hurley <hidden>
Date: 2015-07-29 13:17:38
Also in: lkml
Subsystem: irq subsystem, the rest · Maintainers: Thomas Gleixner, Linus Torvalds

On 07/29/2015 07:53 AM, Thomas Gleixner wrote:
On Wed, 29 Jul 2015, Peter Hurley wrote:
quoted
On 07/29/2015 06:32 AM, Thomas Gleixner wrote:
quoted
On Wed, 29 Jul 2015, Taichi Kageyama wrote:
quoted
- Keep interrupt disabled on the CPU which is used to detect 
  an interrupt during the timeout of autoconfig_irq().
     + Kick printk() on the CPU which detects interrupt 
       from a console serial port.
This is wrong to begin with. How is that supposed to work on an UP
machine? Not at all.

So no, fix the code which has interrupts disabled accross autoprobing
and do not try to apply bandaids somewhere else.
Like printk() from some unrelated driver?
If that's the cause for the wreckage then yes, we need a way to tell
the printk code not to call into the driver until that initialization
step is done. It's that simple.
Like this?
--- >% --
Subject: [PATCH] genirq: Disable printk() during irq probe

printk() disables interrupts for extended periods of time while
outputting to console drivers. This breaks irq probing since the
triggered irq may not be serviced (in time) if scheduled on the
printk() cpu.

Claim the console_lock() which effectively disables console output.

Signed-off-by: Peter Hurley <redacted>
---
 kernel/irq/autoprobe.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/kernel/irq/autoprobe.c b/kernel/irq/autoprobe.c
index 0119b9d..47535d2 100644
--- a/kernel/irq/autoprobe.c
+++ b/kernel/irq/autoprobe.c
@@ -39,6 +39,13 @@ unsigned long probe_irq_on(void)
 	 */
 	async_synchronize_full();
 	mutex_lock(&probing_active);
+
+	/*
+	 * printk() breaks irq probing - disable printk output until probe
+	 * completes
+	 */
+	console_lock();
+
 	/*
 	 * something may have generated an irq long ago and we want to
 	 * flush such a longstanding irq before considering it as spurious.
@@ -132,6 +139,7 @@ unsigned int probe_irq_mask(unsigned long val)
 		}
 		raw_spin_unlock_irq(&desc->lock);
 	}
+	console_unlock();
 	mutex_unlock(&probing_active);
 
 	return mask & val;
@@ -174,6 +182,7 @@ int probe_irq_off(unsigned long val)
 		}
 		raw_spin_unlock_irq(&desc->lock);
 	}
+	console_unlock();
 	mutex_unlock(&probing_active);
 
 	if (nr_of_irqs > 1)
-- 
2.5.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help