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: 4722021 Return-Path: X-Original-To: patchwork-linux-arm@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 833419F319 for ; Thu, 14 Aug 2014 02:44:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3BB1201CD for ; Thu, 14 Aug 2014 02:44:18 +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 F420F2018B for ; Thu, 14 Aug 2014 02:44:17 +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 1XHl02-0001Hj-Ru; Thu, 14 Aug 2014 02:42:46 +0000 Received: from mail-pd0-x22d.google.com ([2607:f8b0:400e:c02::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XHl00-00019C-KE for linux-arm-kernel@lists.infradead.org; Thu, 14 Aug 2014 02:42:45 +0000 Received: by mail-pd0-f173.google.com with SMTP id w10so735483pde.4 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 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140813_194244_687155_16DF0B3A X-CRM114-Status: GOOD ( 18.50 ) X-Spam-Score: -0.8 (/) Cc: Greg Kroah-Hartman , Stephen Boyd , 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, RCVD_IN_DNSWL_NONE, 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(-) 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);