Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3922942pxb; Mon, 4 Oct 2021 12:44:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVQul4yG9B5NqXwUMkjNY+TVH+btmIXZdYJ+bipzo0MFmVpiUnAs7LWU4rp56gbnLD3WVG X-Received: by 2002:aa7:dbca:: with SMTP id v10mr20387242edt.280.1633376656635; Mon, 04 Oct 2021 12:44:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633376656; cv=none; d=google.com; s=arc-20160816; b=Dv3L+o0b0+8fhUEO8D/oHqLO2YgOtZeZ8jr0z77/0VT8AUAcm7foNHquoKYFD0bcMh Dd0g7qTgx7drEfWFL1pRyw+MsTHCN/pv6vMCTVWNAzG5JVCWvpPEhZdBH455BlIUaFdT tzX0UIkDYlyw4L3DrlylLg9gX9cJyG6bzTiH34PTwuGg96B+o53cdnx1cGdE4WdK7Nwz Z1jMi/vUBTBD7OFSVg+aAXkKoK1I4XoffVkDyHqO+iKeG0QE1d+eXh63Mh9RoZGxAxhF Xjvxk8Epy6Aiihs5tBCcVyP1R5qIlC18afkruHiJftN1C1q7Qg/Kg1AqhEqh1DV3J1Tq ddWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=peDDMd2YPWCujZXUqKeO5CaB9P8XYxuXwDK5bO5VB7Y=; b=HESBw3ivrw8oIJW3zOeKVEQDhLoXET5IKc3hw9GgLzBCDhUq6uKt250v9fmjBWCRFV 2tM6OtvFfRU+y8DkuBOPKFEVuVbhfjhYWY2r1KzgdIjqMdfhZsEhHxzL2gPjip22Y4YW G/Bv3eRms/m5ApbkKRSY0PRZcnZruDPmizjzpWo27Gn2Nu6MFix3useztqLBz82iZE3o fXh36uoZ1PU9zw42DT0zzTEqIFysNY0Qgz89sSqZ3W5dPBhz8Di0JBnISHfX7nxN1T+A ZcPJx6/0YG/DKRfO08Nf2U/CC9GmFCbrsj6oskgXDUSkeUAYX7kQhje+l5Mpkhim4BjH tYhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lkivtzh8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si3276503ejc.61.2021.10.04.12.43.53; Mon, 04 Oct 2021 12:44:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lkivtzh8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235800AbhJDNJm (ORCPT + 99 others); Mon, 4 Oct 2021 09:09:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:39810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235193AbhJDNHv (ORCPT ); Mon, 4 Oct 2021 09:07:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E6F5B61A35; Mon, 4 Oct 2021 13:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633352515; bh=0dN88o96YP0pNo+/81dDK60JmrHL0hbAZ9I6xHd91zI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lkivtzh8JuaCyQpKgcz7zTjYzHq8ICuXaa7Glw6zomSRUUimHhzX/eI1Q/5sDRsBT aSlK++bNqJcD1V4mi15xF5Uwr6Ny6H/J8AHhjdDhmJNswHmg39vae0D+BeMrwOEjX4 +Ldznj7HaZGCEEkERB9Ko/vHqR1FK0I8Uy0Qz2Ao= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH 4.19 17/95] serial: mvebu-uart: fix drivers tx_empty callback Date: Mon, 4 Oct 2021 14:51:47 +0200 Message-Id: <20211004125034.119664731@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125033.572932188@linuxfoundation.org> References: <20211004125033.572932188@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pali Rohár commit 74e1eb3b4a1ef2e564b4bdeb6e92afe844e900de upstream. Driver's tx_empty callback should signal when the transmit shift register is empty. So when the last character has been sent. STAT_TX_FIFO_EMP bit signals only that HW transmit FIFO is empty, which happens when the last byte is loaded into transmit shift register. STAT_TX_EMP bit signals when the both HW transmit FIFO and transmit shift register are empty. So replace STAT_TX_FIFO_EMP check by STAT_TX_EMP in mvebu_uart_tx_empty() callback function. Fixes: 30530791a7a0 ("serial: mvebu-uart: initial support for Armada-3700 serial port") Cc: stable Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20210911132017.25505-1-pali@kernel.org 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 @@ -163,7 +163,7 @@ static unsigned int mvebu_uart_tx_empty( st = readl(port->membase + UART_STAT); spin_unlock_irqrestore(&port->lock, flags); - return (st & STAT_TX_FIFO_EMP) ? TIOCSER_TEMT : 0; + return (st & STAT_TX_EMP) ? TIOCSER_TEMT : 0; } static unsigned int mvebu_uart_get_mctrl(struct uart_port *port)