forked from analogdevicesinc/linux
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SERIAL]: Fix console write locking in sparc drivers.
Mirror the logic in 8250 for proper console write locking when SYSRQ is triggered or an OOPS is in progress. Signed-off-by: David S. Miller <[email protected]>
- Loading branch information
David S. Miller
committed
Jul 16, 2007
1 parent
9918cc2
commit f3c681c
Showing
4 changed files
with
68 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
* C. Dost, Pete Zaitcev, Ted Ts'o and Alex Buell for their | ||
* work there. | ||
* | ||
* Copyright (C) 2002, 2006 David S. Miller ([email protected]) | ||
* Copyright (C) 2002, 2006, 2007 David S. Miller ([email protected]) | ||
*/ | ||
|
||
#include <linux/module.h> | ||
|
@@ -1151,11 +1151,22 @@ sunzilog_console_write(struct console *con, const char *s, unsigned int count) | |
{ | ||
struct uart_sunzilog_port *up = &sunzilog_port_table[con->index]; | ||
unsigned long flags; | ||
int locked = 1; | ||
|
||
local_irq_save(flags); | ||
if (up->port.sysrq) { | ||
locked = 0; | ||
} else if (oops_in_progress) { | ||
locked = spin_trylock(&up->port.lock); | ||
} else | ||
spin_lock(&up->port.lock); | ||
|
||
spin_lock_irqsave(&up->port.lock, flags); | ||
uart_console_write(&up->port, s, count, sunzilog_putchar); | ||
udelay(2); | ||
spin_unlock_irqrestore(&up->port.lock, flags); | ||
|
||
if (locked) | ||
spin_unlock(&up->port.lock); | ||
local_irq_restore(flags); | ||
} | ||
|
||
static int __init sunzilog_console_setup(struct console *con, char *options) | ||
|