linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arndb@de.ibm.com>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] 12/18 console_unblank bug fix
Date: Mon, 5 Aug 2002 19:47:55 +0200	[thread overview]
Message-ID: <200208051947.55433.arndb@de.ibm.com> (raw)
In-Reply-To: <200208051830.50713.arndb@de.ibm.com>

Problem:  console_unblank can cause an endless trap loop if the console
          semaphore is already taken and console_unblank is called in
          interrupt context.
Solution: To avoid the trap loop just try to take the console semaphore
          with down_trylock and exit if it fails. It is not perfect
          since c->unblank() is not called in this case but way better
          than an endless trap loop. s390/s390x are the only two
          architectures that still use console_unblank. This patch
          has been accepted to 2.5.

diff -urN linux-2.4.19-rc3/kernel/printk.c linux-2.4.19-s390/kernel/printk.c
--- linux-2.4.19-rc3/kernel/printk.c	Tue Jul 30 09:02:32 2002
+++ linux-2.4.19-s390/kernel/printk.c	Tue Jul 30 09:02:57 2002
@@ -556,7 +556,14 @@
 {
 	struct console *c;
 
-	acquire_console_sem();
+	/*
+	 * Try to get the console semaphore. If someone else owns it
+	 * we have to return without unblanking because console_unblank
+	 * may be called in interrupt context.
+	 */
+	if (down_trylock(&console_sem) != 0)
+		return;
+	console_may_schedule = 0;
 	for (c = console_drivers; c != NULL; c = c->next)
 		if ((c->flags & CON_ENABLED) && c->unblank)
 			c->unblank();



  reply	other threads:[~2002-08-05 16:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-05 18:12 0/18 2.4.19 architecture updates for s390 following Arnd Bergmann
2002-08-05 17:47 ` Arnd Bergmann [this message]
2002-08-05 17:48 ` [PATCH] 13/18 Export elevator_init Arnd Bergmann
2002-08-05 17:50 ` [PATCH] 14/18 support for partition labels in devfs Arnd Bergmann
2002-08-05 17:14   ` Christoph Hellwig
2002-08-05 17:54 ` [PATCH] 15/18 better pte invalidation Arnd Bergmann
2002-08-05 17:01   ` Christoph Hellwig
2002-08-06 11:05     ` Arnd Bergmann
2002-08-06  9:43       ` Christoph Hellwig
2002-08-10 12:28   ` Paul Mackerras
2002-08-05 17:56 ` [PATCH] 16/18 add more possible root devices Arnd Bergmann
2002-08-05 17:15   ` Christoph Hellwig
2002-08-06 11:23     ` Arnd Bergmann
2002-08-05 18:04 ` [PATCH] 17/18 support arbitrary devfs names for tty devices Arnd Bergmann
2002-08-05 18:08 ` [PATCH] 18/18 scsi core changes Arnd Bergmann
2002-08-05 17:12   ` Christoph Hellwig
2002-08-06 11:06     ` Arnd Bergmann
2002-08-06  9:18       ` Christoph Hellwig
2002-08-06 23:10         ` Ingo Adlung
2002-08-06 23:12           ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200208051947.55433.arndb@de.ibm.com \
    --to=arndb@de.ibm.com \
    --cc=arnd@bergmann-dalldorf.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).