Skip to contentSkip to conversation

drivers: tty: Make RT aware

PATCH In review Libo Chen 2 participants 3 messages Jan 24, 2013

Subsystems (4)
lore
Share & tools
lore

Libo Chen

author
#0 lore raw

PATCH 1/1 drivers: tty: Make RT aware

From: Libo Chen <[email protected]>

On RT spinlocks are converted to "sleeping" locks and therefor the local_irq_save/restore must be converted to local_irq_save/restore_nort

---
 arch/alpha/kernel/srmcons.c       |    4 ++--
 drivers/tty/serial/amba-pl011.c   |    4 ++--
 drivers/tty/serial/ar933x_uart.c  |    4 ++--
 drivers/tty/serial/bcm63xx_uart.c |    4 ++--
 drivers/tty/serial/mfd.c          |    4 ++--
 drivers/tty/serial/sunhv.c        |    8 ++++----
 drivers/tty/serial/sunsab.c       |    4 ++--
 drivers/tty/serial/sunzilog.c     |    4 ++--
 8 files changed, 18 insertions(+), 18 deletions(-)
arch/alpha/kernel/srmcons.c +2 -2
index 3ea8094..effdd18 100644
@@ -71,7 +71,7 @@ srmcons_receive_chars(unsigned long data)
 	unsigned long flags;
 	int incr = 10;
 
-	local_irq_save(flags);
+	local_irq_save_nort(flags);
 	if (spin_trylock(&srmcons_callback_lock)) {
 		if (!srmcons_do_receive_chars(port->tty))
 			incr = 100;
@@ -83,7 +83,7 @@ srmcons_receive_chars(unsigned long data)
 		mod_timer(&srmconsp->timer, jiffies + incr);
 	spin_unlock(&port->lock);
 
-	local_irq_restore(flags);
+	local_irq_restore_nort(flags);
 }
 
 /* called with callback_lock held */
drivers/tty/serial/amba-pl011.c +2 -2
index b69356c..2558544 100644
@@ -1788,7 +1788,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count)
 
 	clk_enable(uap->clk);
 
-	local_irq_save(flags);
+	local_irq_save_nort(flags);
 	if (uap->port.sysrq)
 		locked = 0;
 	else if (oops_in_progress)
@@ -1817,7 +1817,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count)
 
 	if (locked)
 		spin_unlock(&uap->port.lock);
-	local_irq_restore(flags);
+	local_irq_restore_nort(flags);
 
 	clk_disable(uap->clk);
 }
drivers/tty/serial/ar933x_uart.c +2 -2
index e4f60e2..2f17b1a 100644
@@ -468,7 +468,7 @@ static void ar933x_uart_console_write(struct console *co, const char *s,
 	unsigned int int_en;
 	int locked = 1;
 
-	local_irq_save(flags);
+	local_irq_save_nort(flags);
 
 	if (up->port.sysrq)
 		locked = 0;
@@ -497,7 +497,7 @@ static void ar933x_uart_console_write(struct console *co, const char *s,
 	if (locked)
 		spin_unlock(&up->port.lock);
 
-	local_irq_restore(flags);
+	local_irq_restore_nort(flags);
 }
 
 static int ar933x_uart_console_setup(struct console *co, char *options)
drivers/tty/serial/bcm63xx_uart.c +2 -2
index c0b68b9..e699c72 100644
@@ -718,7 +718,7 @@ static void bcm_console_write(struct console *co, const char *s,
 
 	port = &ports[co->index];
 
-	local_irq_save(flags);
+	local_irq_save_nort(flags);
 	if (port->sysrq) {
 		/* bcm_uart_interrupt() already took the lock */
 		locked = 0;
@@ -737,7 +737,7 @@ static void bcm_console_write(struct console *co, const char *s,
 
 	if (locked)
 		spin_unlock(&port->lock);
-	local_irq_restore(flags);
+	local_irq_restore_nort(flags);
 }
 
 /*
drivers/tty/serial/mfd.c +2 -2
index c4b50af..15cf1cf 100644
@@ -1113,7 +1113,7 @@ serial_hsu_console_write(struct console *co, const char *s, unsigned int count)
 	unsigned int ier;
 	int locked = 1;
 
-	local_irq_save(flags);
+	local_irq_save_nort(flags);
 	if (up->port.sysrq)
 		locked = 0;
 	else if (oops_in_progress) {
@@ -1136,7 +1136,7 @@ serial_hsu_console_write(struct console *co, const char *s, unsigned int count)
 
 	if (locked)
 		spin_unlock(&up->port.lock);
-	local_irq_restore(flags);
+	local_irq_restore_nort(flags);
 }
 
 static struct console serial_hsu_console;
drivers/tty/serial/sunhv.c +4 -4
index 505961c..44aa631 100644
@@ -432,7 +432,7 @@ static void sunhv_console_write_paged(struct console *con, const char *s, unsign
 	unsigned long flags;
 	int locked = 1;
 
-	local_irq_save(flags);
+	local_irq_save_nort(flags);
 	if (port->sysrq) {
 		locked = 0;
 	} else if (oops_in_progress) {
@@ -470,7 +470,7 @@ static void sunhv_console_write_paged(struct console *con, const char *s, unsign
 
 	if (locked)
 		spin_unlock(&port->lock);
-	local_irq_restore(flags);
+	local_irq_restore_nort(flags);
 }
 
 static inline void sunhv_console_putchar(struct uart_port *port, char c)
@@ -491,7 +491,7 @@ static void sunhv_console_write_bychar(struct console *con, const char *s, unsig
 	unsigned long flags;
 	int i, locked = 1;
 
-	local_irq_save(flags);
+	local_irq_save_nort(flags);
 	if (port->sysrq) {
 		locked = 0;
 	} else if (oops_in_progress) {
@@ -507,7 +507,7 @@ static void sunhv_console_write_bychar(struct console *con, const char *s, unsig
 
 	if (locked)
 		spin_unlock(&port->lock);
-	local_irq_restore(flags);
+	local_irq_restore_nort(flags);
 }
 
 static struct console sunhv_console = {
drivers/tty/serial/sunsab.c +2 -2
index f0d93eb..49c761d 100644
@@ -850,7 +850,7 @@ static void sunsab_console_write(struct console *con, const char *s, unsigned n)
 	unsigned long flags;
 	int locked = 1;
 
-	local_irq_save(flags);
+	local_irq_save_nort(flags);
 	if (up->port.sysrq) {
 		locked = 0;
 	} else if (oops_in_progress) {
@@ -863,7 +863,7 @@ static void sunsab_console_write(struct console *con, const char *s, unsigned n)
 
 	if (locked)
 		spin_unlock(&up->port.lock);
-	local_irq_restore(flags);
+	local_irq_restore_nort(flags);
 }
 
 static int sunsab_console_setup(struct console *con, char *options)
drivers/tty/serial/sunzilog.c +2 -2
index babd947..e38492b 100644
@@ -1202,7 +1202,7 @@ sunzilog_console_write(struct console *con, const char *s, unsigned int count)
 	unsigned long flags;
 	int locked = 1;
 
-	local_irq_save(flags);
+	local_irq_save_nort(flags);
 	if (up->port.sysrq) {
 		locked = 0;
 	} else if (oops_in_progress) {
@@ -1215,7 +1215,7 @@ sunzilog_console_write(struct console *con, const char *s, unsigned int count)
 
 	if (locked)
 		spin_unlock(&up->port.lock);
-	local_irq_restore(flags);
+	local_irq_restore_nort(flags);
 }
 
 static int __init sunzilog_console_setup(struct console *con, char *options)

-- 1.7.1

#1 lore raw
Quoted 9 lines · Libo Chen

From: Libo Chen <[email protected]>

On RT spinlocks are converted to "sleeping" locks and therefor the local_irq_save/restore must be converted to local_irq_save/restore_nort

---

Quoted 10 lines
arch/alpha/kernel/srmcons.c       |    4 ++--
drivers/tty/serial/amba-pl011.c   |    4 ++--
drivers/tty/serial/ar933x_uart.c  |    4 ++--
drivers/tty/serial/bcm63xx_uart.c |    4 ++--
drivers/tty/serial/mfd.c          |    4 ++--
drivers/tty/serial/sunhv.c        |    8 ++++----
drivers/tty/serial/sunsab.c       |    4 ++--
drivers/tty/serial/sunzilog.c     |    4 ++--
8 files changed, 18 insertions(+), 18 deletions(-)

Has any of this code been tested on actual hardware running RT Kernel?

Thanks

Sven

author
#2 lore raw
Quoted 21 lines · Sven-Thorsten Dietrich
Quoted 9 lines · Libo Chen

From: Libo Chen <[email protected]>

On RT spinlocks are converted to "sleeping" locks and therefor the local_irq_save/restore must be converted to local_irq_save/restore_nort

---

Quoted 10 lines
arch/alpha/kernel/srmcons.c       |    4 ++--
drivers/tty/serial/amba-pl011.c   |    4 ++--
drivers/tty/serial/ar933x_uart.c  |    4 ++--
drivers/tty/serial/bcm63xx_uart.c |    4 ++--
drivers/tty/serial/mfd.c          |    4 ++--
drivers/tty/serial/sunhv.c        |    8 ++++----
drivers/tty/serial/sunsab.c       |    4 ++--
drivers/tty/serial/sunzilog.c     |    4 ++--
8 files changed, 18 insertions(+), 18 deletions(-)
Quoted 7 lines

Has any of this code been tested on actual hardware running RT Kernel?

Thanks

Sven

Thank you for your attention.
I don`t have these hardwares, and just review the RT code. As we know interrupt was threaded and spinlock can sleep on RT, so local_irq_save is unnecessary here.