Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1936718imm; Thu, 24 May 2018 03:13:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr/toK3zzHUSpftBVmNmjaN4gP2nxLjj6vWJoNBQ75RkWsrrwut01dQE72vhAfzuFsCxOKB X-Received: by 2002:a62:1e02:: with SMTP id e2-v6mr6632422pfe.212.1527156816251; Thu, 24 May 2018 03:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527156816; cv=none; d=google.com; s=arc-20160816; b=GwoKLqlL9ypMOXLKS+rurAW3e1zX4br0Zvzffc+jYbj6Gu/R4TcynCCBWF0Hp2mh22 yRZqKV/siYj9r6Boy/k0EgGebN2Jl6JJLUSCxR1G1Xh6hdfVdI4etnMLv2HjjAsOSJk8 AN8uGgsFm/MK7hsbX+XRRnjmq8n1nnVDGkLkFHD7pZG5fcRuECxGFDsFoL8Ym3ly6Jc5 qImgTxYaboiQoKQlIugGyakoCxDU/cCGRigCHz4Z1yJMfDGJZNwbeB6h5AKQncPwwyRe sFOm4D2P94wWXlkZO+wYZxShTKXdB4JES5BdQNiDimvjXTamUAOCgOxikLGbiE1OD8fc J/Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=myfi9ZX1aton/ZzXK33vFSMR4qGH9WrkpJ+iqPjjsPc=; b=Q4xefLg94m8HlW6MJC8zGQedwUhEDe+Gy4DSEO3jp0WvdTznCy08M4QOoxh20MvVfj o1UhB8BRSEKf5Ox9TTXnI41DzrPazqOtwxYMi1h/p1nCVop29ksHJYXIFFGr5CpWgtJe D3BalCFS+HN7AlUm3qmHp6Hy0DOEXlWROmY4BdD8kz7t992LY5JPGXEWN1D3Zq+ncgxi 3x2iFesSTk4D/Y6nuVu084cR57g6N3BDuXwv8yM0GB58xd6CCw2w7yglNqQKly1gFOn5 ejiwh8DDPYzy9Z0YcZmPeLyVB7IvciUnKt7g8ZU9AQANMWvETVprPIZtfuRyO70S3p9G yvjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Gfz1B1yZ; 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 g77-v6si20931266pfa.304.2018.05.24.03.13.21; Thu, 24 May 2018 03:13:36 -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=Gfz1B1yZ; 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 S1031826AbeEXKLX (ORCPT + 99 others); Thu, 24 May 2018 06:11:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:54538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031576AbeEXKFW (ORCPT ); Thu, 24 May 2018 06:05:22 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 007D120893; Thu, 24 May 2018 10:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156321; bh=D+FubTQaIYkL+xFs+M3vOZ5ZVL3/JlkrKlIp9365Ffs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gfz1B1yZxIv0M4tz+hj+A3u/2rPZpOLySDWBzoQ4nNqg2KlbArvtqCoC0fpNcoXXp r69M3RAjsB20uQeZ0BPD73M8Mwsrc3dNMK+IMPdh2d2dra1lyKYOyqoxSLVdxIIjYO 9kUEX3Xz9xbst3icbLP4332/g/xfYHFrr8qb1pco= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miquel Raynal , Gregory CLEMENT , Gabriel Matni , Sasha Levin Subject: [PATCH 4.16 145/161] serial: mvebu-uart: fix tx lost characters Date: Thu, 24 May 2018 11:39:30 +0200 Message-Id: <20180524093035.718574153@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gabriel Matni [ Upstream commit c685af1108d7c303f0b901413405d68eaeac4477 ] Fixes missing characters on kernel console at low baud rates (i.e.9600). The driver should poll TX_RDY or TX_FIFO_EMP instead of TX_EMP to ensure that the transmitter holding register (THR) is ready to receive a new byte. TX_EMP tells us when it is possible to send a break sequence via SND_BRK_SEQ. While this also indicates that both the THR and the TSR are empty, it does not guarantee that a new byte can be written just yet. Fixes: 30530791a7a0 ("serial: mvebu-uart: initial support for Armada-3700 serial port") Reviewed-by: Miquel Raynal Acked-by: Gregory CLEMENT Signed-off-by: Gabriel Matni Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -617,7 +617,7 @@ static void wait_for_xmitr(struct uart_p u32 val; readl_poll_timeout_atomic(port->membase + UART_STAT, val, - (val & STAT_TX_EMP), 1, 10000); + (val & STAT_TX_RDY(port)), 1, 10000); } static void mvebu_uart_console_putchar(struct uart_port *port, int ch)