From nobody Fri Oct 28 19:20:50 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MzXSy5fckz4gsjt; Fri, 28 Oct 2022 19:20:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MzXSy4y3lz4HSS; Fri, 28 Oct 2022 19:20:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666984850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l2NYDYZ2/VfuaJz0KjDUNZWojz/rPe0QLA0o6ywl6bc=; b=a1+xBkYLuCa/x8Z7TcAp1TjnMsiIsZbYITHUH9V+an1hupLXt9lTp/NJR+WtxhigKbmRSo tfKG7YU7JpgeT7WfIUwn4rAhBtT9042UorhdxFWovLGO5yc4JfivowGhJIzUJJsk9JBSiP 38gBdA17KwgIqw10sQTF9zvOVNun26cDic/SY8t16az5sVyoQz0g/WJRxXoC+2f09UNFe/ 46uDw5HQ02e337T+OI8+QljuRahxCyFOojAeWu7o8ECcfkR7CebWnycVEgezUkU+Am0ZyA C47DLH/LDyHh7kCtdeyQW1TdCIwaOd7BPU9JxS0XUy1J8wUWabeR9id3yZaBCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MzXSy40Rkzpfl; Fri, 28 Oct 2022 19:20:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 29SJKor7077601; Fri, 28 Oct 2022 19:20:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29SJKoti077591; Fri, 28 Oct 2022 19:20:50 GMT (envelope-from git) Date: Fri, 28 Oct 2022 19:20:50 GMT Message-Id: <202210281920.29SJKoti077591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 5ad8c32c722b - main - ns8250: Fix sense of LSR_TEMT FCR check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ad8c32c722b58da4c153f241201af51b11f3152 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666984850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l2NYDYZ2/VfuaJz0KjDUNZWojz/rPe0QLA0o6ywl6bc=; b=gLenoNuACKRyHJtd70OCgnCdH8Z39KDcBAbVH/PID7EeLRLmG5QHHZfjnTCrUqesUrM6+D L6+zupDhyltZm3koQwyy8pO6VgYgZdvsXqCgy9oJQBP8iqzfHwrOr3B4yhsyz9LAw13rrW Rl88heLP0ADXcPnANEq4iq1T+YyJpoMxL+Bi3F4MEB3otsY0GPJXAy2BIvWO7HPTjFw2ZH JEXS2HT195ySwnOCG81hAXhsom3SgSr3mRbkd20YNPBRDE6TvFVXXCzpWT/FoSHVBd9/Y9 mi0HOhFpiOknZxX6GDIRqYBQSLnfsoNgbd3quBEZA0mvSWn7dDKI1PQZOFSPVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666984850; a=rsa-sha256; cv=none; b=FESf2/mYZUDECa984O7WF1ajFQTYtvySymrNbnfsbrKTP3mQtaNHEPjnGTOe0wVB/doH/V SLL5SwIlAxwBKbTaKyDrDWJT63gOPJANUHSLLJly9UiWiPQK57h6vt2VaQU0TJCkTWfXXx VTzBro3E3JEL82guspoXfHnSYn6FzjPaynv883dtSjhCh2fQjY1E5BazuRFwp6hzWxn4Vf puklHrTb53dzl6Hpyj9+/OmfOc4VWiqc0BDq39RHvWN7YAy7GSgA6SywVv7JHVzidsyAmT xrwnKSAmD5aWnBZcISr27RClsWwcGDjGJhgSl4+CqJSzGkUo1tRTgpF2pphu3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=5ad8c32c722b58da4c153f241201af51b11f3152 commit 5ad8c32c722b58da4c153f241201af51b11f3152 Author: Colin Percival AuthorDate: 2022-10-28 04:42:44 +0000 Commit: Colin Percival CommitDate: 2022-10-28 19:20:28 +0000 ns8250: Fix sense of LSR_TEMT FCR check When flushing the UART, we need to drain manually if LSR_TEMT is *not* asserted, aka. if the transmit FIFO is not empty. Reported by: void Fixes: c4b68e7e53bb "ns8250: Check if flush via FCR succeeded" Differential Revision: https://reviews.freebsd.org/D37185 --- sys/dev/uart/uart_dev_ns8250.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index d0eadeded943..475ab5d4425e 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -232,7 +232,7 @@ ns8250_flush(struct uart_bas *bas, int what) * https://github.com/rust-vmm/vm-superio/issues/83 */ lsr = uart_getreg(bas, REG_LSR); - if ((lsr & LSR_TEMT) && (what & UART_FLUSH_TRANSMITTER)) + if (((lsr & LSR_TEMT) == 0) && (what & UART_FLUSH_TRANSMITTER)) drain |= UART_DRAIN_TRANSMITTER; if ((lsr & LSR_RXRDY) && (what & UART_FLUSH_RECEIVER)) drain |= UART_DRAIN_RECEIVER;