Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2511789lqp; Mon, 25 Mar 2024 00:28:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW9NCgTKXtCysgFODSfRiVew1uwtKnmxGrY3pSPu0VN0zvhd+dhR4O3jV1/H7DxmzMN+OExx/bgsUTii1iO1GlNZ3KSF00b9I1Z7U3Dag== X-Google-Smtp-Source: AGHT+IHyx+kllKUVUwFO93hO50TE1F0e5IAKrF0F38lEeB4mqokjFKOkrC8f13XS00ToQ/jRC1pS X-Received: by 2002:a17:90a:dc05:b0:2a0:215f:dc9c with SMTP id i5-20020a17090adc0500b002a0215fdc9cmr4220433pjv.35.1711351694873; Mon, 25 Mar 2024 00:28:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711351694; cv=pass; d=google.com; s=arc-20160816; b=s/CcJQlcy5crXECMsZdGvkae39s8KnVCCGvETQj9Pb9RwBzVHjqFEJA2xGTWUw2T8X 5iYdCqLAL6oF7XI7IlFhvPdQX3/YvpaB6t57U6OBzymU4qFtepyPKGsPeu3l6715SZsa DEU8QkiNsc2CzcZiIiQEL0qvv6Y7YHogh2cASdHUV338XOzL4ItYEyfXLHlhKJmJFN8C +HHAg8onqwAQKqFRZ3DTY77NZC7oO/4XPtbs/kk62JaPTrExtFADv6X3IcSQFrmFCubc hJxnIX7mpsEjpVg6b05l/JUPsPU2zTwdLsC5J8pw+xzsfOBvCUFSoISRKTnoSBVGtVZ2 16lw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=cyJAO5skgIiBDM0kg43AqM7RtT+GyL5M71KnH7zxym8=; fh=Y0ThenHruESlNj7UiAnHQoxJrEVKS7eQ2jgVrS9yPfQ=; b=YJscK9ZliIYEYnpp9eTq8QpTw0tbO5A/0/x36Y4OtCQsGxQFm9pxtyBtkHnRDkB+ec YuXLeep6VermMf8JOIXhg8s1QkqTeBb1cVZxlg/baslqIN4ZGqrheGzUbHGLVELpcPYQ AiYm9+FRw7edTzkEMixyd78xpD85FJT5be4U4wG0uspsqi6i1DeABTJlKknu/OFmz8PK w1y6uDMzjViKYcVleG5EuHtrDwkbvqUJCVqVU3bGvvDklUS9IDsDj12Fjnwd6kiuGYPb ngoderOBEvnr06hvyr1g6cvmmCq0gx2XNuhevWh0FvW4eoUCqzDZvaIFe8pXF7QT3W++ V/Aw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iCbHsJXv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-114669-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-114669-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id v7-20020a17090a00c700b0029c5f4b6931si7037101pjd.91.2024.03.25.00.28.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 00:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-114669-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iCbHsJXv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-114669-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-114669-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DB7DFB27B59 for ; Mon, 25 Mar 2024 06:23:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 078E32B216E; Sun, 24 Mar 2024 23:58:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iCbHsJXv" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F73815ECC4; Sun, 24 Mar 2024 23:18:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322310; cv=none; b=YNNZ+4zCJjrDsHFbN8+irC7TfeTLMmyt9uV59F91vuCgPl9J+Ri+raapcmcyyJG9Ch9JEabQGNxyxvWFPzDxAJm3MUVZaJcbTbUVjir0gal0KIE8o9C5C/IpQbDdSxofILiXuyOcswqvLoV80dw/SLEsSBTewe3RdRAOCWvOEY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322310; c=relaxed/simple; bh=0tn7JdnpqsNxmICS9PEs5ksvyKLvc9+5NgJKMZwIkTM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xg5S9Uh6hd5Tr7OM0DINShNRLTiU1Wp+/3bcRK47QCjtXrU5StB8XewIMC6xoy4xoG83wHDN3lpxhBCj6g7LdiDRiwgHeOIPZLd7p3YKjrHximnZH/gy/eZEK+LGB0CP6ZufBsDJPCJhtIS1BBXPnYXuiwaC50Lkh82nl9Q6ILA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iCbHsJXv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70275C433C7; Sun, 24 Mar 2024 23:18:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322309; bh=0tn7JdnpqsNxmICS9PEs5ksvyKLvc9+5NgJKMZwIkTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iCbHsJXvEFU3nGOqZZpH1J+BsWRa5xO2j/CJILQyZQW2HSKcaHmzEU/zGIVlarohp EY5t6uqcDhJ7J/8QeFkjGOk35xhv0KoWz+z8Ucej3JIZOgbTBtnW0pGQnrpPthaA+C MAbpf/RHcRCzvPlVhRe67a24XTtkQlFAUEerjVL1e1FNIcM2iDxCDAOFAikELmqEGW FVlJKOFsmFR3JbyOGUKUbx8tT6XadKgeT/szwS6j0ykHZkRuUoo9gWGbN93gMVVEoi 6HzqyNWz4r8zMek2QCs2lZT7zeFSlhZJ+tQq1hpu1DlLFg1wy2VQrZTgmU5OkkW12l CSSyZfyr9xf8Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tudor Ambarus , Sam Protsenko , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH 6.1 392/451] tty: serial: samsung: fix tx_empty() to return TIOCSER_TEMT Date: Sun, 24 Mar 2024 19:11:08 -0400 Message-ID: <20240324231207.1351418-393-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Tudor Ambarus [ Upstream commit 314c2b399288f0058a8c5b6683292cbde5f1531b ] The core expects for tx_empty() either TIOCSER_TEMT when the tx is empty or 0 otherwise. s3c24xx_serial_txempty_nofifo() might return 0x4, and at least uart_get_lsr_info() tries to clear exactly TIOCSER_TEMT (BIT(1)). Fix tx_empty() to return TIOCSER_TEMT. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20240119104526.1221243-2-tudor.ambarus@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/samsung_tty.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index aa2c51b84116f..589daed19e625 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -996,11 +996,10 @@ static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port) if ((ufstat & info->tx_fifomask) != 0 || (ufstat & info->tx_fifofull)) return 0; - - return 1; + return TIOCSER_TEMT; } - return s3c24xx_serial_txempty_nofifo(port); + return s3c24xx_serial_txempty_nofifo(port) ? TIOCSER_TEMT : 0; } /* no modem control lines */ -- 2.43.0