From patchwork Fri Jun 7 15:39:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 166162 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp802693ili; Fri, 7 Jun 2019 08:49:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjG/Xw6lXGkBgopqxKw1KFIoGMF+TfJVPwW+hBMKPDTxu7belIyuTdJBFjeuy1EFdAhbIF X-Received: by 2002:a17:902:ab90:: with SMTP id f16mr55303494plr.262.1559922540746; Fri, 07 Jun 2019 08:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559922540; cv=none; d=google.com; s=arc-20160816; b=WnexchTLXQfb48e9a3ckC6K5xjPNFHCe3UNbv7h27va4Eg9DNZMYUpLiew5mLKpyup NJ4FCjCSwDZzP4ZKSpw3f1JI8QZy0rQXDCN3eHWItclocV18LialVSmghd6ZcMUsvnnt mp9WaZnFMwFr3dos0e1vVGnVZoCj0qRsO40bUo6ma8M3zHZhj0KK1RoHuTUS7K6a3l/6 hpGSfpqxp3JfZ3opHZ3KLl6RHQym+FEZo+a8Zh3gE0x3MdCtTa0i2I09QssUEKDGgxeB Q66diUlFWb64N1D2pvOq9rLWktCRkj5+WiWGZ+Sp/vcb1cIP3ACg+QwsAnGFIGqtakol 3lDQ== 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=fbliiaENZhdgQIe/6Oy4g6j9XVwKj2jrxFMN3TZ0zVY=; b=SEEB7hYQmQVUTUYBuFtef+WKApGyf8+hgbcu9S0Nv1AdzqsfuSnD3stHgfKuHB2XxU hZxk1D+zB992LIfhe3bdBii8em+KrkXdgZ18SdMyqU4S/vnkJKBI3CCldRODxGAwfuTH 6rgFnhIQOnZraVK5ny5RWgb6MV8sU9z7r9YcMLGkhsJ0hfZvsoHAUN3Ggaq4zFKHRj9u IbnvndTqXs/MFtzB5gkaeIe951U1T/pEXZVV0ZoyZVsNI1GkFRNWg/7JDM5xHeZNuoxQ i3FpgkkYFX66vvKJTJEqaskntizEwWJXNoFWOQuzxgFKuLBqmMyXicVKMvhzIGjllyaL 8R5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=twolFrTc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 cg6si2427994plb.350.2019.06.07.08.49.00; Fri, 07 Jun 2019 08:49:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=twolFrTc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731866AbfFGPs7 (ORCPT + 30 others); Fri, 7 Jun 2019 11:48:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:34376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731854AbfFGPsv (ORCPT ); Fri, 7 Jun 2019 11:48:51 -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 9088020840; Fri, 7 Jun 2019 15:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559922531; bh=qsBYCJp0T9BTNFdojWwxp9gA8fp2Y3KEZMWRQhokJBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=twolFrTcwe3XRwuvPYoWqy39Am+u1ABg6xmrS+RHaz6zgO/hnNyDPDd2+giSa9Eoz dOW1yS2oRmonHk/VSvs3CbpddaSWg/7tTni3WZ27l5cY92NsFfxKb0jg3Hn0ourgng fdYDrsPd/bTkhALkpJu+S/gXR/k1E6SKFoOlyvN4= 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 5.1 46/85] tty: serial: msm_serial: Fix XON/XOFF Date: Fri, 7 Jun 2019 17:39:31 +0200 Message-Id: <20190607153854.732886196@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190607153849.101321647@linuxfoundation.org> References: <20190607153849.101321647@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -860,6 +860,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; @@ -869,10 +870,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;