From 3f81404b18522ee448f302815f2a84ed01ab3b3b Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Thu, 28 Jul 2011 13:32:57 +0200
Subject: [PATCH 172/204] tty/serial/omap: Make the locking RT aware

The lock is a sleeping lock and local_irq_save() is not the
optimsation we are looking for. Redo it to make it work on -RT and
non-RT.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/tty/serial/omap-serial.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Index: linux-6.6.58-rt45/drivers/tty/serial/omap-serial.c
===================================================================
@ linux-6.6.58-rt45/drivers/tty/serial/omap-serial.c:1215 @ serial_omap_console_write(struct console
 	unsigned int ier;
 	int locked = 1;
 
-	local_irq_save(flags);
-	if (up->port.sysrq)
-		locked = 0;
-	else if (oops_in_progress)
-		locked = uart_port_trylock(&up->port);
+	if (up->port.sysrq || oops_in_progress)
+		locked = uart_port_trylock_irqsave(&up->port, &flags);
 	else
-		uart_port_lock(&up->port);
+		uart_port_lock_irqsave(&up->port, &flags);
 
 	/*
 	 * First save the IER then disable the interrupts
@ linux-6.6.58-rt45/drivers/tty/serial/omap-serial.c:1245 @ serial_omap_console_write(struct console
 		check_modem_status(up);
 
 	if (locked)
-		uart_port_unlock(&up->port);
-	local_irq_restore(flags);
+		uart_port_unlock_irqrestore(&up->port, flags);
 }
 
 static int __init