From patchwork Fri Mar 28 10:51:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 27250 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B532520062 for ; Fri, 28 Mar 2014 10:51:17 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id rl12sf17117914iec.6 for ; Fri, 28 Mar 2014 03:51:17 -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=T5pOtMKCsMkP7WbrnZ66pn15WTbK3Apm7usfqG7msmdSYfuuM/8cFIwKUEg1Voc4c+ 1WBIjIJPPINRKwkZ01PREYaxeiYv2jEpALx8OewHc6Bfj5lRhKsRGeRDTb7lgwCI2n6F tN7KFBJThguX2HA9HS7tztSXT9G/n+qvZJPm1xE4gfGzT2/evwaZyEQ+dJOd0Z0aq2Ag gppWwOUcgMX6QAkOXkzsKa0q1aynYlnFAFqjqgT2d/jwAKMX99znx3VMS718TWdWNoBN sTojI4iwR/d86xTLhfTUdZbkkIn0qxPMV7HV/1af5fiiWhb7ch6ZuygUyX6Njiq+b/IZ V1zA== X-Gm-Message-State: ALoCoQmZCKay/AwDe4KWyG+i4EUxB6ty1Dd55pvh81Hwq74fmpeskSKFLwEDLTxGTAPz/8MEzSKb X-Received: by 10.43.4.4 with SMTP id oa4mr2524127icb.2.1396003877091; Fri, 28 Mar 2014 03:51:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.117 with SMTP id z108ls1437086qge.51.gmail; Fri, 28 Mar 2014 03:51:17 -0700 (PDT) X-Received: by 10.220.12.66 with SMTP id w2mr6423225vcw.15.1396003876974; Fri, 28 Mar 2014 03:51:16 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id sh5si1172446vdc.122.2014.03.28.03.51.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 03:51:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id lg15so5767371vcb.30 for ; Fri, 28 Mar 2014 03:51:16 -0700 (PDT) X-Received: by 10.52.241.106 with SMTP id wh10mr5494795vdc.16.1396003876904; Fri, 28 Mar 2014 03:51:16 -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 i9csp25331vck; Fri, 28 Mar 2014 03:51:16 -0700 (PDT) X-Received: by 10.180.96.66 with SMTP id dq2mr11491178wib.54.1396003876116; Fri, 28 Mar 2014 03:51:16 -0700 (PDT) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by mx.google.com with ESMTPS id r9si1651115wij.9.2014.03.28.03.51.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 03:51:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.170 is neither permitted nor denied by best guess record for domain of daniel.thompson@linaro.org) client-ip=209.85.212.170; Received: by mail-wi0-f170.google.com with SMTP id bs8so602964wib.3 for ; Fri, 28 Mar 2014 03:51:15 -0700 (PDT) X-Received: by 10.180.24.227 with SMTP id x3mr11501165wif.41.1396003875295; Fri, 28 Mar 2014 03:51:15 -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 fo6sm6045435wib.7.2014.03.28.03.51.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Mar 2014 03:51:14 -0700 (PDT) From: Daniel Thompson To: daniel.thompson@linaro.org, linux-serial@vger.kernel.org Cc: patches@linaro.org, linaro-kernel@lists.linaro.org Subject: [PATCH] serial: st-asc: Fix SysRq char handling Date: Fri, 28 Mar 2014 10:51:12 +0000 Message-Id: <1396003872-30188-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.220.171 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);