linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: tty:  Make RT aware
@ 2013-01-24  4:07 Libo Chen
  2013-01-24  5:30 ` Sven-Thorsten Dietrich
  0 siblings, 1 reply; 3+ messages in thread
From: Libo Chen @ 2013-01-24  4:07 UTC (permalink / raw)
  To: linux-rt-users; +Cc: lizefan, jovi.zhangwei

From: Libo Chen <libo.chen@huawei.com>

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

Signed-off-by: Libo Chen <libo.chen@huawei.com>

---
 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(-)

diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c
index 3ea8094..effdd18 100644
--- a/arch/alpha/kernel/srmcons.c
+++ b/arch/alpha/kernel/srmcons.c
@@ -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 */
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index b69356c..2558544 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -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);
 }
diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c
index e4f60e2..2f17b1a 100644
--- a/drivers/tty/serial/ar933x_uart.c
+++ b/drivers/tty/serial/ar933x_uart.c
@@ -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)
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
index c0b68b9..e699c72 100644
--- a/drivers/tty/serial/bcm63xx_uart.c
+++ b/drivers/tty/serial/bcm63xx_uart.c
@@ -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);
 }

 /*
diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c
index c4b50af..15cf1cf 100644
--- a/drivers/tty/serial/mfd.c
+++ b/drivers/tty/serial/mfd.c
@@ -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;
diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index 505961c..44aa631 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -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 = {
diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c
index f0d93eb..49c761d 100644
--- a/drivers/tty/serial/sunsab.c
+++ b/drivers/tty/serial/sunsab.c
@@ -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)
diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c
index babd947..e38492b 100644
--- a/drivers/tty/serial/sunzilog.c
+++ b/drivers/tty/serial/sunzilog.c
@@ -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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers: tty:  Make RT aware
  2013-01-24  4:07 [PATCH] drivers: tty: Make RT aware Libo Chen
@ 2013-01-24  5:30 ` Sven-Thorsten Dietrich
  2013-01-24  7:44   ` Libo Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Sven-Thorsten Dietrich @ 2013-01-24  5:30 UTC (permalink / raw)
  To: Libo Chen; +Cc: linux-rt-users, lizefan, jovi.zhangwei


On Jan 23, 2013, at 8:07 PM, Libo Chen <chenlibo.3@gmail.com> wrote:

> From: Libo Chen <libo.chen@huawei.com>
> 
> On RT  spinlocks are converted to "sleeping" locks and
> therefor the local_irq_save/restore must be converted to
> local_irq_save/restore_nort
> 
> Signed-off-by: Libo Chen <libo.chen@huawei.com>
> 
> ---
> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers: tty:  Make RT aware
  2013-01-24  5:30 ` Sven-Thorsten Dietrich
@ 2013-01-24  7:44   ` Libo Chen
  0 siblings, 0 replies; 3+ messages in thread
From: Libo Chen @ 2013-01-24  7:44 UTC (permalink / raw)
  To: Sven-Thorsten Dietrich; +Cc: linux-rt-users, lizefan, jovi.zhangwei, libo.chen

On 2013-1-24 13:30, Sven-Thorsten Dietrich wrote:
> On Jan 23, 2013, at 8:07 PM, Libo Chen <chenlibo.3@gmail.com> wrote:
>
>> From: Libo Chen <libo.chen@huawei.com>
>>
>> On RT  spinlocks are converted to "sleeping" locks and
>> therefor the local_irq_save/restore must be converted to
>> local_irq_save/restore_nort
>>
>> Signed-off-by: Libo Chen <libo.chen@huawei.com>
>>
>> ---
>> 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
>
>

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-24  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-24  4:07 [PATCH] drivers: tty: Make RT aware Libo Chen
2013-01-24  5:30 ` Sven-Thorsten Dietrich
2013-01-24  7:44   ` Libo Chen

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).