From patchwork Fri Jan 19 10:45:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523575 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE281C47DB7 for ; Fri, 19 Jan 2024 10:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rcBe7QnEPD/ua5kQheT/+eL7mQAVX6rbVhF2y3AhGjU=; b=N/cPk3Yt5Fqcsm DG/DUqXoBUxPMbFRPublYYSXmB1H3w72JOk8uMfJgYo4MXNCZY60SCuzhAeqpUF2ddocLuNnkzRe7 wfKeA41+Z0WCGdH3selWTwJe5LD22slTigIK35HM7x5RK/yI98HEiTJAv3jUqUpWNTLz7mhoALHtb iTTKnRpox3LWooN/eyHEUtscBUvjl+EGgBJnnEAkR4Gg8GkSi8YFzStb9WIrfvoXuo4/DG+xJwyxT HBxQgLYObvHWdIuziuOHMpbM0FAC4UnKJMaCsTSsJJYKIY4QSVaxM1ocGfzOSHFQW926lXnh60fxN Y4bJM+pi4McnykD4ISTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNd-0057OC-22; Fri, 19 Jan 2024 10:45:45 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNS-0057Hn-2I for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:36 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40e87d07c07so7155945e9.1 for ; Fri, 19 Jan 2024 02:45:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661130; x=1706265930; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4JVTKruPLtxL591cRzZcEtaSDrfblTI6Ru/0UXyWKbE=; b=tmAvBg/mtkimcnFoIi9LJKsHC55ZA6I5scb0Zb/Wq5Aj0rmbtc4ZrCbyn7sxlGFkPl /hGBdSU0xOGoMUH88RaLIOd4XwvliQdQOF3PMKwCTcOiVcaMrcYJxj5tA52EXcPLY8Nb ncLsU0IB9ZemGAdW5jEt5UvU8VbCBgiEGWDV4eoctxyuR7gbODy/QWcvvrO/hqPkaAnr H4Gcj7/NCyoHgzjnr1coNQ/gKSpvOJ8uP9QDmb8zM5LzYVnaMvfjU5At1Y85a1TgdSDU O75XEI8/2APMsq+NJjj0M/KazfPE8g1t46nkUvQzAvVyt5Cs2lJtEwCME0k22Lh8zSTT mYPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661130; x=1706265930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4JVTKruPLtxL591cRzZcEtaSDrfblTI6Ru/0UXyWKbE=; b=wRtEfbdmdFKdlQAPwtCP5AfrsjUJBm8mMrwA3kPDD32wPmb7bVHuya+08uP1VibpAu A5QOk6etXVDt0NtwmWzCMojTAjL5H3kgIWcIuelqW3AGs5gnjuIfS9VOscV1pp7HzeJW E3lha6w6Y+ve25TuaxeS1zFsQGm9BusSmN7ygmknGCS7KOFsVyqWB77+UmPyFKLvaEfT O5G3MmtNfxe7cHPcmd7E7QQ58WrWpP1wyYCUjNjV+WOqJwphK02yAgK23uFzAIiFeeK6 1RN8cyCcDqvTFrCb6BZi7C68BO98COmQd0ciduJyYl/TX///WyL0NPPZhh7SCSZUD+9C yZKw== X-Gm-Message-State: AOJu0YyagvnE74993Ve19skBSvkb/hHYud+n/ndsSxRB98fv7X4Ppp4Q jO3eygS35X62viTK9ImERunD/VVo0TSdjPNm7kVe26vU5P8YptB7665HjdbYPfo= X-Google-Smtp-Source: AGHT+IF68W0CE7/RmrCIDeyTMK59Z+AGRACrkjEoAPxJPcDwNgTNmegWpv1XXTv4rh9h1rjoCKS7Hg== X-Received: by 2002:a05:600c:5106:b0:40e:9699:141e with SMTP id o6-20020a05600c510600b0040e9699141emr932166wms.54.1705661130155; Fri, 19 Jan 2024 02:45:30 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id fm16-20020a05600c0c1000b0040ea10178f3sm77470wmb.21.2024.01.19.02.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:29 -0800 (PST) From: Tudor Ambarus To: gregkh@linuxfoundation.org, jirislaby@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: alim.akhtar@samsung.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, andre.draszik@linaro.org, kernel-team@android.com, peter.griffin@linaro.org, semen.protsenko@linaro.org, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH v2 01/19] tty: serial: samsung: fix tx_empty() to return TIOCSER_TEMT Date: Fri, 19 Jan 2024 10:45:08 +0000 Message-ID: <20240119104526.1221243-2-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240119104526.1221243-1-tudor.ambarus@linaro.org> References: <20240119104526.1221243-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240119_024534_749391_825E75DD X-CRM114-Status: GOOD ( 11.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 71d17d804fda..6fdb32b83346 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -987,11 +987,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 */