From patchwork Fri Mar 28 10:53:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 27251 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DD62E20062 for ; Fri, 28 Mar 2014 10:53:51 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id j17sf17376523oag.2 for ; Fri, 28 Mar 2014 03:53:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=dH2TwKAABSP2aM0EHtKF0UnsiM/1TqL0hhJIj5LtkhY=; b=UDOdhS7xI52ebgvs7AEDpcNinG+0dCvHgKGEUTbh5h4TvaE1YaxmwsGFza/kXAYFm2 O1/QSWrCV72vhuCiDWb/tUs06aqc8v8P3nqVNRBo9oFx9bf9vIDFIq4/5/N4J7eIsdzp 2Pv3jefgKulZXysA9ONDLSHUho9f85kttGMgvh+hphZmKUcvT2MJGVki/YN3xz0YwOkO /9c3Kk9Mj7nu38GhGeppArNF2UMH95cHBcS1OvVyfH3R1sHE5EfwQ6prjeBURs/yvhBy ttoXzDZEARLy0W9/gWxiNf3Dxms3ocFzt/EI5r2H5c57pv5h4aTOXMgKzTgknDYzj0fU 1jHQ== X-Gm-Message-State: ALoCoQmxXfyAkEooOpIYTeRvsU08qUsqn+Hfn5u5pLGWb+m2+oltOEGA5XPMsoB+BuQb7gbuScU9 X-Received: by 10.182.95.68 with SMTP id di4mr3039563obb.4.1396004031346; Fri, 28 Mar 2014 03:53:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.170 with SMTP id l39ls1466321qgd.6.gmail; Fri, 28 Mar 2014 03:53:51 -0700 (PDT) X-Received: by 10.52.173.165 with SMTP id bl5mr5484544vdc.13.1396004031259; Fri, 28 Mar 2014 03:53:51 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id y12si1066449vcn.193.2014.03.28.03.53.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 03:53:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so5474744veb.40 for ; Fri, 28 Mar 2014 03:53:51 -0700 (PDT) X-Received: by 10.58.31.136 with SMTP id a8mr6786877vei.20.1396004031177; Fri, 28 Mar 2014 03:53:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.78.9 with SMTP id i9csp25454vck; Fri, 28 Mar 2014 03:53:50 -0700 (PDT) X-Received: by 10.180.107.136 with SMTP id hc8mr46624435wib.11.1396004030316; Fri, 28 Mar 2014 03:53:50 -0700 (PDT) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by mx.google.com with ESMTPS id ct6si1622622wib.106.2014.03.28.03.53.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 03:53:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.181 is neither permitted nor denied by best guess record for domain of daniel.thompson@linaro.org) client-ip=209.85.212.181; Received: by mail-wi0-f181.google.com with SMTP id hm4so599565wib.14 for ; Fri, 28 Mar 2014 03:53:49 -0700 (PDT) X-Received: by 10.180.100.169 with SMTP id ez9mr46820479wib.15.1396004029729; Fri, 28 Mar 2014 03:53:49 -0700 (PDT) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id eq8sm6002691wib.16.2014.03.28.03.53.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Mar 2014 03:53:48 -0700 (PDT) From: Daniel Thompson To: linux-serial@vger.kernel.org Cc: patches@linaro.org, linaro-kernel@lists.linaro.org, Daniel Thompson , Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org Subject: [PATCH] serial: st-asc: Fix SysRq char handling Date: Fri, 28 Mar 2014 10:53:10 +0000 Message-Id: <1396003990-30228-1-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.0 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This driver, like several others, uses the upper bits of the character to track both real and dummy state. Unfortunately it neglects to mask these bits properly when passing the character data around. This means neither break detection nor sysrq character handling work correctly. This patch adds the requires masking and has been tested to confirm that it correctly handles magic sysrq sequences on ST's B2020 board. Signed-off-by: Daniel Thompson --- drivers/tty/serial/st-asc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index 21e6e84..dd3a96e 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -295,7 +295,7 @@ static void asc_receive_chars(struct uart_port *port) status & ASC_STA_OE) { if (c & ASC_RXBUF_FE) { - if (c == ASC_RXBUF_FE) { + if (c == (ASC_RXBUF_FE | ASC_RXBUF_DUMMY_RX)) { port->icount.brk++; if (uart_handle_break(port)) continue; @@ -325,7 +325,7 @@ static void asc_receive_chars(struct uart_port *port) flag = TTY_FRAME; } - if (uart_handle_sysrq_char(port, c)) + if (uart_handle_sysrq_char(port, c & 0xff)) continue; uart_insert_char(port, c, ASC_RXBUF_DUMMY_OE, c & 0xff, flag);