From patchwork Mon May 20 18:38:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 164666 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp627327ili; Mon, 20 May 2019 11:38:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXOSqponJcy4zPf1S/Di6+wi+OvfrhvCNVsnwSggrBaHZtwiqg+bWMAF1eKzItPlMQZPDi X-Received: by 2002:a63:1701:: with SMTP id x1mr76948605pgl.153.1558377534978; Mon, 20 May 2019 11:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558377534; cv=none; d=google.com; s=arc-20160816; b=swckbIF7WLMWX/WLo80JAJHbvH05WOY4wvP0RkJgo4ARN744dUfHHT3VGDpmQT1Dgo APvy1czYkbdzcx4H3xMNDxRj70p9JuE1kGLb1mMDCQnzslHUdv6BvMbiAf7QMwt+FzG+ +MLBPzLHzUh0ksuBQnyBlbLYOkYn1vUnl1nu44F69fjBDc89aDIZAw4mB/WzsSctO3q6 kXxgLzlQUq+ge1ntPegGpcNk76VQvm6LoUqLEk5o1cGfq6iZ6l0HIfYqSex1QUJBCP0Y O4M9ZCQlC9BHRFtdr7KOmL8cqQrnS1fRo1QXDVVY1q03D83BNDaR9sMa/H6fJUbBMkM+ AhqQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=QefnsvwV3d7y65V0/j2nW7pHukGB8D2WmP+WVKnMlIQ=; b=1DiPnknKF0wQDW4q2vWMOok51SVfq2F0Zu9vfo0hNdaPm3ZfDu3fSCDH9VRlQmokYj KsOdz/z/twLtjh2R20eCubGa3qidytdcbxodX10cJfONIK+lPS/ht7p8/OfFErMBO9uh cM9lJO/tYYAEzqqRkzBe077DLx3w7ZurMycIfI5imgCZhj4AJv6GgjndeGq/o0p1R3tB 05F8XjkX5W7/SB+z6ldzJLN9QdhLv6NpNWQM6X1FUMLMLza6+mfY+hT1DoEYoHCsf9me bZE8FK3Zsgus9fWe8KHTCssP7BSBojb25i0rThy5mFmVU0hLUUYRhCFBo+SJwcXYzg03 9aTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KBECxKjG; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11si3147492plq.169.2019.05.20.11.38.54; Mon, 20 May 2019 11:38:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-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=@linaro.org header.s=google header.b=KBECxKjG; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726049AbfETSiy (ORCPT + 1 other); Mon, 20 May 2019 14:38:54 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:33196 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725468AbfETSiy (ORCPT ); Mon, 20 May 2019 14:38:54 -0400 Received: by mail-wm1-f66.google.com with SMTP id c66so569369wme.0 for ; Mon, 20 May 2019 11:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QefnsvwV3d7y65V0/j2nW7pHukGB8D2WmP+WVKnMlIQ=; b=KBECxKjGA5xCv9a1o+snOgsUUJD68d0TAtUrPBibx++X/DXEjQy3l4l7REcbRK12dj CsbMf9EC4kQZ59sWHbglpE0OAMt05ZiaskBpgo1OymMjBWPFFI09+ecDdv1PEdaYsrYx JKFLXoxhfmMxvzYQHuUdBiyVpc1t2MLtOdGWdUjYMIREDZ5k1Dfct0RP0um/pCvPkeRz L+6Dingo+H2gBtH/bbv2UVddT/O7O1Set1bW5di+N62iYRer8ejVVOhFEg0qvLjJV8Go X/DGqMomCd9JvcmgDakQkvA5z/N6BmhmOekxyo0oBBBR8PenMpi/u8GFH+kUSuG0M+4a fuBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QefnsvwV3d7y65V0/j2nW7pHukGB8D2WmP+WVKnMlIQ=; b=loBTxRQEUttr+6rN2ED4IjQ36Xs1lvJFhFJrIbYWdR96iTHxpFy5hZVlUUUauUt4Nw rLSlDPimYSf+ZAMU8kO0nV4rHAQrempiHzCMB/8B9kDN8lP9Tg8iWT3Z/nLph+Feq22F Dd9oQR7z/wHaajJVTGhPRkne9T1qFxkQxrruACOfdU3U15jdLkbB2RAtp6coryp/0Vgr aXd2GiL73vZa8XNpCF10pLJNjnZi/02O+cI4hJiyUXY7i92yJjGgczoAsZLEdqqneMb9 nDeYX7fsFBw+IGM/IrorhQQ/zw0ikN+AXrHnSGi5ccsQgJOeuXa8uYkeGBjQ6MCt3VYB jW+A== X-Gm-Message-State: APjAAAX3wMNQIZ5tgJ8r2AHkUZ5p3jGuktV1ndRhc66pS+wUuIAzQuAe J/GbjtTZPnWKZZ3eA6xHe26Ucw== X-Received: by 2002:a1c:2c89:: with SMTP id s131mr378016wms.142.1558377532506; Mon, 20 May 2019 11:38:52 -0700 (PDT) Received: from localhost.localdomain (139.red-79-146-81.dynamicip.rima-tde.net. [79.146.81.139]) by smtp.gmail.com with ESMTPSA id m13sm17332790wrs.87.2019.05.20.11.38.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 11:38:51 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, agross@kernel.org, david.brown@linaro.org, gregkh@linuxfoundation.org, sboyd@kernel.org, bjorn.andersson@linaro.org Cc: jslaby@suse.com, keescook@chromium.org, anton@enomsg.org, ccross@android.com, tony.luck@intel.com, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] tty: serial: msm_serial: Fix XON/XOFF Date: Mon, 20 May 2019 20:38:48 +0200 Message-Id: <20190520183848.27719-1-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 --- drivers/tty/serial/msm_serial.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.21.0 Reviewed-by: Vinod Koul diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index 109096033bb1..23833ad952ba 100644 --- 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_port *port) 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_port *port) 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;