From: Frank Rowand <frowand.list@gmail.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linux Kernel list <linux-kernel@vger.kernel.org>,
"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH to be tested] serial: msm_serial: add missing sysrq handling
Date: Wed, 06 Aug 2014 17:16:51 -0700 [thread overview]
Message-ID: <53E2C573.7090709@gmail.com> (raw)
Stephen,
Can you test this patch on v 1.3 hardware? It works on my v 1.4.
If you use kdmx2, the way to send a break is '~B'. The previous
key pressed must be <enter> for the '~' escape to be recognized.
Thanks!
-Frank
From: Frank Rowand <frank.rowand@sonymobile.com>
Add missing sysrq handling to msm_serial.
Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com>
---
drivers/tty/serial/msm_serial.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
Index: b/drivers/tty/serial/msm_serial.c
===================================================================
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -126,6 +126,8 @@ static void handle_rx_dm(struct uart_por
while (count > 0) {
unsigned int c;
+ unsigned char *cp;
+ int res;
sr = msm_read(port, UART_SR);
if ((sr & UART_SR_RX_READY) == 0) {
@@ -135,15 +137,29 @@ static void handle_rx_dm(struct uart_por
c = msm_read(port, UARTDM_RF);
if (sr & UART_SR_RX_BREAK) {
port->icount.brk++;
- if (uart_handle_break(port))
+ if (uart_handle_break(port)) {
+ count -= 1;
continue;
+ }
} else if (sr & UART_SR_PAR_FRAME_ERR)
port->icount.frame++;
- /* TODO: handle sysrq */
- tty_insert_flip_string(tport, (char *)&c,
- (count > 4) ? 4 : count);
- count -= 4;
+ spin_unlock(&port->lock);
+ res = uart_handle_sysrq_char(port, c);
+ spin_lock(&port->lock);
+
+ cp = (unsigned char *)&c;
+ if (res) {
+ count -= 1;
+ tty_insert_flip_string(tport, cp + 1,
+ (count > 3) ? 3 : count);
+ count -= (count > 3) ? 3 : count;
+ } else {
+ tty_insert_flip_string(tport, cp,
+ (count > 4) ? 4 : count);
+ count -= (count > 4) ? 4 : count;
+ }
+
}
spin_unlock(&port->lock);
WARNING: multiple messages have this Message-ID (diff)
From: frowand.list@gmail.com (Frank Rowand)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH to be tested] serial: msm_serial: add missing sysrq handling
Date: Wed, 06 Aug 2014 17:16:51 -0700 [thread overview]
Message-ID: <53E2C573.7090709@gmail.com> (raw)
Stephen,
Can you test this patch on v 1.3 hardware? It works on my v 1.4.
If you use kdmx2, the way to send a break is '~B'. The previous
key pressed must be <enter> for the '~' escape to be recognized.
Thanks!
-Frank
From: Frank Rowand <frank.rowand@sonymobile.com>
Add missing sysrq handling to msm_serial.
Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com>
---
drivers/tty/serial/msm_serial.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
Index: b/drivers/tty/serial/msm_serial.c
===================================================================
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -126,6 +126,8 @@ static void handle_rx_dm(struct uart_por
while (count > 0) {
unsigned int c;
+ unsigned char *cp;
+ int res;
sr = msm_read(port, UART_SR);
if ((sr & UART_SR_RX_READY) == 0) {
@@ -135,15 +137,29 @@ static void handle_rx_dm(struct uart_por
c = msm_read(port, UARTDM_RF);
if (sr & UART_SR_RX_BREAK) {
port->icount.brk++;
- if (uart_handle_break(port))
+ if (uart_handle_break(port)) {
+ count -= 1;
continue;
+ }
} else if (sr & UART_SR_PAR_FRAME_ERR)
port->icount.frame++;
- /* TODO: handle sysrq */
- tty_insert_flip_string(tport, (char *)&c,
- (count > 4) ? 4 : count);
- count -= 4;
+ spin_unlock(&port->lock);
+ res = uart_handle_sysrq_char(port, c);
+ spin_lock(&port->lock);
+
+ cp = (unsigned char *)&c;
+ if (res) {
+ count -= 1;
+ tty_insert_flip_string(tport, cp + 1,
+ (count > 3) ? 3 : count);
+ count -= (count > 3) ? 3 : count;
+ } else {
+ tty_insert_flip_string(tport, cp,
+ (count > 4) ? 4 : count);
+ count -= (count > 4) ? 4 : count;
+ }
+
}
spin_unlock(&port->lock);
next reply other threads:[~2014-08-07 0:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-07 0:16 Frank Rowand [this message]
2014-08-07 0:16 ` [PATCH to be tested] serial: msm_serial: add missing sysrq handling Frank Rowand
2014-08-13 0:23 ` Stephen Boyd
2014-08-13 0:23 ` Stephen Boyd
2014-08-14 2:33 ` Frank Rowand
2014-08-14 2:33 ` Frank Rowand
2014-08-14 2:42 ` Frank Rowand
2014-08-14 2:42 ` Frank Rowand
2014-08-14 2:42 ` Frank Rowand
2014-08-14 2:42 ` Frank Rowand
2014-10-03 21:34 ` Stephen Boyd
2014-10-03 21:34 ` Stephen Boyd
2014-10-03 22:18 ` Frank Rowand
2014-10-03 22:18 ` Frank Rowand
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=53E2C573.7090709@gmail.com \
--to=frowand.list@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.