public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: runet@innovsys•com (Rune Torgersen)
To: <linuxppc-dev@ozlabs•org>
Subject: [PATCH] Fix cpm uart corruption with PREEMPT_RT
Date: Tue, 20 May 2008 14:28:16 -0500 (CDT)	[thread overview]
Message-ID: <20080520192816.7F7E15AF22@innovsys.com> (raw)

Fix CPM serial port corruption when running with CONFIG_PREEMPT_RT.
Userland usage of console, and kernel printf's were stepping on each others toes.

Signed-off-by: Rune Torgersen <runet@innovsys•com>

diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index fb93403..79c109d 100755
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -1214,7 +1214,9 @@ static void cpm_uart_console_write(struct console *co, const char *s,
 	unsigned int i;
 	cbd_t __iomem *bdp, *bdbase;
 	unsigned char *cp;
+	unsigned long flags;
 
+	spin_lock_irqsave(&pinfo->port.lock, flags);
 	/* Get the address of the host memory buffer.
 	 */
 	bdp = pinfo->tx_cur;
@@ -1282,6 +1284,8 @@ static void cpm_uart_console_write(struct console *co, const char *s,
 		;
 
 	pinfo->tx_cur = bdp;
+
+	spin_unlock_irqrestore(&pinfo->port.lock, flags);
 }
 
 

             reply	other threads:[~2008-05-20 19:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-20 19:28 Rune Torgersen [this message]
2008-05-20 19:33 ` [PATCH] Fix cpm uart corruption with PREEMPT_RT Scott Wood
2008-05-20 19:35   ` Rune Torgersen
  -- strict thread matches above, loose matches on Subject: below --
2008-05-20 19:39 Rune Torgersen
2008-05-20 19:42 ` Scott Wood
2008-07-01  5:28 ` Kumar Gala

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=20080520192816.7F7E15AF22@innovsys.com \
    --to=runet@innovsys$(echo .)com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox