From patchwork Thu Aug 14 02:42:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Rowand X-Patchwork-Id: 4721991 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0552E9F375 for ; Thu, 14 Aug 2014 02:42:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3A80F201CE for ; Thu, 14 Aug 2014 02:42:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5A8372018B for ; Thu, 14 Aug 2014 02:42:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753773AbaHNCmZ (ORCPT ); Wed, 13 Aug 2014 22:42:25 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:50696 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753689AbaHNCmY (ORCPT ); Wed, 13 Aug 2014 22:42:24 -0400 Received: by mail-pa0-f54.google.com with SMTP id fa1so761541pad.27 for ; Wed, 13 Aug 2014 19:42:23 -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 :references:in-reply-to:content-type:content-transfer-encoding; bh=LIfKYHkS3wOVVFnjt5SODn42aEWYdLn8ZU/iLL31HcI=; b=d2LHoe1WtjpJh28sjJLEn9S0WfuRw7Oq8VCkbq43AQkgkDIV21wzIGHMCxS4pHeW9y dNFYW5zDbASl8pozOJ4VX805NYe3LaYxHb1d3wmexgMhD4OxqWHHtCqSiIM1lXFqLC8B RMFR4U3NKGtzvvbZ7ZX99CE0zrlbK16g2pfyQDhyc3Ol1nKs7MeoE20S1YRZyxqDFgbA oKhTG56UPH0Qg/pDBCCPORUCWWTBaBUogDpuUaOm1hVyKNw5qvspOEFGySsQ4qt0+S5e FrK+uFb3Gr0blLysyahou5ywH7kSAVXEDJf2i0kB4ItpG6BiZTp96mMV7f3IQhiK2qCl VhAA== X-Received: by 10.66.65.133 with SMTP id x5mr1451423pas.26.1407984143805; Wed, 13 Aug 2014 19:42:23 -0700 (PDT) Received: from [172.26.77.103] ([64.211.224.253]) by mx.google.com with ESMTPSA id bi2sm114337pbb.64.2014.08.13.19.42.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Aug 2014 19:42:22 -0700 (PDT) Message-ID: <53EC220D.5050908@gmail.com> Date: Wed, 13 Aug 2014 19:42:21 -0700 From: Frank Rowand Reply-To: frowand.list@gmail.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: frowand.list@gmail.com CC: Stephen Boyd , Greg Kroah-Hartman , Linux Kernel list , "linux-arm-msm@vger.kernel.org" , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH to be tested] serial: msm_serial: add missing sysrq handling References: <53E2C573.7090709@gmail.com> <53EAB01B.5030102@codeaurora.org> <53EC1FEA.5070907@gmail.com> In-Reply-To: <53EC1FEA.5070907@gmail.com> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 On 8/13/2014 7:33 PM, Frank Rowand wrote: > On 8/12/2014 5:23 PM, Stephen Boyd wrote: >> On 08/06/14 17:16, Frank Rowand wrote: < snip > > The patches you sent are a little hard to read since they modify further code > that my patch modified. So I have redone your patches, as if my patch was > not previously applied. Hopefully I did not make any mistakes there. I will > reply to this email with each of your redone patches. Stephen's patch alternative number 2: --- drivers/tty/serial/msm_serial.c | 41 +++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: b/drivers/tty/serial/msm_serial.c =================================================================== --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -125,25 +125,40 @@ static void handle_rx_dm(struct uart_por port->icount.rx += count; while (count > 0) { - unsigned int c; + unsigned char buf[4]; + int sysrq, r_count, i; sr = msm_read(port, UART_SR); if ((sr & UART_SR_RX_READY) == 0) { msm_port->old_snap_state -= count; break; } - c = msm_read(port, UARTDM_RF); - if (sr & UART_SR_RX_BREAK) { - port->icount.brk++; - if (uart_handle_break(port)) - 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; + readsl(port->membase + UARTDM_RF, buf, 1); + + r_count = min_t(int, count, sizeof(buf)); + + for (i = 0; i < r_count; i++) { + char flag = TTY_NORMAL; + + if (sr & UART_SR_RX_BREAK) { + if (buf[i] == 0) { + port->icount.brk++; + flag = TTY_BREAK; + if (uart_handle_break(port)) + continue; + } + } + + if (!(port->read_status_mask & UART_SR_RX_BREAK)) + flag = TTY_NORMAL; + + spin_unlock(&port->lock); + sysrq = uart_handle_sysrq_char(port, buf[i]); + spin_lock(&port->lock); + if (!sysrq) + tty_insert_flip_char(tport, buf[i], flag); + } + count -= r_count; } spin_unlock(&port->lock);