From patchwork Fri Jun 7 15:39:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 166168 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp809396ili; Fri, 7 Jun 2019 08:55:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOLZRXzPXPV3JNdlx/KUXISR9U1BUFeF59/IbM6XeycmKHcknSS12/i7HAHbdh2hvNN2jx X-Received: by 2002:a17:902:8493:: with SMTP id c19mr57519437plo.58.1559922900325; Fri, 07 Jun 2019 08:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559922900; cv=none; d=google.com; s=arc-20160816; b=exPfsQtd+RiPEkGYeKDilRxHW2vK1MH77J2extjab9HfnMy3FphDsyC8NkIT89drmB bRmOjtvQoculDbDhxxFC1m6HwzhFYWwOU1GeYcg2zwWGK9mLedm2DMEorEtiq5V7QJ2Y RJ7QieBU7OWNLNVy+8zYI3U0ddMOcLvntq5HemwbkgwZZ+yXYk3FjZdDqUHdOfPc/gPI ahvFut9N5v9fWIFT89R5Xmml+BcXwMFLDPAppyz0aXymkb1T959NONzvgtPz3aQssiYr JPBoyqOeFR/qzm8cm1gThq2JKr8EsrsKQYDfrtNp+GSvN6i0GpL4aq3T4FbBQwJ5dTy2 vr1A== 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=v0aA/FtRl83iFc5hBHGp1DG2CN5NtxvP3Dj5tPyGlt52YrZznkYnWLWDclPrGBvfP9 gdBfkt+j/7IZfyGl56gKjCXp7DXXIESP14xLmcv3XUzT/aFUXMh83zM2G2VPrQFrYwzP 28rQQnBG7dUtb0TxjJtVJ2XSZ5SHcXTgUYY4SmZ/OyzfQ6nTGE2AjfkUd0V80rbylanW FBY9YEX6EosQavtDJ8MBj0hR5x40Ds8SJcbjXDTNaEQqsgiSvjPlnk0cU2RmaqKlR5HI gGhp2OXeM6IYxbI6w8QTg/O9atXoiUYHcTCwn4mHHDfleQlPZ5Rl7ecyoDqLlo3m7JrP QwHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gk+LgiKR; 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 r129si2145124pgr.307.2019.06.07.08.55.00; Fri, 07 Jun 2019 08:55:00 -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=gk+LgiKR; 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 S1729293AbfFGPy7 (ORCPT + 14 others); Fri, 7 Jun 2019 11:54:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:58514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731368AbfFGPqR (ORCPT ); Fri, 7 Jun 2019 11:46:17 -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 B733A2146E; Fri, 7 Jun 2019 15:46:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559922377; bh=qsBYCJp0T9BTNFdojWwxp9gA8fp2Y3KEZMWRQhokJBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gk+LgiKRNRt+iUv4U1aiyzYP65+AGh8BXx/id6KwS6t1okJdtgkgOx5oeUCSMT2wk 6MVHrvafVD1Kkr2s9ZhfjN+f2jzP8uisTOKMkW+5xX6Ji91VRxy1TsTqr+79JyzsX8 pbhg1SIck1qUocwzcwt4dhjTdcCyBJ0+HAWOT6Es= 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.19 38/73] tty: serial: msm_serial: Fix XON/XOFF Date: Fri, 7 Jun 2019 17:39:25 +0200 Message-Id: <20190607153853.392889944@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190607153848.669070800@linuxfoundation.org> References: <20190607153848.669070800@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 @@ -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;