From patchwork Sun Jun 9 16:42:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 166237 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp69653ilk; Sun, 9 Jun 2019 10:07:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqy68rttkUnz08fye8Cq94hUhHC+7mC/UIjAUT1uaC0N3dqZ+X9y7dhPOPScOOc1cgAbVrB5 X-Received: by 2002:a17:90a:2224:: with SMTP id c33mr16970863pje.22.1560099913955; Sun, 09 Jun 2019 10:05:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560099913; cv=none; d=google.com; s=arc-20160816; b=tHkSlroVTYW2MyPb9Zz7/bLIznvQUMZM677Fwp7VuCucxqT391kgzsFzsyW0Epddmi yQe/HyIvPrurLCXId5efpj5f9DnpBVBkStNIJut8PR1H3MsYzqm38kWnjH2HzdxeXKtc EQu50ewc11CGOVqTCOJUoX5XswHhJEZrr4rmEYjFDdz08zimBKdBLE5345D8Ze6Yef95 TFWwJXFkiJMg7Fr6r6Q1eYV/wG7g5GJ9CoxSYHox/3vY8A75W/mc8GGbo90gvukEFjdz 6OsUpHVPlgc3bUb+bapQJE7AQYmsBeczK5We6EgXSlubEp/Fg+9X32GeIUu6fy1Aeg2Y 4YLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1Do3m0vB/o2PJO50v+EXLbUwPtv/7rQc8xzR1iZp7KA=; b=i54LwT+ZdbmagAEQpITExLAXYcCpUhGD0QEQ2D37i4osiMufqXODGCc/3Glz7St7M0 6TLuOY4WqWr9lT5bthRTLZWXPuYMZhIZobLGJ2zvPPk1y8q/nDMKZMj74/Q1ASI9Nj+a XK5jt+Uy+v9iaXfMsgpvnWOi9ANPR90QvKvJqRHo5gviB5h6yInEf72Zk/3BwkqdWO77 aJSLFTnYdpv93osFlKfCPZHYiE5dHwXai6eBk24oARpJyNRth3wFGXYg1DD/dYrR8q79 UgH74i3qEfsRZWuNyK5lsaWLI/MKsiIs5SsZAJbBECLPZw4CwNSfO6KxXAwfgYxNymQs SPqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OD03GMSN; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21si7621214pgy.283.2019.06.09.10.05.13; Sun, 09 Jun 2019 10:05:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OD03GMSN; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388200AbfFIRFI (ORCPT + 14 others); Sun, 9 Jun 2019 13:05:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:44222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732669AbfFIRFH (ORCPT ); Sun, 9 Jun 2019 13:05:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C4E2C204EC; Sun, 9 Jun 2019 17:05:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560099907; bh=ufoUUvz40p+JRfFWrFlIUNPByU6JsfaNP2u3RKqSqDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OD03GMSNcRQ36QT4QERQlzWRrFaLS1oHlSCg88BnLXO6cKALTb2e0Ov6KPdM3Fcpb YUwbwBo7MakeHCnRaWtrLx0ypus1qAMewfq+l3bYILUINhK8ia4k/c5ZFlmtz3krsw mSUyTjm2d3LNdu6hplMohOiD1h8+a7fWvw1/DZe0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jorge Ramirez-Ortiz , Bjorn Andersson , Stephen Boyd Subject: [PATCH 4.4 209/241] tty: serial: msm_serial: Fix XON/XOFF Date: Sun, 9 Jun 2019 18:42:31 +0200 Message-Id: <20190609164154.690351299@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190609164147.729157653@linuxfoundation.org> References: <20190609164147.729157653@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jorge Ramirez-Ortiz commit 61c0e37950b88bad590056286c1d766b1f167f4e upstream. When the tty layer requests the uart to throttle, the current code executing in msm_serial will trigger "Bad mode in Error Handler" and generate an invalid stack frame in pstore before rebooting (that is if pstore is indeed configured: otherwise the user shall just notice a reboot with no further information dumped to the console). This patch replaces the PIO byte accessor with the word accessor already used in PIO mode. Fixes: 68252424a7c7 ("tty: serial: msm: Support big-endian CPUs") Cc: stable@vger.kernel.org Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/msm_serial.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -703,6 +703,7 @@ static void msm_handle_tx(struct uart_po struct circ_buf *xmit = &msm_port->uart.state->xmit; struct msm_dma *dma = &msm_port->tx_dma; unsigned int pio_count, dma_count, dma_min; + char buf[4] = { 0 }; void __iomem *tf; int err = 0; @@ -712,10 +713,12 @@ static void msm_handle_tx(struct uart_po else tf = port->membase + UART_TF; + buf[0] = port->x_char; + if (msm_port->is_uartdm) msm_reset_dm_count(port, 1); - iowrite8_rep(tf, &port->x_char, 1); + iowrite32_rep(tf, buf, 1); port->icount.tx++; port->x_char = 0; return;