From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: torvalds@osdl.org, linux-kernel@vger.kernel.org, rmk@arm.linux.org.uk
Subject: PATCH: Minimal fix for sysrq on serial console hang
Date: Wed, 12 Jul 2006 14:54:21 +0100 [thread overview]
Message-ID: <1152712461.22943.58.camel@localhost.localdomain> (raw)
When I originally did this change I used oops_in_progress as a locking
guide. However it turns out there is one other place that turns all the
locking on its head and that is sysrq.
The fix below is a minimal fix to avoid this hanging and worst case may
lead to the very rare stuck character as it did pre 2.6.16 anyway but
only when using sysrq [which right now hangs the box]
The right fix is probably to unlock on the sysrq path and relock and
reconfigure the uart but thats more complex and not low risk at this
point in time although I will revisit it after (or during KS/OLS)
depending on rmk's view.
Signed-off-by: Alan Cox <alan@redhat.com>
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc1/drivers/serial/8250.c linux-2.6.18-rc1/drivers/serial/8250.c
--- linux.vanilla-2.6.18-rc1/drivers/serial/8250.c 2006-07-12 12:16:47.000000000 +0100
+++ linux-2.6.18-rc1/drivers/serial/8250.c 2006-07-12 12:21:10.000000000 +0100
@@ -2240,10 +2240,12 @@
touch_nmi_watchdog();
- if (oops_in_progress) {
- locked = spin_trylock_irqsave(&up->port.lock, flags);
- } else
- spin_lock_irqsave(&up->port.lock, flags);
+ /*
+ * This can occur during an oops, in which case we want to
+ * do our best, or sysrq which is hairier and eventually needs
+ * a nicer solution
+ */
+ locked = spin_trylock_irqsave(&up->port.lock, flags);
/*
* First save the IER then disable the interrupts
next reply other threads:[~2006-07-12 13:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-12 13:54 Alan Cox [this message]
2006-07-12 13:47 ` PATCH: Minimal fix for sysrq on serial console hang Russell King
2006-07-12 14:11 ` Alan Cox
2006-07-12 14:01 ` Russell King
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=1152712461.22943.58.camel@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
--cc=torvalds@osdl.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.