login
Header Space

 
 

Re: Shutdown and Reboot Regression 2.6.25-rc[78]

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Bongani Hlope <bonganilinux@...>
Cc: Alexey Dobriyan <adobriyan@...>, Andrew Morton <akpm@...>, Rafael J. Wysocki <rjw@...>, LKML <linux-kernel@...>
Date: Monday, April 14, 2008 - 11:09 am

On Mon, 14 Apr 2008, Linus Torvalds wrote:

Oh, maybe I should actually include the patch too ;)

			Linus
---
 kernel/printk.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index c46a20a..4476879 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -643,8 +643,20 @@ static int acquire_console_semaphore_for_printk(unsigned int cpu)
 {
 	int retval = 0;
 
-	if (can_use_console(cpu))
-		retval = !try_acquire_console_sem();
+	if (!try_acquire_console_sem()) {
+		retval = 1;
+
+		/*
+		 * If we can't use the console, we need to release
+		 * the console semaphore by hand to avoid flushing
+		 * the buffer
+		 */
+		if (!can_use_console(cpu)) {
+			console_locked = 0;
+			up(&console_sem);
+			retval = 0;
+		}
+	}
 	printk_cpu = UINT_MAX;
 	spin_unlock(&logbuf_lock);
 	return retval;
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Shutdown and Reboot Regression 2.6.25-rc[78], Bongani Hlope, (Fri Apr 11, 4:41 pm)
Re: Shutdown and Reboot Regression 2.6.25-rc[78], Alexey Dobriyan, (Fri Apr 11, 5:42 pm)
Re: Shutdown and Reboot Regression 2.6.25-rc[78], Bongani Hlope, (Sat Apr 12, 3:05 am)
Re: Shutdown and Reboot Regression 2.6.25-rc[78], Linus Torvalds, (Mon Apr 14, 11:08 am)
Re: Shutdown and Reboot Regression 2.6.25-rc[78], Linus Torvalds, (Mon Apr 14, 11:09 am)
Re: Shutdown and Reboot Regression 2.6.25-rc[78], Bongani Hlope, (Tue Apr 15, 3:50 pm)
Re: Shutdown and Reboot Regression 2.6.25-rc[78], Linus Torvalds, (Fri Apr 11, 4:58 pm)
Re: Shutdown and Reboot Regression 2.6.25-rc[78], Bongani Hlope, (Fri Apr 11, 5:42 pm)
Re: Shutdown and Reboot Regression 2.6.25-rc[78], Linus Torvalds, (Fri Apr 11, 7:12 pm)
Re: Shutdown and Reboot Regression 2.6.25-rc[78], Bongani Hlope, (Sat Apr 12, 3:04 am)
speck-geostationary