From patchwork Thu Aug 7 00:16:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Rowand X-Patchwork-Id: 4688791 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BE944C0338 for ; Thu, 7 Aug 2014 00:19:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F2A932018A for ; Thu, 7 Aug 2014 00:19:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3A4182017A for ; Thu, 7 Aug 2014 00:19:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XFBOT-0006Jg-V7; Thu, 07 Aug 2014 00:17:21 +0000 Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XFBOR-0006IR-Ab for linux-arm-kernel@lists.infradead.org; Thu, 07 Aug 2014 00:17:19 +0000 Received: by mail-la0-f45.google.com with SMTP id ty20so2951012lab.32 for ; Wed, 06 Aug 2014 17:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=aVIFHcxkhrlbM6Vpy6G8NuO5JNH5DLukdPIT5cIvMeM=; b=DeoeL754MY8NHICQBSsg7gQ8mHw9ch9hIP6DvfeLlKzov+iONANDWfYfg+Opnn5qWp 9fg56iWNNZEKwchRfZXKRksawCRjxVrpsQ3gxhgQffiZpny0exFqbMs94lEJEWeHikW9 i0sh/GFdCfYw88McVdkcAbu02rdZhlDqNp4BA6J5cG0BrhLJfqncgbirRSbN59h97bnb BYb+3uhPOLS1UmaKXifpijnWfp47F026jYzh6rEcWfaJ9Wn7VBQHvmuxYWkMbmQiHEB9 kTwaT+dsrcmTrjsWl5EwZSU7WguNfVbyem3y5TCIBqBZUZuNpDu6eWaqcHrFMM06fwOV Ek3A== X-Received: by 10.112.4.228 with SMTP id n4mr13326865lbn.46.1407370615740; Wed, 06 Aug 2014 17:16:55 -0700 (PDT) Received: from [172.26.77.22] ([64.211.224.253]) by mx.google.com with ESMTPSA id g8sm1210185lam.23.2014.08.06.17.16.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Aug 2014 17:16:55 -0700 (PDT) Message-ID: <53E2C573.7090709@gmail.com> Date: Wed, 06 Aug 2014 17:16:51 -0700 From: Frank Rowand User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Stephen Boyd Subject: [PATCH to be tested] serial: msm_serial: add missing sysrq handling X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140806_171719_576860_55CDE1ED X-CRM114-Status: GOOD ( 13.81 ) X-Spam-Score: -0.1 (/) Cc: Greg Kroah-Hartman , Linux Kernel list , linux-arm-kernel@lists.infradead.org, "linux-arm-msm@vger.kernel.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: frowand.list@gmail.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 for the '~' escape to be recognized. Thanks! -Frank From: Frank Rowand Add missing sysrq handling to msm_serial. Signed-off-by: Frank Rowand --- 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);