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 */ From patchwork Fri Jan 19 10:45:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523576 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 0832CC47DAF for ; Fri, 19 Jan 2024 10:46:15 +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=4LAgJteBpw+UR5PvUkujASfduRK83TM+6T6JoUjGMUU=; b=uuxe3DPFmALLtZ qTQscbLeU6vZJfycvf/kKbsxC28yZnbTbHwvAielGCNw4IZ9/Y41ck27GrUcRYxO0k5APl1/0II8I M6X4oQT5yxtYAHch7JPL8ecymp5tT7J0QHcApWZcT4MYXIYtCSFUCfmYWJxzj7LQRWw1XR/CxtoaS fa9iGc+IDBpKkBJs4nAo6DtrMUaVTdfzXvlooFVzKq8A8I18k3EwNUsArlDNlWH41fLDGc/x2UL4V foQQCG/xVb7WTXEwrJ+b1Wk/ZNsL3pK2K8jp5vOBbJfEbJf6MkI6a8C9qQM2bcd7d8BQX0VDhvEbA g03OR2M+UpOqPt9LgS3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNV-0057JY-0F; Fri, 19 Jan 2024 10:45:37 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNR-0057Ho-2a for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:35 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40e775695c6so5499095e9.3 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=1705661131; x=1706265931; 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=H74QYBuoWbNPw1IrHpaPtV5Fr/Jo8QfnPV+pn460u7Q=; b=dUbkXEH7OEoS9uXGBnvYbyUzPOkyvwMoTNxo0iDTvL0SjtXXVKgxvyrB2ZrYbunCMR WigOzXinfSfaaSiln/uCygmnWxZU47UOBsTbZG9RQhXiKSsFeKvVOAxXErf33wY+hC5p ZVE0XYgfvrpyTq3O5wDaIh41d14hCLebfCoNk5T5w8c9d05qCsJX4wci/Vac/d7zEOZ5 FFr3k1YEqwZnAR34n0ydlAnqrHSaCVms/3KUTGUvwXPnu48RA1MSvedR2Nhs8Lm1iMd8 CqEDTxToDdo2Xw+lk4TNeqbFndIHUEYjin4FiTxG7DnsBZt+cV/o9Z0l2WKeUKIDc+MT oyQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661131; x=1706265931; 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=H74QYBuoWbNPw1IrHpaPtV5Fr/Jo8QfnPV+pn460u7Q=; b=Y896effrUheuqCggTYr9hG0xo/drYaSw4sZdbofjA6ML5qjIlXq1gxxegnx18QREV7 3RMD8n0+xnxYx3D1OmSdq4zSuDRL8DU4sObxomR9mAC5ZQfr9RP9p/FYhrkKoxSQCGs2 H0enSBZJrEqwMKb9FAtdKwhB2myjhIOrBRPDfPTSKOFojEqYA6tbcj220o/uzECwGoXI DfD9zQExsmGEdJDfqztZp05htOsL8XfIpz5jLyT3fArg8+9xishGvnhlcRofXFiVY+Gy WCLsx7iaTUsxpkGXG+6KVyBv4OAiy7a+uxeEY2zLsvxRriDXCmiQcffgoJUx2K6DW+V+ CLbQ== X-Gm-Message-State: AOJu0Yy7Sp4j4TAYcVWT25jVuHiLAkJNeWCj9g9XSuEQRCX5EoYq4osl 1dyLA2CkkGKtyqJWVETS2WOGmjqo190FkWgIx6vrtyGRYffD+ruEO9VZIHEEGK0= X-Google-Smtp-Source: AGHT+IGe2DxncF/tdHEyEyQetNG3qty4lJaRlXD9UVpv8DePV8y20R67SD2hJpbDmH4wko4vUgqtqQ== X-Received: by 2002:a05:600c:2152:b0:40e:6587:edc8 with SMTP id v18-20020a05600c215200b0040e6587edc8mr1512939wml.91.1705661130766; 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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:30 -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 , Krzysztof Kozlowski Subject: [PATCH v2 02/19] dt-bindings: serial: samsung: do not allow reg-io-width for gs101 Date: Fri, 19 Jan 2024 10:45:09 +0000 Message-ID: <20240119104526.1221243-3-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_024533_850741_EAFA295B X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. 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 All gs101 serial ports are restricted to 32-bit register accesses. This requirement will be inferred from the compatible. Do not allow the reg-io-width property for the google,gs101-uart compatible. Suggested-by: Krzysztof Kozlowski Reviewed-by: Krzysztof Kozlowski Reviewed-by: Peter Griffin Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- Documentation/devicetree/bindings/serial/samsung_uart.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/samsung_uart.yaml b/Documentation/devicetree/bindings/serial/samsung_uart.yaml index 133259ed3a34..0f0131026911 100644 --- a/Documentation/devicetree/bindings/serial/samsung_uart.yaml +++ b/Documentation/devicetree/bindings/serial/samsung_uart.yaml @@ -143,6 +143,8 @@ allOf: then: required: - samsung,uart-fifosize + properties: + reg-io-width: false unevaluatedProperties: false From patchwork Fri Jan 19 10:45:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523574 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 768ACC4725D for ; Fri, 19 Jan 2024 10:46:10 +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=C/SZXpTHEfM+qZB957Yca5qpaSQnml1V8IA4rpb4XcA=; b=B6h3Seak970+ZT VJsJeWy62h8owrR2frlEfAWyuTncUgCdtR89slurR6YDXCnA9AVyyviZHiGvSRqa3hlCl7doCr+aI cRsU1HX6xdXgt/bwqM+G55XDmOF4f8+mPh4Fyga7S1ONq1GUe3YZxVKj0dyR3HOQZovPFtzsGgAUt 5UbrKpN37nqpsDjsPE9qGJtFnxf1F2I49xBZq6pWDAN5H1jwZ35Z7sf8kuOp/34WpNRNq1lJ5Czi2 KvDkTNxQ10y7w9oogm9wb0z4US9R/SqOdeGJNTQw9Fti/NzynPPpDdTYoh5Xq1258sxxQbQa/s4hZ NgqY0RpmvHEExf0XZtBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNV-0057Jp-2B; Fri, 19 Jan 2024 10:45:37 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNS-0057Hr-0Y for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:35 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40e913e3f03so7061905e9.3 for ; Fri, 19 Jan 2024 02:45:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661131; x=1706265931; 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=HTC4DdEvy8g2SMCw/JI6FV7yDSpa07/4JczZdfD8XG0=; b=uNhw0SMbHlUJ0Jb2yYqoeTIRmDk9qwvjqjULinH4mNbtsMewEy41t7pDFVXS1+AQCh VMUMMpYka9cMMp4mdAnRv78fpkxqoz3MTWttmQvzaoH0xYs31yvSQYIZZVmInINz9etU CRZRRm2swvtURO0gTCIHRXY4LTJcL5tmYrb227kyj9dcLabJAKwpg1dpjZjIu50y6Nad IaD4BLNDw8RswDNGcNO2A4eaRoNuv3SwWueapHQzmrra+7nxK4mRXubGfk510SIMyrTP qa0zN+BmHGINmly6Fo+4Y/vEhAOCvPiqRIMeZROUcqzUJ6HGbyT/HRwQXN8SJUnBq4+s 93EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661131; x=1706265931; 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=HTC4DdEvy8g2SMCw/JI6FV7yDSpa07/4JczZdfD8XG0=; b=XbrKV6y8TaNE35LNOvAOSGxt1RHxXQmQpAoefKunKyFaCU00iYwqsasuTSMWuSnCD/ PxK+E94EZTgqKZghIYD1ePCzigiYtJ/oVvGYPEZlMB8Uv/PtgqHZ5xIftQfwURR6Ya7l 1UR4fGOairvWLhCJG42s8mDhX69YLLXUI/JZtEIAl2q36lL/a/KRZrB6+SwFRvrNIM5U R0pOcTR8RcGXbdS6tjqIAuj9IRBbK7OL6W/GYdOrNjQA0om8U0yCLUXxq0resd0f4Ucw aBFBZxtAdhE9/UJaBGY03ZaEox7H2W20wDWQ/MgVmhWfyeTs6oEbdEE+mIiXpbbP/XCE /7WA== X-Gm-Message-State: AOJu0YzmKyrD/h/h+1rqxc+EIpmpbcXc6SKOQYBv7XNWQQpB9HbljeNi 5FArPWUfOzHCmhtkX+qRSM5kgmmpF3ObicIhUMAkPjT8VFP1bJRuaaPXoixY41E= X-Google-Smtp-Source: AGHT+IFMYe0iBaJgLM0jN4384HDBV4gkQcxKrLQJyf9nqc8RpGHq9WbRuPOO/CoLSCk5Y4JF+E0+vA== X-Received: by 2002:a05:600c:3014:b0:40e:4870:d2a4 with SMTP id j20-20020a05600c301400b0040e4870d2a4mr1622675wmh.59.1705661131795; Fri, 19 Jan 2024 02:45:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:31 -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 , Krzysztof Kozlowski Subject: [PATCH v2 03/19] tty: serial: samsung: prepare for different IO types Date: Fri, 19 Jan 2024 10:45:10 +0000 Message-ID: <20240119104526.1221243-4-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_212602_EC25D52E X-CRM114-Status: GOOD ( 16.34 ) 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 GS101's Connectivity Peripheral blocks (peric0/1 blocks) which include the I3C and USI (I2C, SPI, UART) only allow 32-bit register accesses. If using 8-bit register accesses, a SError Interrupt is raised causing the system unusable. Instead of specifying the reg-io-width = 4 everywhere, for each node, the requirement should be deduced from the compatible. Prepare the samsung tty driver to allow IO types different than UPIO_MEM. ``struct uart_port::iotype`` is an unsigned char where all its 8 bits are exposed to uapi. We can't make NULL checks on it to verify if it's set, thus always set it from the driver's data. Use u8 for the ``iotype`` member of ``struct s3c24xx_uart_info`` to emphasize that the iotype is an 8 bit mask. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 6fdb32b83346..9d3767021f9c 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -84,6 +84,7 @@ struct s3c24xx_uart_info { unsigned long clksel_mask; unsigned long clksel_shift; unsigned long ucon_mask; + u8 iotype; /* uart port features */ @@ -1741,7 +1742,6 @@ static void s3c24xx_serial_init_port_default(int index) { spin_lock_init(&port->lock); - port->iotype = UPIO_MEM; port->uartclk = 0; port->fifosize = 16; port->flags = UPF_BOOT_AUTOCONF; @@ -1988,6 +1988,8 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) break; } + ourport->port.iotype = ourport->info->iotype; + if (np) { of_property_read_u32(np, "samsung,uart-fifosize", &ourport->port.fifosize); @@ -2398,6 +2400,7 @@ static const struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { .name = "Samsung S3C6400 UART", .type = TYPE_S3C6400, .port_type = PORT_S3C6400, + .iotype = UPIO_MEM, .fifosize = 64, .has_divslot = 1, .rx_fifomask = S3C2440_UFSTAT_RXMASK, @@ -2427,6 +2430,7 @@ static const struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .name = "Samsung S5PV210 UART", .type = TYPE_S3C6400, .port_type = PORT_S3C6400, + .iotype = UPIO_MEM, .has_divslot = 1, .rx_fifomask = S5PV210_UFSTAT_RXMASK, .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, @@ -2456,6 +2460,7 @@ static const struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .name = "Samsung Exynos UART", \ .type = TYPE_S3C6400, \ .port_type = PORT_S3C6400, \ + .iotype = UPIO_MEM, \ .has_divslot = 1, \ .rx_fifomask = S5PV210_UFSTAT_RXMASK, \ .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, \ @@ -2516,6 +2521,7 @@ static const struct s3c24xx_serial_drv_data s5l_serial_drv_data = { .name = "Apple S5L UART", .type = TYPE_APPLE_S5L, .port_type = PORT_8250, + .iotype = UPIO_MEM, .fifosize = 16, .rx_fifomask = S3C2410_UFSTAT_RXMASK, .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT, @@ -2545,6 +2551,7 @@ static const struct s3c24xx_serial_drv_data artpec8_serial_drv_data = { .name = "Axis ARTPEC-8 UART", .type = TYPE_S3C6400, .port_type = PORT_S3C6400, + .iotype = UPIO_MEM, .fifosize = 64, .has_divslot = 1, .rx_fifomask = S5PV210_UFSTAT_RXMASK, From patchwork Fri Jan 19 10:45:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523578 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 83963C47DB7 for ; Fri, 19 Jan 2024 10:46:17 +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=SYz0Kiwy8WIeEP1kF7Z1v71FUE1yVNAeL7SvnOuORP0=; b=SgR6OcPBDT+ctD WaxLxz3K+j92qpjjvwHMfoBpsu5gVXnbnm5BlVxDu5Z8Xq6WYKH0a4HT35otyMgDEuM0o7rcqXkQ2 K7LS3pgaGW2vEZNaMCq4pfvZvpLqEGKtyJ0f15vAGDTbw8hiWjDq71jQ9kn0bmQnkIzz9akbJB4pr 74EbCXxvzSQH3+KDfDWX6JLToikr/fRysYoJgsKG/F3wierld1wfV2VwmzCUgdkX2A9i/UBjGQauk prZtl+7bGG1By1hMsPQDATbkMmIA7uiLMgAfZUQOkvofzQU5Yt7i/3e9skDlpM29LSC3yuOadU7bZ X24oE25whMU4q/CtujtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNf-0057Pm-1t; Fri, 19 Jan 2024 10:45:47 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNU-0057Hs-1Q for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:37 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40e9101b5f9so6680425e9.3 for ; Fri, 19 Jan 2024 02:45:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661132; x=1706265932; 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=QRO/29BBu0wOqLjfgi9jbts6vS9S++O3BcU4FggPnxQ=; b=ycCgrJOyROP0p8mFO13+6nBJV+HyiFwWwpj5h6z4RBYFpsKykuTuPnUyz4eVHsAm+p S5VXvrVXWzK8WF3v3wP9QuvnHs7auUc/ti3mIF9ANNRgazKPzd0o2Jhgzp1bAjUTVXay /z/+Bcqm9pMOyPGRSNE/9t3ZRcGL9PKcMTivQm2eqQ0OVFYNXGUpXzwUsafUEzSWkLHz vSahdATf1gfjVttLNgjhLaT5ySK0M2RzKvV1QDq/ZlE5/HrxMef9rmKy+C49k1dD+SHw EdZT4r2Hobz2f+7gDJkjQGWYrdxaHnewpV8+TtYG6qBK2eq/ikSngMWP7hX3/9dtsinH mImw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661132; x=1706265932; 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=QRO/29BBu0wOqLjfgi9jbts6vS9S++O3BcU4FggPnxQ=; b=aX6p5I8sUTY4NZHwrLOrhDlqUYnzcT91g4Wmr1BfJemuELJnbt8fsoJrfTr6hatm4y oNXiXXiKsD0F8KbUl+++R8nxZKaPijDsBibRGetpUPMf4zGRELPd4qSu0ZPCSzPi6/tL 7q2kxb4IsEWl+m007gLaTZKez9mLV3FqwNHVj7h4t4IddoGETbT6Ksp/H/JWqSjGjhcT FMkhR+XwYuaFaR3tuKlRE6iKzsNqbV72TWKqZoyMMDK+j4zv0t4qG8MHyF9BxXpKbYn+ j/jFDxQ1JMbZ//yNbRVXAS6fongxcXc4daHp0NftHtFcgsprqdqDonLpn9QuniNEp6oZ M7FA== X-Gm-Message-State: AOJu0Yz0lbIsV4olbukq10mUO7IPsWxt7qkmy9plNK39H1GPRK2jc/Ph Fo0nOocqrZK/aIMHlRUtAILcokU0WKTQqCHFOHF4UZGsfLlL7k1T6sx1QhlNdqw= X-Google-Smtp-Source: AGHT+IGrA5J+z8EbYw2wyRH3MCBXeZ1K10bB38FMjwSnkyuqVvhBeOxNJ4f01saw5T3Tqey5/1SUhA== X-Received: by 2002:a1c:790f:0:b0:40e:4d1b:27e0 with SMTP id l15-20020a1c790f000000b0040e4d1b27e0mr1506294wme.20.1705661132761; Fri, 19 Jan 2024 02:45:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:32 -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 , Krzysztof Kozlowski Subject: [PATCH v2 04/19] tty: serial: samsung: set UPIO_MEM32 iotype for gs101 Date: Fri, 19 Jan 2024 10:45:11 +0000 Message-ID: <20240119104526.1221243-5-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_024536_522024_442F820B X-CRM114-Status: GOOD ( 14.55 ) 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 GS101's Connectivity Peripheral blocks (peric0/1 blocks) which include the I3C and USI (I2C, SPI, UART) only allow 32-bit register accesses. Instead of specifying the reg-io-width = 4 everywhere, for each node, the requirement should be deduced from the compatible. Infer UPIO_MEM32 iotype from the "google,gs101-uart" compatible. Update the uart info name to be GS101 specific in order to differentiate from the other exynos platforms. All the other settings are not changed. exynos_fifoszdt_serial_drv_data was replaced by gs101_serial_drv_data because the iotype restriction is gs101 specific and there was no other user of exynos_fifoszdt_serial_drv_data. Reviewed-by: Peter Griffin Reviewed-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 38 +++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 9d3767021f9c..7a1b1ca82511 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2494,25 +2494,43 @@ static const struct s3c24xx_serial_drv_data exynos850_serial_drv_data = { .fifosize = { 256, 64, 64, 64 }, }; -/* - * Common drv_data struct for platforms that specify samsung,uart-fifosize in - * device tree. - */ -static const struct s3c24xx_serial_drv_data exynos_fifoszdt_serial_drv_data = { - EXYNOS_COMMON_SERIAL_DRV_DATA(), +static const struct s3c24xx_serial_drv_data gs101_serial_drv_data = { + .info = { + .name = "Google GS101 UART", + .type = TYPE_S3C6400, + .port_type = PORT_S3C6400, + .iotype = UPIO_MEM32, + .has_divslot = 1, + .rx_fifomask = S5PV210_UFSTAT_RXMASK, + .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, + .rx_fifofull = S5PV210_UFSTAT_RXFULL, + .tx_fifofull = S5PV210_UFSTAT_TXFULL, + .tx_fifomask = S5PV210_UFSTAT_TXMASK, + .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, + .def_clk_sel = S3C2410_UCON_CLKSEL0, + .num_clks = 1, + .clksel_mask = 0, + .clksel_shift = 0, + }, + .def_cfg = { + .ucon = S5PV210_UCON_DEFAULT, + .ufcon = S5PV210_UFCON_DEFAULT, + .has_fracval = 1, + }, + /* samsung,uart-fifosize must be specified in the device tree. */ .fifosize = { 0 }, }; #define EXYNOS4210_SERIAL_DRV_DATA (&exynos4210_serial_drv_data) #define EXYNOS5433_SERIAL_DRV_DATA (&exynos5433_serial_drv_data) #define EXYNOS850_SERIAL_DRV_DATA (&exynos850_serial_drv_data) -#define EXYNOS_FIFOSZDT_DRV_DATA (&exynos_fifoszdt_serial_drv_data) +#define GS101_SERIAL_DRV_DATA (&gs101_serial_drv_data) #else #define EXYNOS4210_SERIAL_DRV_DATA NULL #define EXYNOS5433_SERIAL_DRV_DATA NULL #define EXYNOS850_SERIAL_DRV_DATA NULL -#define EXYNOS_FIFOSZDT_DRV_DATA NULL +#define GS101_SERIAL_DRV_DATA NULL #endif #ifdef CONFIG_ARCH_APPLE @@ -2600,7 +2618,7 @@ static const struct platform_device_id s3c24xx_serial_driver_ids[] = { .driver_data = (kernel_ulong_t)ARTPEC8_SERIAL_DRV_DATA, }, { .name = "gs101-uart", - .driver_data = (kernel_ulong_t)EXYNOS_FIFOSZDT_DRV_DATA, + .driver_data = (kernel_ulong_t)GS101_SERIAL_DRV_DATA, }, { }, }; @@ -2623,7 +2641,7 @@ static const struct of_device_id s3c24xx_uart_dt_match[] = { { .compatible = "axis,artpec8-uart", .data = ARTPEC8_SERIAL_DRV_DATA }, { .compatible = "google,gs101-uart", - .data = EXYNOS_FIFOSZDT_DRV_DATA }, + .data = GS101_SERIAL_DRV_DATA }, {}, }; MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match); From patchwork Fri Jan 19 10:45:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523581 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 1075AC47DD7 for ; Fri, 19 Jan 2024 10:46:21 +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=nhWa5ef+UIiIEiV6i33hUdmwuuT+uUuO098xwoMBqrI=; b=f7PZUtnPxRvBSp uUnQflMzilOaeDuuiyFFM+FAWhGRiJ9RLL5Z7Y2YefiJXDXlmLp3kBKLkxo67WwGDtYLmQwp5DXwc XiM609mGtGFQjvQaUKDaUVAzsjS2P7Snl2a9cCmYz2e50qexmrn8+ZxoyE6h4K/MQbmBcUJTN1AJk rkV2IgU2GY5vFDpAitileUHd9RU38ckfjI8zTdVLRB/nlb9OhdR/WTECNnDEnko30zkOEIaHxl7YF yqtMMrqxA0zrC3eaiXZ/TOJNf+Y9p3JWDFRqkQtpXPF0s4AFgf0F4k7vhWOGwxxno3SNpYbapRVYX AQILdkIATW3zhXV7soKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNe-0057PL-38; Fri, 19 Jan 2024 10:45:46 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNU-0057I4-1A for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:37 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40e8fec0968so7818915e9.1 for ; Fri, 19 Jan 2024 02:45:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661133; x=1706265933; 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=2al3iBNQhWlEPx3zO71H97w87oPbBhC1wsAJyE/YV+Q=; b=tkcqB0+Ir7dPymfB+x+AwAM3gfF38Cqa1bzg//8l4oL0/jj/R3QRJ7vc8WYPm/R43q 6pquTBjsCAEbt4YSOuVHLGQNiaa0OC7cje1qw9me1VHysnvH9kn2pJVxv9c5u0VUHQOT rYIR9BwHiVuzhzCDaLhwgaq720mi+BJkglpQ2ATEPUY/K8lnGIUqrlZXWWb3aiDmTLuh 1mo17VZaIhMULyVUSGD9luTZgkIq+knJN9GjmRCKx6ugiVk2yA84MNxWInaNo56W8Ajj dDK1eo+RnoIWZDl+D2AYNI86MHCRc7AQ0E1g5QNZZKGuLC/e7Fql8MUJEhcTmzGj1Q2i JwzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661133; x=1706265933; 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=2al3iBNQhWlEPx3zO71H97w87oPbBhC1wsAJyE/YV+Q=; b=LyHAYcsViAeu5lFqYBI+xOggk/c7uLWXHsrrAvm1MRkFvt1rXxBBtcggCTUiMmanUY 8nUm3wsAix38JPNkDqc3F2+4LAb04jwH8w7bWoGbxE/Nx0AgpCq6JTGiOTF/fhN6s4WW oguGW8FJ6eB7I4x8A1szynN3AE7O2iQB3SWqMaBMuP+/CeUpAZqo1U39HisRDONjBlgL T7RQD8wJHR3cJ4XPPh3SNznfA6zAYJ40niR3s5VG7z42Of+9PvA3si0UFA5GMGytWBBP iEfYQoYJtilPWJKf1TLIn8eGmWoLQmMSfKOpF1Vmbl+xkuadJJ/Oqg9PX46CukApZ7gF MVXA== X-Gm-Message-State: AOJu0YxjuSxLXzWyFVtdM7wF/OG+KuWbtCVsLdpkxDWGYRSH+B2kEYS+ bhT+Lx+NoZWvDzteIjRp8T3C6My3zYDSd3heA5BcuF8encht6J//B03L1gappaE= X-Google-Smtp-Source: AGHT+IHXRVDj6Z2rHedmVBuRLxryu4//t1M2OscXjxE5zCpuJxJ49smSeqRP5ESmOv4g6vvM9Ij/5Q== X-Received: by 2002:a7b:c412:0:b0:40d:7d62:80ab with SMTP id k18-20020a7bc412000000b0040d7d6280abmr1306238wmi.117.1705661133590; Fri, 19 Jan 2024 02:45:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:32 -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 , Krzysztof Kozlowski Subject: [PATCH v2 05/19] tty: serial: samsung: add gs101 earlycon support Date: Fri, 19 Jan 2024 10:45:12 +0000 Message-ID: <20240119104526.1221243-6-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_024536_398651_586899DD X-CRM114-Status: UNSURE ( 9.95 ) X-CRM114-Notice: Please train this message. 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 entire bus (PERIC) on which the GS101 serial resides only allows 32-bit register accesses. The reg-io-width dt property is disallowed for the "google,gs101-uart" compatible and instead the iotype is inferred from the compatible. Always set UPIO_MEM32 iotype for the gs101 earlycon. Reviewed-by: Peter Griffin Reviewed-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 7a1b1ca82511..80b8fcf9e025 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2809,6 +2809,17 @@ OF_EARLYCON_DECLARE(exynos4210, "samsung,exynos4210-uart", OF_EARLYCON_DECLARE(artpec8, "axis,artpec8-uart", s5pv210_early_console_setup); +static int __init gs101_early_console_setup(struct earlycon_device *device, + const char *opt) +{ + /* gs101 always expects MMIO32 register accesses. */ + device->port.iotype = UPIO_MEM32; + + return s5pv210_early_console_setup(device, opt); +} + +OF_EARLYCON_DECLARE(gs101, "google,gs101-uart", gs101_early_console_setup); + /* Apple S5L */ static int __init apple_s5l_early_console_setup(struct earlycon_device *device, const char *opt) From patchwork Fri Jan 19 10:45:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523577 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 1DBE5C4725D for ; Fri, 19 Jan 2024 10:46:16 +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=CCH1sNH/mg9j3zKQJsQzBseCFOrOvX57iFvkv5sTb3c=; b=lqd5xJlloXr68c usWjFkk4YO1YB6ksmVD01q4LZ6GMFjM5FBVp+E6hAPH5Rb0GX4PrZCyJZjciZ2q1i3YYA6Ye8+YPm C6b0HsBRECJN/oYTxtH49hHQ78fQJF8tO0qB5Jfj0uabirjISYK3/xEW0rWTC4FVGGgnOHuhdsvGy OSpcUhh7KPkEIlQrotMR5SjyKhv6B04Xu3Hj2NjypHxr1ZfADRfLp34Py/fGHppBxZtjNcft87lnE UOCU1Em4SzdnCwNrXC/VkbFCYRQPCiQFnI5rfJuwc8QHy8yyC7roV7nm/6U2+Wbeb9WAO8wB/TQBL nTOtu+ZdIXxNqkOuwaFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNg-0057Qo-2G; Fri, 19 Jan 2024 10:45:48 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNV-0057Iq-1k for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:38 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40e76626170so6697605e9.2 for ; Fri, 19 Jan 2024 02:45:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661135; x=1706265935; 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=PLdYk7lMN8S67k1ZA1qBwWGzOiN17GG5/kldayDzF2I=; b=Xar8zXhwHTl1QMxhHpSDZjZYCxKD0XlNpYx2o8jJQ3ToBxxcWBQaM1vl24X0nXez5R 7mvPfXhVXITdPx+S8i3ImbOwhf8qozan66fbUfIznL9JANs2bhJSKoTOHYSWhABZJJBX bxX1Sb1X7XJElkd7Yyzl1Ylfx3H6p8GrUX2Rj92EzJ63LEntgytvHpO1u9NP+oI33Ilr VGXrw822RtRSBP7ZZ6wWJIIL1JhFLqVgZDON334MJoV2QfTGTl+9EIsArDTBm00VyGoL RfXOr6q/VUbPCYOoUyQilmhrw32VSZzq6oUwgv/BMJ3FnZMwMIshXZLzI9o48pRBpfjt DIqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661135; x=1706265935; 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=PLdYk7lMN8S67k1ZA1qBwWGzOiN17GG5/kldayDzF2I=; b=g/sQrepnAVihmJXvubVo4CHCGJk7H77lc1o8ETRVbm6l/lP98wEUPvHRP3aF31+Lm9 aNRsBN0RVi9SGSfDbf596DIL+xhHIBcMB1zdiOb0MZIDZ4NGgZOz9Gnpu9EVSqxnJ0q0 FBb2plDzJpUB43XfIYA8BBGghby47Du+uqqI8vVC7+1nTXRajGqGhHrY4afn5ZMmOkf+ PtEOUrOaj7WIwzzPVhNQGLyFiLDfhsT/ZlQnntuOzieRiWMVpE1ewcPc88shW6LuuFVS OMNFOdSMfZOQkJFCsoE3XsiyzJZJGI+M6lmygd1UQY9QbQyq63yxSiZmPwtURYXk2aUK 6lCg== X-Gm-Message-State: AOJu0YzD+eJ0PBwjdz/X54Vj2g0MxVkxHChP/ksuV1bHyPQqYRuuBTyJ 8S2rh7Zlml4GGUethbEI7maOQU9gTikDLXZ0GJMIySxmMfi542Qs8rSu/Vm2DTI= X-Google-Smtp-Source: AGHT+IHStpeaJg7czVAXhy1YLg3/cMnP60jBDv2J1qFM0FiGJKfMOtGOvAXTPzU6UR+GGpcxYZaeFg== X-Received: by 2002:a05:600c:1d03:b0:40e:8a59:c3a9 with SMTP id l3-20020a05600c1d0300b0040e8a59c3a9mr1568710wms.2.1705661134824; Fri, 19 Jan 2024 02:45:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:33 -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 06/19] tty: serial: samsung: sort headers alphabetically Date: Fri, 19 Jan 2024 10:45:13 +0000 Message-ID: <20240119104526.1221243-7-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_024537_576257_E1E19A29 X-CRM114-Status: UNSURE ( 9.45 ) X-CRM114-Notice: Please train this message. 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 Sorting headers alphabetically helps locating duplicates, and makes it easier to figure out where to insert new headers. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 80b8fcf9e025..bd9064d4efe7 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -21,26 +21,27 @@ * BJD, 04-Nov-2004 */ -#include +#include +#include +#include +#include #include -#include +#include +#include +#include +#include #include #include -#include -#include +#include #include -#include +#include +#include +#include +#include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include + #include /* UART name and device definitions */ From patchwork Fri Jan 19 10:45:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523580 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 349DFC47DAF for ; Fri, 19 Jan 2024 10:46:20 +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=EdhXlwhMlYXmZ4GhKIbvu9KRS5NE+X4JRz2izR/ob5w=; b=1XWilSuT9aD+UW nffpb4+qX9GJsqi5BvsKAqA3PGsk0OaYVL6bTFsSdyqd36Pl1ihx0tbbYgnUS6XfYpWzw9zQaYoK2 uyvzUCdjraC/MyPlPLkxTaQWXoJi8pbNDqfohJOyRZivk7u87tW3beOh5emt/ZWXSddAP9mzhTuBP CleHzW7ywcALXfUug4xvgEjBAP4g3bTyao3wi8UGnOD2eGXObTJHKMcEGd16tMM7lMAHo6NujURVv pNHxYSvBQAx5/yoi9DG3cJFHSV7cvK1JDZWiLNIjNt5W5KZHhL8bjjvd1Ua6N2PTpkJxYItDHEGQy tZJHGl2HO+krOQhmRDFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNh-0057RL-1D; Fri, 19 Jan 2024 10:45:49 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNW-0057Iz-1Z for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:39 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40e800461baso6757755e9.3 for ; Fri, 19 Jan 2024 02:45:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661135; x=1706265935; 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=pIbZuKCi3c1voBLaFczjMA5Q6as8L4OLAkz7Vvuwfes=; b=dmUoiKEr/hEpWL7NT7yvx87jL9UpGgCBtiDmPWq5bFd9rNtTAHVnrvp3FTU7rvEohs MavPyvG8RN1/jAOdBBnN/aTpatyXkQSKSX7VyKQKcVbrweEIjZaA3BtSv65nDikW+DV1 E75eN/cTbc9FKvKwmM7aW9d4zdNCkH+mmSS5PG3DuepAaz8+pZyozqGjaLzpUo5s+IDz MJbOgeudW8QazH0hjWc40akAXm5Gt67Jd384PQaS2TUBJkF7HqW7ulWgm+mrfDsV7hks G0zBaKDGGci8xfA+PPELRpUNxKqYK+D585knjoByX4el4nHAWozTtrB4s4eRxq58wIMV CnPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661135; x=1706265935; 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=pIbZuKCi3c1voBLaFczjMA5Q6as8L4OLAkz7Vvuwfes=; b=S+3vImn7iRdE87StWkugqXb560U8CofHgajUJ0qvASds0U2YGU81C6Zuqu8ftzPwRf IGOGx2ZdYfcbegrJ+qcbnW8v+6r2xAx+DIHVJP8q4+ZB8yCkHbXgaRv0fuoBycCj9Lf3 LdGqcf/99/V9PXA62KV2QMAyj+5rQxAiSI1JmFas9dBBwMPnCSZ96TT1B2igEv3gB1my VxtUWbst47r95VVyUN9t8HUVP5y22tjO8URTqPQMf51oJOcnfjKaTqzpuJjZRio9jLr/ xPYOzILyVTjCdgkGP9Nbrz13ROfl76PNzFVCX26RwC0FuwbM1ycEE41yh24Nf4/J1IUj Qoxg== X-Gm-Message-State: AOJu0YxuBlqjwyWicpQB9tNHFjG32nLlMZRNrs1IKgN5D0Oa8c2PUdpb FIzv9rKW6M1skaRp6UTUclSCd+OJH1X8/mpRgkdOGhBi4q7bR/bUhvHz6DCUlsg= X-Google-Smtp-Source: AGHT+IFLmA7d8ltm4h9XYmmFH/I/kevgVOWIIn/k6BbTcCgt0ohwTpBHM8yPPxHqUedz/2sHd4eFSg== X-Received: by 2002:a05:600c:310f:b0:40e:76f4:8cf1 with SMTP id g15-20020a05600c310f00b0040e76f48cf1mr681769wmo.221.1705661135759; Fri, 19 Jan 2024 02:45:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:35 -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 07/19] tty: serial: samsung: explicitly include Date: Fri, 19 Jan 2024 10:45:14 +0000 Message-ID: <20240119104526.1221243-8-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_024538_520863_7A3BCB44 X-CRM114-Status: UNSURE ( 8.99 ) X-CRM114-Notice: Please train this message. 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 samsung_tty.c uses u32 and relies on to include . Explicitly include . We shall aim to have the driver self contained. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index bd9064d4efe7..b9b91ff6a1d7 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -41,6 +41,7 @@ #include #include #include +#include #include From patchwork Fri Jan 19 10:45:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523579 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 AA58EC4725D for ; Fri, 19 Jan 2024 10:46:18 +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=Aw9pjYUi3IPwS3tbHl1N53ejDasxAdcVjw+DWTyLxQ0=; b=Kwo/IcBeYovhXs sGZv4Gzp8Yn1FHq1ZlyFDsWyUJ0kApFQNlRRni67DNdiQDvksa2c5D+7GXdqpz5OcuK5H3+fE8vKT DX0f9ESyDjHvJ6r34rpuntxwMcAMKYFTbJsCBUHcru/XihdmEwPrFcVxp2DQL8XwcqCGcE4RpfV10 ePJ5qbFcu0U3QfJnnsm5uhhAkQHshsXhAL+JySNqnfrxKfN1MpD75j7icHWTzPtDOybPRigg+4RgJ ck0Hs/e260z9juKm5PQL0fz5WoaVJ7oHxEuvMBL18dFfb0uahPMLNjaFk7/RyqbOsp/rHzglCjMu8 72WVUcStGQrbT9qT1qaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNj-0057T1-0p; Fri, 19 Jan 2024 10:45:51 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNZ-0057Jd-1e for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:43 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-337d05b8942so644847f8f.3 for ; Fri, 19 Jan 2024 02:45:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661137; x=1706265937; 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=draq2LBr3rh1hsqpn+xELW8VPhSh6bMilJxVO89mlwc=; b=plHuz2uF09qE1KPddtvX95cqxSKNpJ3Oade2JonAy4zZMl4n8Wzbe3RvrsA+QK9fC3 JKUtBRwYyuyQzjmyeHeiO7HjMghygAmNkwwXrLPurecuLlni+mkP/RR56llsunCLSWKk WkBdTXmNF2xTUdoWExuYqV706zFwifacmFOUccQdnuV+md03+kG+79dyCycO61SSu1JJ j4uQ/Kr0Yo1UGH21TfHedMHDt637jCBV1vfCdVFAabX6hgj/Lg8GmhbKs2VGZ2Y6iq3g ORkA6NLkdiZsaL8SeiSZlRLojuPANTd85NdYIdJilWknHZhug1BecfNCSBfCGFzCW5eA sOdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661137; x=1706265937; 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=draq2LBr3rh1hsqpn+xELW8VPhSh6bMilJxVO89mlwc=; b=IvosNmMsoiQKKt4b5TLzfpLAE13T6ho6DeLpO/NBJUYTxcuGXekUAAOYX/6WhOi+tW gW7yvLr0DzkAAmsfCeq7QFRgoNYyhQMWBRcLKg+bm0sxOei2gToJT1TUJN9EFW/jBjY8 zdOBuB4pyROKljotmHAJk+1HT3kwLccDF5S4pyanUV5CSaEgl3xr5pz6eeHMo9X0ri4Z GrcaAK8cH+FKw+/QruCTZEgNfJB3sxT7wmW3nKOlRakwikNwtGM25PSgCLHfPFbxieZl lgaecdEPEalpF2NHipBpefLIohC9WEXRnsnFDnoC9NwA4/Jg42jv4AaEO9X8sG4lR2gl IIbQ== X-Gm-Message-State: AOJu0YyzLVbqWLX6cFmcTBCTUTBM2lc7WAy407q5uQCkaPOVJ8j/E8Qt NWVEqA1vLiympKXORHSZ/8GW1s1IUH2sPIcVb4CY3uHGBQar+TTaoI3rm3Qv8lE= X-Google-Smtp-Source: AGHT+IGpcApyIWJFtLX0iIOlhoAeQ17PNEjsoOdq7qV3HI9GzWTu3avyi91tcVAFJS0Xme35Yc5gZg== X-Received: by 2002:a05:600c:524a:b0:40d:8815:afff with SMTP id fc10-20020a05600c524a00b0040d8815afffmr1597586wmb.39.1705661136915; Fri, 19 Jan 2024 02:45:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:36 -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 08/19] tty: serial: samsung: use u32 for register interactions Date: Fri, 19 Jan 2024 10:45:15 +0000 Message-ID: <20240119104526.1221243-9-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_024541_550048_9A44E1F5 X-CRM114-Status: GOOD ( 19.06 ) 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 All registers of the IP have 32 bits. Use u32 variables when reading or writing from/to the registers. The purpose of those variables becomes clearer. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 79 ++++++++++++++++---------------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index b9b91ff6a1d7..8b396c950933 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -199,7 +199,7 @@ static void wr_reg(const struct uart_port *port, u32 reg, u32 val) /* Byte-order aware bit setting/clearing functions. */ static inline void s3c24xx_set_bit(const struct uart_port *port, int idx, - unsigned int reg) + u32 reg) { unsigned long flags; u32 val; @@ -212,7 +212,7 @@ static inline void s3c24xx_set_bit(const struct uart_port *port, int idx, } static inline void s3c24xx_clear_bit(const struct uart_port *port, int idx, - unsigned int reg) + u32 reg) { unsigned long flags; u32 val; @@ -245,8 +245,8 @@ static void s3c24xx_serial_rx_enable(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned long flags; - unsigned int ucon, ufcon; int count = 10000; + u32 ucon, ufcon; uart_port_lock_irqsave(port, &flags); @@ -269,7 +269,7 @@ static void s3c24xx_serial_rx_disable(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned long flags; - unsigned int ucon; + u32 ucon; uart_port_lock_irqsave(port, &flags); @@ -591,7 +591,7 @@ static inline const struct s3c2410_uartcfg } static int s3c24xx_serial_rx_fifocnt(const struct s3c24xx_uart_port *ourport, - unsigned long ufstat) + u32 ufstat) { const struct s3c24xx_uart_info *info = ourport->info; @@ -663,7 +663,7 @@ static void s3c64xx_start_rx_dma(struct s3c24xx_uart_port *ourport) static void enable_rx_dma(struct s3c24xx_uart_port *ourport) { struct uart_port *port = &ourport->port; - unsigned int ucon; + u32 ucon; /* set Rx mode to DMA mode */ ucon = rd_regl(port, S3C2410_UCON); @@ -686,7 +686,7 @@ static void enable_rx_dma(struct s3c24xx_uart_port *ourport) static void enable_rx_pio(struct s3c24xx_uart_port *ourport) { struct uart_port *port = &ourport->port; - unsigned int ucon; + u32 ucon; /* set Rx mode to DMA mode */ ucon = rd_regl(port, S3C2410_UCON); @@ -711,13 +711,14 @@ static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport); static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id) { - unsigned int utrstat, received; struct s3c24xx_uart_port *ourport = dev_id; struct uart_port *port = &ourport->port; struct s3c24xx_uart_dma *dma = ourport->dma; struct tty_struct *tty = tty_port_tty_get(&ourport->port.state->port); struct tty_port *t = &port->state->port; struct dma_tx_state state; + unsigned int received; + u32 utrstat; utrstat = rd_regl(port, S3C2410_UTRSTAT); rd_regl(port, S3C2410_UFSTAT); @@ -759,9 +760,9 @@ static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id) static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport) { struct uart_port *port = &ourport->port; - unsigned int ufcon, ufstat, uerstat; unsigned int fifocnt = 0; int max_count = port->fifosize; + u32 ufcon, ufstat, uerstat; u8 ch, flag; while (max_count-- > 0) { @@ -945,7 +946,7 @@ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id) { const struct s3c24xx_uart_port *ourport = id; const struct uart_port *port = &ourport->port; - unsigned int pend = rd_regl(port, S3C64XX_UINTP); + u32 pend = rd_regl(port, S3C64XX_UINTP); irqreturn_t ret = IRQ_HANDLED; if (pend & S3C64XX_UINTM_RXD_MSK) { @@ -964,7 +965,7 @@ static irqreturn_t apple_serial_handle_irq(int irq, void *id) { const struct s3c24xx_uart_port *ourport = id; const struct uart_port *port = &ourport->port; - unsigned int pend = rd_regl(port, S3C2410_UTRSTAT); + u32 pend = rd_regl(port, S3C2410_UTRSTAT); irqreturn_t ret = IRQ_NONE; if (pend & (APPLE_S5L_UTRSTAT_RXTHRESH | APPLE_S5L_UTRSTAT_RXTO)) { @@ -983,8 +984,8 @@ static irqreturn_t apple_serial_handle_irq(int irq, void *id) static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); - unsigned long ufstat = rd_regl(port, S3C2410_UFSTAT); - unsigned long ufcon = rd_regl(port, S3C2410_UFCON); + u32 ufstat = rd_regl(port, S3C2410_UFSTAT); + u32 ufcon = rd_regl(port, S3C2410_UFCON); if (ufcon & S3C2410_UFCON_FIFOMODE) { if ((ufstat & info->tx_fifomask) != 0 || @@ -999,7 +1000,7 @@ static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port) /* no modem control lines */ static unsigned int s3c24xx_serial_get_mctrl(struct uart_port *port) { - unsigned int umstat = rd_reg(port, S3C2410_UMSTAT); + u32 umstat = rd_reg(port, S3C2410_UMSTAT); if (umstat & S3C2410_UMSTAT_CTS) return TIOCM_CAR | TIOCM_DSR | TIOCM_CTS; @@ -1009,8 +1010,8 @@ static unsigned int s3c24xx_serial_get_mctrl(struct uart_port *port) static void s3c24xx_serial_set_mctrl(struct uart_port *port, unsigned int mctrl) { - unsigned int umcon = rd_regl(port, S3C2410_UMCON); - unsigned int ucon = rd_regl(port, S3C2410_UCON); + u32 umcon = rd_regl(port, S3C2410_UMCON); + u32 ucon = rd_regl(port, S3C2410_UCON); if (mctrl & TIOCM_RTS) umcon |= S3C2410_UMCOM_RTS_LOW; @@ -1030,7 +1031,7 @@ static void s3c24xx_serial_set_mctrl(struct uart_port *port, unsigned int mctrl) static void s3c24xx_serial_break_ctl(struct uart_port *port, int break_state) { unsigned long flags; - unsigned int ucon; + u32 ucon; uart_port_lock_irqsave(port, &flags); @@ -1188,7 +1189,7 @@ static void apple_s5l_serial_shutdown(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); - unsigned int ucon; + u32 ucon; ucon = rd_regl(port, S3C2410_UCON); ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK | @@ -1214,7 +1215,7 @@ static int s3c64xx_serial_startup(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned long flags; - unsigned int ufcon; + u32 ufcon; int ret; wr_regl(port, S3C64XX_UINTM, 0xf); @@ -1259,7 +1260,7 @@ static int apple_s5l_serial_startup(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned long flags; - unsigned int ufcon; + u32 ufcon; int ret; wr_regl(port, S3C2410_UTRSTAT, APPLE_S5L_UTRSTAT_ALL_FLAGS); @@ -1344,7 +1345,7 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, static inline int s3c24xx_serial_getsource(struct uart_port *port) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); - unsigned int ucon; + u32 ucon; if (info->num_clks == 1) return 0; @@ -1358,7 +1359,7 @@ static void s3c24xx_serial_setsource(struct uart_port *port, unsigned int clk_sel) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); - unsigned int ucon; + u32 ucon; if (info->num_clks == 1) return; @@ -1475,9 +1476,8 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, struct clk *clk = ERR_PTR(-EINVAL); unsigned long flags; unsigned int baud, quot, clk_sel = 0; - unsigned int ulcon; - unsigned int umcon; unsigned int udivslot = 0; + u32 ulcon, umcon; /* * We don't support modem control lines. @@ -1759,7 +1759,7 @@ static void s3c24xx_serial_resetport(struct uart_port *port, const struct s3c2410_uartcfg *cfg) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); - unsigned long ucon = rd_regl(port, S3C2410_UCON); + u32 ucon = rd_regl(port, S3C2410_UCON); ucon &= (info->clksel_mask | info->ucon_mask); wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); @@ -1905,7 +1905,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, wr_regl(port, S3C64XX_UINTSP, 0xf); break; case TYPE_APPLE_S5L: { - unsigned int ucon; + u32 ucon; ucon = rd_regl(port, S3C2410_UCON); ucon &= ~(APPLE_S5L_UCON_TXTHRESH_ENA_MSK | @@ -2109,7 +2109,7 @@ static int s3c24xx_serial_resume_noirq(struct device *dev) /* restore IRQ mask */ switch (ourport->info->type) { case TYPE_S3C6400: { - unsigned int uintm = 0xf; + u32 uintm = 0xf; if (ourport->tx_enabled) uintm &= ~S3C64XX_UINTM_TXD_MSK; @@ -2125,7 +2125,7 @@ static int s3c24xx_serial_resume_noirq(struct device *dev) break; } case TYPE_APPLE_S5L: { - unsigned int ucon; + u32 ucon; int ret; ret = clk_prepare_enable(ourport->clk); @@ -2187,10 +2187,10 @@ static const struct dev_pm_ops s3c24xx_serial_pm_ops = { static struct uart_port *cons_uart; static int -s3c24xx_serial_console_txrdy(struct uart_port *port, unsigned int ufcon) +s3c24xx_serial_console_txrdy(struct uart_port *port, u32 ufcon) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); - unsigned long ufstat, utrstat; + u32 ufstat, utrstat; if (ufcon & S3C2410_UFCON_FIFOMODE) { /* fifo mode - check amount of data in fifo registers... */ @@ -2206,7 +2206,7 @@ s3c24xx_serial_console_txrdy(struct uart_port *port, unsigned int ufcon) } static bool -s3c24xx_port_configured(unsigned int ucon) +s3c24xx_port_configured(u32 ucon) { /* consider the serial port configured if the tx/rx mode set */ return (ucon & 0xf) != 0; @@ -2221,7 +2221,7 @@ s3c24xx_port_configured(unsigned int ucon) static int s3c24xx_serial_get_poll_char(struct uart_port *port) { const struct s3c24xx_uart_port *ourport = to_ourport(port); - unsigned int ufstat; + u32 ufstat; ufstat = rd_regl(port, S3C2410_UFSTAT); if (s3c24xx_serial_rx_fifocnt(ourport, ufstat) == 0) @@ -2233,8 +2233,8 @@ static int s3c24xx_serial_get_poll_char(struct uart_port *port) static void s3c24xx_serial_put_poll_char(struct uart_port *port, unsigned char c) { - unsigned int ufcon = rd_regl(port, S3C2410_UFCON); - unsigned int ucon = rd_regl(port, S3C2410_UCON); + u32 ufcon = rd_regl(port, S3C2410_UFCON); + u32 ucon = rd_regl(port, S3C2410_UCON); /* not possible to xmit on unconfigured port */ if (!s3c24xx_port_configured(ucon)) @@ -2250,7 +2250,7 @@ static void s3c24xx_serial_put_poll_char(struct uart_port *port, static void s3c24xx_serial_console_putchar(struct uart_port *port, unsigned char ch) { - unsigned int ufcon = rd_regl(port, S3C2410_UFCON); + u32 ufcon = rd_regl(port, S3C2410_UFCON); while (!s3c24xx_serial_console_txrdy(port, ufcon)) cpu_relax(); @@ -2261,7 +2261,7 @@ static void s3c24xx_serial_console_write(struct console *co, const char *s, unsigned int count) { - unsigned int ucon = rd_regl(cons_uart, S3C2410_UCON); + u32 ucon = rd_regl(cons_uart, S3C2410_UCON); unsigned long flags; bool locked = true; @@ -2288,11 +2288,9 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud, int *parity, int *bits) { struct clk *clk; - unsigned int ulcon; - unsigned int ucon; - unsigned int ubrdiv; unsigned long rate; unsigned int clk_sel; + u32 ulcon, ucon, ubrdiv; char clk_name[MAX_CLK_NAME_LENGTH]; ulcon = rd_regl(port, S3C2410_ULCON); @@ -2742,7 +2740,8 @@ static int samsung_early_read(struct console *con, char *s, unsigned int n) { struct earlycon_device *dev = con->data; const struct samsung_early_console_data *data = dev->port.private_data; - int ch, ufstat, num_read = 0; + int num_read = 0; + u32 ch, ufstat; while (num_read < n) { ufstat = rd_regl(&dev->port, S3C2410_UFSTAT); From patchwork Fri Jan 19 10:45:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523585 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 D5194C47DB7 for ; Fri, 19 Jan 2024 10:46:28 +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=tJSvcol7Yw4f7RJ+aQj1Z+BH5dokMMn6IQY7i524FrU=; b=JyMv3kmOwPYOfV JRwC5NS2Z/uegzNCs0L1n3tXW1VlmO5xBt3fCdXTuWONbviX6r65WvHi2FIpFKZnL/xf3pNK8wMg7 LS8fhJfAKIadwubIF1yU11C8oNssuuR9lrUf7lNM+cduClKpHYa4Rr7JrnnHauSGEFXkDvK7J1//C BkuvNLn8bVgsjCotUwXo2lP+8/dHZYlG6d56Y/xLT/YctrwCJZ/Ci7sFaMqkUmx3ZchiATR52VzWJ 8zGssvU20bmY5xPiCrhJm1FLojUpSHRqkbuqD/67Oa1Hld485Kv6eqc+SVTGS01iTg6sWxpLpaQ57 xf9Bpv7VHzkELUxAWsug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNk-0057UG-1U; Fri, 19 Jan 2024 10:45:52 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNZ-0057KX-2q for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:43 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33921b95dddso173650f8f.1 for ; Fri, 19 Jan 2024 02:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661138; x=1706265938; 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=hQ40aSkF8Aok0dVvTVGIVu4hOfQge6DrOyhL11J8cEA=; b=BRlGp3Wa3O+bovbPxy2tpBpjD2JeGb37mgmbVZRC8eTyO9/gMZMO/TRBEpzUdS993g Nm8E4XiD7YSUpnm4Y/oQi/Pg6c3ZHDXoYaV0xrqQqRI2LhWzbhWNdaQ76ULF6OxjMzfg aJtHADN6kb2kMRzd0hKHBGGozuB8DTX/pLcU+LTtzK98WzPJ7qF37q7dSsEWRVKA16dv JSurYmNZjmDO11FjRznCvUXl73pJ5+1HKLImvainqClpTzy9UKo+Y30Ae/bRufXYljs/ tYS4O1/S6ivygTSbCChDRhhqLE+HF0aBGl9bGg5WTHqbaHsVHN258frkwKT30T7gOccU XxTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661138; x=1706265938; 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=hQ40aSkF8Aok0dVvTVGIVu4hOfQge6DrOyhL11J8cEA=; b=S+PP7ZkI1B58rSnhhfSEIle8aDh+BOiU2WLXD0WgXEJB+0lUKNWb7u7BtyKt5qkkBm 3rhJp4VtE7wZ10Jhx0U6CPR2f5lEqq0iKiV2klG4oa7MHYtZMoVxXvt1Vw45y5FB/62e tn9RU7PjKGWxtOw37spkkXu0ufSnhM0gakvnn+AtkwN3w2vaNKA04aEEwIDwGw7uD7ik 71atlz7tkHkQaroM0kP/BVteDBP8sResKCp7iVdbelAYKiN5cUSZtRRmhCzmDWmhLe6B Rv5avwkccyJNi4IGgd8Kc4ZrueIq1v4Kv7LFf0+LL/mIPXt+HvHLE0IUpAfSTEbjxXZH cPLQ== X-Gm-Message-State: AOJu0YwQa6mghJpbW5kOSM0EJQvllma4+rwRbUbvog4nwoH+ENJ6WDC1 dyFNJDGgPz3KDfzRAybn4ABdP50JUZwIx9UqEVro1S6JUUwDOBSvh7zZFodN4zWf1MmNxkI+fqU Ip+g= X-Google-Smtp-Source: AGHT+IFB56z75wwv61vkNgNKZ52ys1BI0PMljalI5CjTRNffvDMu2NmbxLRBYtutQlkZKDjxtS4Jcg== X-Received: by 2002:a7b:c8d3:0:b0:40e:873b:cf73 with SMTP id f19-20020a7bc8d3000000b0040e873bcf73mr452698wml.54.1705661138275; Fri, 19 Jan 2024 02:45:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:37 -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 09/19] tty: serial: samsung: remove braces on single statement block Date: Fri, 19 Jan 2024 10:45:16 +0000 Message-ID: <20240119104526.1221243-10-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_024541_924379_5AE9F102 X-CRM114-Status: GOOD ( 10.98 ) 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 Braces {} are not necessary for single statement blocks. Remove braces on single statement block. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 8b396c950933..303b67498c65 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2061,9 +2061,8 @@ static void s3c24xx_serial_remove(struct platform_device *dev) { struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); - if (port) { + if (port) uart_remove_one_port(&s3c24xx_uart_drv, port); - } uart_unregister_driver(&s3c24xx_uart_drv); } From patchwork Fri Jan 19 10:45:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523582 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 7B05DC4725D for ; Fri, 19 Jan 2024 10:46:22 +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=lK72oZsWVikHjNel/SRXQ8EmciqTMf7skWZ55jcGdgM=; b=q66vX1a/nht8sa 8yZHq+X8Utxt/C5/Dfi0kL/aLgjS7DwHNGfEUOw7IPolUhIMKjpa1rTuWSy1hevswi5BGsygx9g+a 7jjeBntPW6rqcu2Q4i/5YSq0YWo0hpqvYZ/PSW7GfVeLKIK8sx1Q7geX853HxR/+sdsxlvCl2xyc4 w8VkJibwGRtZ62ZfM0+6xDFqKg+Vx9xm8orWmM3d8+5kyQ6wQ/GX+UBA5BEfP/c2092sXwXZoRcYs k/3rQ79cBEGrON1Lp/ax75mraHyL3ioMQ8AYqx7PGgJ38jVv+Yd0xT1Qn6W1k+b48mvaRNDZCpL1U k1SGrR4Ipw5OFGa8ZgHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNi-0057Ru-0J; Fri, 19 Jan 2024 10:45:50 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNY-0057Kj-0E for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:41 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40e86a9fc4bso7732695e9.2 for ; Fri, 19 Jan 2024 02:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661139; x=1706265939; 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=TK/43wqdGd1BmSd/bcLv2LcMLavutkwolM8oqYB4bwI=; b=hnHH+Tn45NrWYGc7R95u4TIVGTv+1yppNOWRGW0+NSrEU+v+hTExW8bsIXMt3mHrhF pcMvDBJetXrAOPzm7ztwvz7Vhx/nRhjn0P5Rrnp5ODL4Uvom2SqGgoX/0IIxwAmmJLiZ 8Pgfb7GR2r61HSWAZ+2Yo+XD1Y34I3pmyErqdPiks/dcq7Al3BBFF9YoMoqU6ezr6225 uK5Vf5S7ecAUUeIN2oGljTxHFdckV+0FjO+nUIpLPzJix8URb3vHkWtE5FczuZpTcxeD kUSA5z0NoMLt4sSqm4hUZF4XgjUEbZzge0xs1dwSh481lUbQgdPtXsb2LZwMRnzopihJ Ni6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661139; x=1706265939; 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=TK/43wqdGd1BmSd/bcLv2LcMLavutkwolM8oqYB4bwI=; b=FfCkCvAZYP6gDkASbmB8k/ho02yAhDbPUXRg/4CURKu4RFQ8PbU0naUyi2qOJm79kU RnDDT2+Wg35QTIWhUNbzwxdxEvQVK3BDWChZCLVLXB98H8e6BgFtOcxfxx2gHOY4SqD3 GWI8/gP+ZByOMCR/bHXeN5oUXkGvoRZc9YX5J/rBtKGyhroXYOJJHTgYsyqJBnVD7IOE kFyJOO1IIdOmyTlRd/Grmw+cHvWRwmOjzGBcvyD+8RZs3ltV5RzUwAssWOMexRe0XSYL jUu6btii6M0mhuEZoS8El4yjKC/8K99FqTw1iyE2mh+6dHvwX0ZFN3LoLsMQTHMuiivF Qg2Q== X-Gm-Message-State: AOJu0Yz3hmr51QzawIo5hab1LHw0vwxCZnotv1kQTwTYLQHciWnlWNzC oO4+tF/XJ5oc4YogbNl9SharVueiquQYmfcA9rYCkGi/XpWuAtugXvfVBWC/JNA= X-Google-Smtp-Source: AGHT+IEpbFblD8CYjgh0LghRYa+vNw+y1xW37yAzYgWrkcD5AoaCq81PCOmFUQXU5s/jy/U6ZLo7Fw== X-Received: by 2002:a05:600c:2205:b0:40e:3f09:78b7 with SMTP id z5-20020a05600c220500b0040e3f0978b7mr1187949wml.128.1705661138872; Fri, 19 Jan 2024 02:45:38 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:38 -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 10/19] tty: serial: samsung: move open brace '{' on the next line Date: Fri, 19 Jan 2024 10:45:17 +0000 Message-ID: <20240119104526.1221243-11-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_024540_110941_E7C1CA46 X-CRM114-Status: GOOD ( 11.15 ) 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 Move open brace '{' following function definition on the next line. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 303b67498c65..b6d34c9f46ea 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1739,7 +1739,8 @@ static struct uart_driver s3c24xx_uart_drv = { static struct s3c24xx_uart_port s3c24xx_serial_ports[UART_NR]; -static void s3c24xx_serial_init_port_default(int index) { +static void s3c24xx_serial_init_port_default(int index) +{ struct uart_port *port = &s3c24xx_serial_ports[index].port; spin_lock_init(&port->lock); From patchwork Fri Jan 19 10:45:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523586 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 34C23C47DAF for ; Fri, 19 Jan 2024 10:46:30 +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=3S0HKX3BrUXBr8HUJwqqI0eyQ6KLvNBX1R/W2KsLtt8=; b=GLu7XJgaO6xcmA d190vjZ6GsEO6OfH3Ef1M4oS5g3Xy9pNUPEn67krBgXiJhD4A4ddt9hvfn1exn86tLGSoz79HflT4 KeqeGEdUcICT1BZsuyr3jwjDtGaA/b1gi/UKG8HCb2sVPgnkBv1oysWvsJL0V4kOP09uh0auP/bgv 6030ltP+m5O6CqgEtWX7Hp5X6McvJyLHftvN07U8bJkJ4WA8CxwR8wlGoso5oBv04/GiMk+Vzs+Sm gy65C4NAdVt5zRIsP7jP+ObeByFYPokvl0lUIVTwNj4V4rOXInOj/MAPNmvTGVfOjdW6ZkSadVdQ+ 6s9txV1Ejv1xG5KXH4Jw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNi-0057ST-2A; Fri, 19 Jan 2024 10:45:50 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNZ-0057L7-03 for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:42 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40e9ef9853bso1969115e9.1 for ; Fri, 19 Jan 2024 02:45:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661140; x=1706265940; 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=sk+f6DMfyT8RxC2Uq+wxFTBwK9isaqVwqfpa2TVfflc=; b=VZrMN2Oh0/7D7lUysNLPjYPUA7ujw1/cWYJTYjkzLkb2g8ae3GmNQQtmFRQed8uzZt 02FcvoBw/TYwwCNkcegTjcktllWabpSpYR7W8t2IkgvGWME0REzJj3+y0p+iG9HLrSJQ KPpBx/FCYXx736BsfO4dMhSVbblYGR1xqKhH/LAIgfLKI2mXdw4MaNRJMPfk8Z3PeMfw DSPAqrEaIRkFPcTzrkUm93oR1HmirZF9zHGm0b2vWfbkHcdaYHzeYX9WwRO3uRD9zLVp WfFXSoLIUxsS++6HfN9P7+kz1hea3eYbAAlPZOabT7bNzxdz3LEgTi2tgbN9S4nozm/9 rfMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661140; x=1706265940; 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=sk+f6DMfyT8RxC2Uq+wxFTBwK9isaqVwqfpa2TVfflc=; b=RBQPflfEAHDiiX7z4lBgSK35E8dKyp30L6DwGYToBLCSz/cS6NMCPnlWn1murtmRs/ Wo9SlPmgb56IZfSrVi2nXG7ACVLPJ58w+pln42AJp8iabUdO/fr3TBtgWYLRHkn2BS7j EgP85/y62ojp16JmV59rbPxKfz2Z4bjT23Yhw6Ysq1wqFE5JVUE+5Ih/5L2A4ADyXflN Iy7tk5AduVaeXs/7cLsOki9duymm0BAGK9NV+IdllFX/CRqxfG9PmC5ycCnFLouVohY1 kQNgsTJUdkc5vupRM6buogIHGl8VVejrm5wxBBHcbUMa8TXGizAHvBUNRVGSyYhC1DKO p1YA== X-Gm-Message-State: AOJu0YziFQLmoCDlDTKMhgZaz34juTcM7S3jxOuR2JgKtIyuu7m0P4Us L679cl/VShutHfK5zPh0VJqDPD78dwHAFWlErdKM9MA2r+p4L91MRYfzu/dNYcc= X-Google-Smtp-Source: AGHT+IG8YnM5QzfuxMFX1zhOVACz3KiL73IJvltttYQcWx8JPktpxDFvbwhDtd+mk26mM/jTJgFwfQ== X-Received: by 2002:a05:600c:354f:b0:40e:88fb:e8ef with SMTP id i15-20020a05600c354f00b0040e88fbe8efmr417899wmq.4.1705661139905; Fri, 19 Jan 2024 02:45:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:39 -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 11/19] tty: serial: samsung: drop superfluous comment Date: Fri, 19 Jan 2024 10:45:18 +0000 Message-ID: <20240119104526.1221243-12-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_024541_058089_C5A20B3B X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. 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 comment brings no benefit as we can already see from the method's name, ``s3c24xx_serial_pm``, that it deals with power management. Drop the superfluous comment. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index b6d34c9f46ea..4bb75b1eceef 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1295,8 +1295,6 @@ static int apple_s5l_serial_startup(struct uart_port *port) return ret; } -/* power power management control */ - static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, unsigned int old) { From patchwork Fri Jan 19 10:45:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523587 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 EE1AAC47DD7 for ; Fri, 19 Jan 2024 10:46:29 +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=ncvYyGdvBm4MM66IWKoQt1+pgYvrRbjujrZ0fdkAI1Y=; b=kCyCegakluwd2k vlteoXMj3r2ntfwIrAhxt8L0lPBSDfsU5indyNHNb81K8T4JcUIq8LUh5b3uc4CJqb394NzZWm8Y6 SIorM5LFczusse/GUM3yGCJXmR3cKSr7y4j8h3B7QZ2Cs4zvDceXCm5WmlAf8xGhTDgjlkR3SCqxm u+X9s/LsdMX7OrwopqBXHvHeOUR2Z9r3k5+FJ32mRWqrZZc5GNqrFK1q8ohwhFeRYNJII8MQnZpWn 6FJyS8OUXc27BtcnpSjQzKxuzl9U3iRm2qcvq+XGDn/ba3mEW5iBIXSuyTcdKX+R3wLcOW/KLq72i GdEd6jg0sYa9rMi8W9Xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNn-0057XJ-1E; Fri, 19 Jan 2024 10:45:55 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNb-0057LL-0T for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:44 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-339237092dcso51796f8f.3 for ; Fri, 19 Jan 2024 02:45:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661140; x=1706265940; 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=z2lQIakjCIKG/8t5br1DwDXAqAW0N+QdSof5GZ/rHIk=; b=Xkx1grrZcTZAojIWUblF0ZuP1dfjKWNC3UGEKY1CadGFT2sb9r9DQD/e7Xt3dQZ4xH /F+p+3LFHmLvcr+HkufHNaGkFv5ygIVlfDMazsoTYlLscHDrI/Csh7J1P0F+W8kNweiz cpZlhYxziLJgeieTauRoOkb6Au+j4PmtZjAOU/bjyFFOKSx+UcQ8hvkdJ5xQ+K6wmHsg FjZfQq4XmEbkyABzRD7+eT+XacPcwinc46/UFiY6fClE364JwWwaOEulchvMmtq8MiOy faiO+Qi2y1ZWLAz2EpFPXSKPJAX/ZZfrXfvvEswtvvQIfJkUypp8vKWCRZUIu8qzALxU mgtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661140; x=1706265940; 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=z2lQIakjCIKG/8t5br1DwDXAqAW0N+QdSof5GZ/rHIk=; b=CfwfvkjzTnpoXS9htHhzZ5cMoTZ4tVYm/TBn6pAospIuK3UBQ9yYrVLvl9HbB6JSVH x8Hq5EIaeXSDYTupTPizSKKBRUrlIkX7rpwBPytpmU1M9ypFJORg2k7qaBRxUW5cpoTm Empf/MzP0sh05I+ABN1gsaA/o8rvvQjROyqtaJh8OlGheAf92oFO+cKrEFxn5Fnh0lLj 4vLRcYHFJha+8eAJ3h8yCDGse7zCPQbV0JgJ0uTLwDY8gHdZBtERURU/d1cBgVJOevT8 VQWim0sIJYhoUppILuttPAU4S9x/LQucpsAJRpujaH/kypx9WGosEwK4u/atzQoYKq3n CBUw== X-Gm-Message-State: AOJu0YxLiPVsee7sQojblTo38NjcachatAcveMRY5bojXwjsNsqvjg0D 5OeJ+D+h4Gg1m8WIWopfnjsS9N+/y7dQ6GzPOAMPVXwj1shIiNpIbBr4eZpmRmI= X-Google-Smtp-Source: AGHT+IHooBhyW3xlDtUtOrRtWsnJD3eWRLbdkXu0zI8InTcaCbu308wM5VwUc4M2ZuUJ65W1vn7Buw== X-Received: by 2002:a05:600c:3b26:b0:40d:88c6:b9b with SMTP id m38-20020a05600c3b2600b0040d88c60b9bmr1315643wms.123.1705661140719; Fri, 19 Jan 2024 02:45:40 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:40 -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 12/19] tty: serial: samsung: make max_count unsigned int Date: Fri, 19 Jan 2024 10:45:19 +0000 Message-ID: <20240119104526.1221243-13-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_024543_187739_D51169AB X-CRM114-Status: GOOD ( 11.70 ) 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 ``max_count`` negative values are not used. Since ``port->fifosize`` is an unsigned int, make ``max_count`` the same. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 4bb75b1eceef..f8a8b459a86b 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -760,8 +760,8 @@ static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id) static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport) { struct uart_port *port = &ourport->port; + unsigned int max_count = port->fifosize; unsigned int fifocnt = 0; - int max_count = port->fifosize; u32 ufcon, ufstat, uerstat; u8 ch, flag; From patchwork Fri Jan 19 10:45:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523583 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 F388FC4725D for ; Fri, 19 Jan 2024 10:46:24 +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=ypmF1t81S0sYBzi4tC2MPGlsz++LptqjhmIl6a83dwE=; b=A7Egy2CF3saVYW WxH4aM9izge1NRUTQbaYOfalAC3RCUVvTOwaBr+1tegugSpj+ZG9to8/oBFJlUgR18yE54dBNMot+ WHKZruNyUYQoWhUlLG+bePY28yWXSiFnims/6d8H9gJ/ZZ9eqrYVmSj/Vm+JC0GPxAnY2bQ51Tb5e 2gES9lQ0Pihjt5utNsXpB/iffJ4a0E11J/QpC8OEQW/kVtMATKCUhs9Z2eXYT+vCdvKV7asdfJiV3 eeavV+BJdj9xjB37wXI5VmVuyn2VA3zndAl6x73lsC5+FV9c+VDsWKPc9Ow4Z9v3W2wIgWuHC/vrI lgQbNn+Pvg503ZZSEVrg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNl-0057Vp-1j; Fri, 19 Jan 2024 10:45:53 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNa-0057ME-2f for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:44 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40e8fec0968so7820295e9.1 for ; Fri, 19 Jan 2024 02:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661141; x=1706265941; 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=BKtqqOLjqJGdMtonI4P5mEMTKVliGwJ+zwCnWH5C8bk=; b=PjtjlkxyEVC6svvmR1p6W/W9cLE29UVwVLDH+P8sBdG6HZXnGewjmxdxK0FYFgWloh 6GY084f0/Oq4cmOgd3wPWX0vO7YkPnlaOAFambbCWs29mjYpZehXOQcHPHmKx4bLmANV ZRgRuPxEhrAJpcVy51cPZ60Sin4s/qdYvNm365aRAKYfPMYsufw3Jnqf90jSXbO0l5sb 8Y9eMwOzwW8TCAJ2PVF0MjWnqTQzJI0jaQjufW0e2T55BcxfBoyekmJsHdYt7/i7qhTa T3zwdhSHH7x+fS+N5e8Va4j9KxTH9joV+2RuiHipX7IQ5oK7W49wWEIlXWtYdoSceEFh ZtgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661141; x=1706265941; 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=BKtqqOLjqJGdMtonI4P5mEMTKVliGwJ+zwCnWH5C8bk=; b=tjoROxTZIvhDWArob1NZBljv9uREFIvVVLKKfKpVykSyG/OJg/5Tznl6Cux5r32Swd ISoVoZOdkG7j6DlP6dSk9eyYzhWcx/0lV4eTdD0FvNT5OeQjBTgAXWKeJlU8GQ98/YW1 2yODXmdfNJ/VbVJCAM0yH55/pYX/o2uR2mWLmITI+8Ejcsq4/xsFooB7vSBiMobKPt7y AlN7rroa855Ni772BWlZ70Lc4awFO1vuj4xp2YPRvzKWk3FC/fUPabS8FSQZP6gVSFqK PeeKS+mt/DOcrOCEAL0mqlXan0jIFCusU5Yw0+An7lNRF9ZX9IDSaBCu7YTmJXhIq4To v6iA== X-Gm-Message-State: AOJu0YzAsfaOP3fh2dIunGOLskza8sYigRAM573hDP06FOVzN2by7XBX LSUTZ1aHMXF0UJZrUf7FKowbn4zzn41SvNORIEyFYChBe/CSqz4cNLkSQUHHnKT0ChGf8YblpY8 fRJM= X-Google-Smtp-Source: AGHT+IG4Y1qsP7t7ylEa/vU+m005rweLwKBMwyulcKNBD5OybDrKdZCdyTNr5tSCDvcQkIt7aSdNiA== X-Received: by 2002:a05:600c:5116:b0:40e:86c0:1d16 with SMTP id o22-20020a05600c511600b0040e86c01d16mr1301827wms.150.1705661141695; Fri, 19 Jan 2024 02:45:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:40 -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 13/19] tty: serial: samsung: don't compare with zero an if (bitwise expression) Date: Fri, 19 Jan 2024 10:45:20 +0000 Message-ID: <20240119104526.1221243-14-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_024542_865256_503F097C X-CRM114-Status: GOOD ( 12.63 ) 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 bitwise AND with the fifo mask is used to check if the fifo is empty or not, it doesn't care about the length, thus the comparison with zero is implicit. Rely on the implicit comparison instead. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index f8a8b459a86b..333ffa3a76a3 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -988,7 +988,7 @@ static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port) u32 ufcon = rd_regl(port, S3C2410_UFCON); if (ufcon & S3C2410_UFCON_FIFOMODE) { - if ((ufstat & info->tx_fifomask) != 0 || + if ((ufstat & info->tx_fifomask) || (ufstat & info->tx_fifofull)) return 0; return TIOCSER_TEMT; From patchwork Fri Jan 19 10:45:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523592 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 A2DEBC47DAF for ; Fri, 19 Jan 2024 10:47:04 +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=V0JHFomiWZHrpcPRULKJicmhQCcM0iiX3bywh5S9hmM=; b=spyJBmg/pqr0aJ fcd6BYEsjgk5hyc0ouiLa3EL99c28nl4sxQXCM8Tzuvw/ubcN0+nUOhc8GMlTFhogwyAVIJg3DIWT sjNWIZ1amK09UNDbATqD3MOkusozgWCsjLMJbR7Hf8H/lhv7lZ1hu3cQ0CM7vG10w8djVGl5p2E5/ 0iTanX7lFU9/F7Agmmszig/67J3Hd2rJhgaDi4CAOLSBCc+YoZjx5TwGhcRE7kH3Q9lDBdgSkYHfx U7lOICMRiGRkZaWuIaHbtfnRiF5k6yJBYgHEV210fS0Hbzvv0js7CvftO1eUfLe5ntW3nYHNUY9z5 8T5tMPLNRojEMmYY1f1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmOR-00584B-36; Fri, 19 Jan 2024 10:46:35 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNe-0057Mh-14 for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:47 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40e9ef9853bso1969465e9.1 for ; Fri, 19 Jan 2024 02:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661142; x=1706265942; 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=aNVrIVfmeLqNWh0q32FnE3SCbDOH2rJsoikX7ZaHXN8=; b=SK3WQFgcJM7hmLXN+lM3OoAve9cs6stxy5xOwJR8KuJCt22g8hGP4njS/pZWvT/EkU UzqSiawd2j13dt1VyG8K8kkQmbF+WMdMZWOWQ63yehUEy7mpr4VbQrQZlp4ZnN1huKrQ vc2t1JP7EPZTZPLKmMnCM+y+zl+y86tW8Bwgh0PM3h2t3fEEC+yjYLn1/lvymD6wf9J/ IozKmhpFlHOPrki+pZcN6xc2WMqTciXzh0KHGS0daYyzEO1mW+lj3THGXepXU25Mk3e0 VlwrnMX0OJWAVussWGL3M9WoVs5jeON5Hog43PTVc2Pp3A4sRY2zocWlfgrfBesJrOA7 +8nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661142; x=1706265942; 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=aNVrIVfmeLqNWh0q32FnE3SCbDOH2rJsoikX7ZaHXN8=; b=rAwBm+EolgHXT1ZT19n8g0ryD+keiDU/9ej86L/vqSIffEMSYHWV7KKM6h4yt/xG8W 1kiuKBb+FYYve43saN07zEw9Y56AYvw41FTawOdirlX+s3yY0lIn8d5cTPlKujJGZRdM LscUvuSuGm8FTeTX20pd7WD/4B/0jpxthB4F2KI5iiUEK6MfokyKbRW1Q3AZvFFJcq51 0w33hgSV/l+zap5FTV9+Lq5W1ZstPaxr+AE4q7j7GoSlrs38xi2Tivh0Jx307H4dCtHN GJeeFLWxhh5dNuWt4uRVN1WFzb12VAlvIEQM0JLMd6VBgsuqY7Le3tA9jHzp73UWCjbt crmQ== X-Gm-Message-State: AOJu0Yxg5z2pUm1QpuxdBqbv2h5pfeIhpKKmUNa4iGSi8ShG1cXSJxA7 qx5f1snKs/otuVXe612WK6SkqUjjjU9K8Ix7301A9MDL8/uyZkqBfuSuJKdff9o= X-Google-Smtp-Source: AGHT+IG1Zs80+jewlD9VzzkTPw9eOk7A/qP/u9l55zJeijZCyenfdFg/MX5eIVS2ZxYAe9I/6F6bSg== X-Received: by 2002:a05:600c:1392:b0:40e:360b:e3e1 with SMTP id u18-20020a05600c139200b0040e360be3e1mr497918wmf.13.1705661142682; Fri, 19 Jan 2024 02:45:42 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:41 -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 14/19] tty: serial: samsung: return bool for s3c24xx_serial_txempty_nofifo() Date: Fri, 19 Jan 2024 10:45:21 +0000 Message-ID: <20240119104526.1221243-15-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_024546_402120_172A30DF X-CRM114-Status: GOOD ( 11.68 ) 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 s3c24xx_serial_txempty_nofifo() returned either 0 or BIT(2), which is counterintuitive. Make the method return bool, and return true when TX is empty and false otherwise. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 333ffa3a76a3..90d697def5c7 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -236,7 +236,7 @@ static inline const char *s3c24xx_serial_portname(const struct uart_port *port) return to_platform_device(port->dev)->name; } -static int s3c24xx_serial_txempty_nofifo(const struct uart_port *port) +static bool s3c24xx_serial_txempty_nofifo(const struct uart_port *port) { return rd_regl(port, S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE; } @@ -782,7 +782,7 @@ static void s3c24xx_serial_rx_drain_fifo(struct s3c24xx_uart_port *ourport) ch = rd_reg(port, S3C2410_URXH); if (port->flags & UPF_CONS_FLOW) { - int txe = s3c24xx_serial_txempty_nofifo(port); + bool txe = s3c24xx_serial_txempty_nofifo(port); if (ourport->rx_enabled) { if (!txe) { From patchwork Fri Jan 19 10:45:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523590 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 AD8E2C47DAF for ; Fri, 19 Jan 2024 10:47:01 +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=yqfKcpO5zsZXS+GReM9eMKM7fv46DwUEByyXLbq7g/w=; b=hSkZHU0tcAVY+c 7ppL0Q/+KqQ59cKhQ5ni3HnMsIv3UH/WmN5bbeT/ii0mo8eccRQejE/xN1rtZvZfkO39RTdHSTcX9 LliMTSIqBQEMaooHyzvpIYV7vkyHPuk1pvY3qLwWYi2jjp/1mhssMiKdZv9J1vtzfauXchz+BtqaV CR8DqJ0XtT7DHpu/6VyAheKxmpSAZAvDum7q9DmEcuRONrq4wgcosH3wUjI/2XxTB4otKom7RqPgc DTPypugJc4qvSKFvqsbf7cFGiUUZzXtGpmrWHiahhQ3mluvWG7dn+FzlD74TWpZGnOxhTW3Ifu9Fa 1rapiRrJaDEYlgTQ9q3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmOQ-00583B-2O; Fri, 19 Jan 2024 10:46:34 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNc-0057NC-2B for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:45 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40e60e137aaso6723915e9.0 for ; Fri, 19 Jan 2024 02:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661143; x=1706265943; 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=Xja7r4IqoFurQHPVGT/1DVUThNq/9DBjzzyZqX4X0B8=; b=CtncIbZJrDWxao8Dhl0Bn5kC0vvusIIXQJk4fX0D5qnjHzR/9EnBbknMCmZWjT6hwF cCDCV6eqxlBF/DIqzTm9tZoRgTRXJSOI2sl4UGiBnwAAMm9u1SpU3c8Mj1CgG1IqQz5a 8ql9v03hawiA20VGDyqP1RXtBfPOneiaad0F7sVPRn67NUWtoHq9p5MmxAK6puo3AYC5 WBxHhwPalKLTu/CJKsKVKPU3rrqT/H5n9xYnLhbSkQS1YjmmBuiH1AwO6dOYN6jkOU17 t+ukPbccis5diZJXHBZPGCbhveI9TnNu0zFUallgApqtVOGPTra0hU1nc0aR8OxD2ktl jvWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661143; x=1706265943; 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=Xja7r4IqoFurQHPVGT/1DVUThNq/9DBjzzyZqX4X0B8=; b=uNMwjk/eP5DLBvAkhMCpXMNHvl2WS5amarKy7ORNTmVNMGN3m0R7bBjwSfYTVoflEh y0EnXWe1cfdP2vraexA/BnDDZvRwad8IpZEJQhYj/NvTU2pP4zZzyI0RFFyPKUqpD/EC xoIolPj/mzW7UhTWJSRAEit6nLgz+qEgIXzzaH7yjeD/Lu2XL92+DQV/AkC8T9OZNBpG /B/JiidwcMa9QkQp3dwQqst4bdFj8TgmAwlhTKoUg2YftAPCUn2zS9YAwggn5DeZFtlJ 5GB0pSJL1DP+BG2xVr64dIhwJZyLHBpaY8WvALDIw79ZlCxwKp1up2H4HJNxeEf/fKcw MexQ== X-Gm-Message-State: AOJu0Yy0KNnFUaMBiFt4kBAGq/gJsLryLT4L61uBEAW449N843vOr1C4 FXisMbxv/yMILsrRnPUK9CGh1De0ZDMF7d9tMcHpsNA4abd588AaQc5aRAslesc= X-Google-Smtp-Source: AGHT+IH2PpdF1uUhaQRfj7t0SInB7+ZgNuwheiqs3dl7+iJuzGY08czS9RbIuf9b+VH9MlmAEuFIsA== X-Received: by 2002:a05:600c:4ab0:b0:40e:37dc:2dd5 with SMTP id b48-20020a05600c4ab000b0040e37dc2dd5mr1306935wmp.135.1705661143501; Fri, 19 Jan 2024 02:45:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:42 -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 15/19] tty: serial: samsung: return bool for s3c24xx_serial_console_txrdy() Date: Fri, 19 Jan 2024 10:45:22 +0000 Message-ID: <20240119104526.1221243-16-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_024544_714587_E6A68225 X-CRM114-Status: GOOD ( 12.56 ) 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 s3c24xx_serial_console_txrdy() returned just 0 or 1 to indicate whether the TX is empty or not. Change its return type to bool. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 90d697def5c7..bdc81ab4af91 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2184,7 +2184,7 @@ static const struct dev_pm_ops s3c24xx_serial_pm_ops = { static struct uart_port *cons_uart; -static int +static bool s3c24xx_serial_console_txrdy(struct uart_port *port, u32 ufcon) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); @@ -2194,13 +2194,13 @@ s3c24xx_serial_console_txrdy(struct uart_port *port, u32 ufcon) /* fifo mode - check amount of data in fifo registers... */ ufstat = rd_regl(port, S3C2410_UFSTAT); - return (ufstat & info->tx_fifofull) ? 0 : 1; + return !(ufstat & info->tx_fifofull); } /* in non-fifo mode, we go and use the tx buffer empty */ utrstat = rd_regl(port, S3C2410_UTRSTAT); - return (utrstat & S3C2410_UTRSTAT_TXE) ? 1 : 0; + return utrstat & S3C2410_UTRSTAT_TXE; } static bool From patchwork Fri Jan 19 10:45:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523588 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 895D8C47DAF for ; Fri, 19 Jan 2024 10:46:59 +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=bwAMXuTMl9Ow5Id9Nd3GqAe71W0jfqvgzqzCI5ZKGuA=; b=egzjMKw1sPPJbu +VARHxJsT8oVjjEcs5iInyt0j7YSIiXRcAxuw3fs1kfeQkCqlBuUT1v6n0j2wtPipeheYLl/SsypF ogLcUeB8hPnTB6+4/W0bM9p9bHb/kjM95r3cjHiVNvNJY0yOi2H50a8jQCw++QRsbXnLrMLO9DN6e Q5LB8DeF5v12Oji3nvHZqSSt7Za1JSMcEpY68GuygepJk9eLUaPcichnTrBrlu82etQGPu4sz0lLs 3JM60YfE/sShA2+p6sITWoQ6cJPWbFhrDcZjxV1IQnXObBRUBMrmf+tZPdzSjivyAUC+K8MaQL1Mk Wg1jNpBog6PfdWB0NIqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmOR-00583W-13; Fri, 19 Jan 2024 10:46:35 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNe-0057Nn-14 for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:47 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40e87d07c07so7157705e9.1 for ; Fri, 19 Jan 2024 02:45:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661144; x=1706265944; 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=jN+fQndYHigW1BmW4SX4atdBHvISKmx6Ya22q2f2b7k=; b=OfDkqFO31WewR91q7XX/7JKbJQIJ7nLkDk1iHTn8bWIO2X6jdLEEAUHgBcW9+Vj2mp /dbkuI/QvM0qAwJd6vu2cWoTcIp3JXksgmN46BhCgDtnv3eM4EAetoPLrejvw+HA+pWV Fg7+og3m7bvLI+eebvbJVidrdxxNrZDVmH+bf+yNit4KLEAQVKUyV9ATHfJkVCtvBzdY aYqQrtQYDGxBaFY+CmUB3FqGKLUthlk9T4cyKhM1tKQLkzRq8GVB20kpojQ4987dqoRx eRoc/BSNvX4KMtPZ39E2ihHylLt/giCJjv9CZpBpp+jxf1VQqYvSMcnYfkImSDXPJL4/ jFBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661144; x=1706265944; 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=jN+fQndYHigW1BmW4SX4atdBHvISKmx6Ya22q2f2b7k=; b=e/jEFAqMlFW938TD9XrZ8pLcCRe0KgjG5VlStAxKP2xWYap1bvpNjfLRvax01+z/gm vYj+CDJyl4mdnwuz+8sURbbOhbJj5xpQR+j3dSfPRBHtQsl7C8CWkOanTxCAP1BMPrMF t/Zc44OKfz9iJ7/YKpyNC48Bi4UlM9W5nkhw6LMWlLq04/3u1GjjD70uriomkXLLND6S PK9vFl/VdMlMZ1I8YY6zv6GpU30iOHlWe91p/19WOdjC4zfeaZBQrllvP3Y9pbXT/DJz Ij5r1IVq7+pEaAgVG42W7d9R7oJNBWwNScNbwPLiQz4njdEQyR9TdDGHL71HPIRyDFNh kZrg== X-Gm-Message-State: AOJu0YzkR/cSOgUzP2LgZuI4iks/B4bUTstq/MSS8iwweC5OceV8I+x+ XfeNWk2b0XFlqkVswXlngQMRhjcDoY09GTAHm9uAGevgXuXZ9oe/KKrtIs+9Euo= X-Google-Smtp-Source: AGHT+IESCI0xwQtlxycw4w9Pp/Uibs8E4kCALIGxSJJOl9KNU6Y0tZTNZnEhjSdZQgdmVkwjxlMlKQ== X-Received: by 2002:a7b:c4c5:0:b0:40e:4576:53f7 with SMTP id g5-20020a7bc4c5000000b0040e457653f7mr1371128wmk.49.1705661144272; Fri, 19 Jan 2024 02:45:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:43 -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 16/19] tty: serial: samsung: change return type for s3c24xx_serial_rx_fifocnt() Date: Fri, 19 Jan 2024 10:45:23 +0000 Message-ID: <20240119104526.1221243-17-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_024546_420294_4B8F6F9E X-CRM114-Status: GOOD ( 11.84 ) 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 Change the return type of the s3c24xx_serial_rx_fifocnt() method to ``unsigned int`` as the method only returns the fifo size and does not handle error codes. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index bdc81ab4af91..149f618e22ce 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -590,8 +590,8 @@ static inline const struct s3c2410_uartcfg return ourport->cfg; } -static int s3c24xx_serial_rx_fifocnt(const struct s3c24xx_uart_port *ourport, - u32 ufstat) +static unsigned int +s3c24xx_serial_rx_fifocnt(const struct s3c24xx_uart_port *ourport, u32 ufstat) { const struct s3c24xx_uart_info *info = ourport->info; From patchwork Fri Jan 19 10:45:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523589 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 21205C4725D for ; Fri, 19 Jan 2024 10:47:01 +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=OqMOckBtmxaognBcJy+swh6VjlkERslIQqy+ot5BTXg=; b=kqOBHRX+nXp3T/ 96BYVE+jOb9jSOVeLuUfssarlciowMPJHhjOQByZmgE+BP8Gsx7AwNNpPobbiFbxZyvjdHHOh+LII 9HH7PGvenYwqXywptdDWgT8rotkgVgHTRsVEC2jTw+dm0237puRirjLSMMBKdiQEYe0/bg83y19+i UfWCxMZwJqmYtZomgbOsSjGSLEGrg1RYW+p+LbnFSBAzEK7Kj1T1APYoeywYFZOONUNJCRUPvBWPC lsI/vFpwM06gwJEn/Ww9gmxJI8AwCXHj4eSLtzmIjqofDtZ0cVCN9Q0HwcLAIDnSbqJA39NZTh/wL qA8qa8wd0O7/4FP+3Trg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmOS-00584i-1z; Fri, 19 Jan 2024 10:46:36 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNf-0057OA-2L for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:49 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40d6b4e2945so6823345e9.0 for ; Fri, 19 Jan 2024 02:45:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661145; x=1706265945; 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=Nwo45PT47NHmv38PG0rfELhMxvzOHKS168E5xQGMKNU=; b=idSYUOtGMzZScAucz7AjoSMaHhbO8nvOVbJ7q7ynzDWKdWN1Wuba/AzAMmRxiJLRSY mBD0jvuEfiOpgi/s08XmQ+zmkxwXC8XbDnmTCYUY+Gytesmvk99PM1tgH2dIudyk3pdw ccmh4e5dCTJeaf+s/6WgnpQB9fvcnoodkxib9SeRan9ESpnFgZOJdb630uv3gojP+9fj q8bJXlM/K7dTa7PBRJXi4HEGp/55mCgfRY2lJOloB3M3lT2CmMkz5YcGFNKGxNJpDaKN fxwH6VKO1Ln163vCX1+D+qpfzPiyl7i2+HDCOVRiSubeBjk3NoU7tEe8twImxPIuXzqJ BjGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661145; x=1706265945; 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=Nwo45PT47NHmv38PG0rfELhMxvzOHKS168E5xQGMKNU=; b=MtwB2fg8Psms1e3VgXdgcuugPLXvBLRkYdhHtqyJkyXtgyV6C2d36IfZtcjCYkGlK1 aFfTxutVGLzxV6Yn7T2v5+E2gPzStz3SntJxkqLGPJO5wyL2bAWWBa+NdL6XnSPCpOK5 EvJyjxqbN+OnIenFvrxYB8hjrD4KQ+Q4gEHxjKD6y3j8upMcfn305gHwbd6bb79bSNov PKwx4v9ToPcNsSGCRM3HtG+psWNPgBkCTfm/MG3AOcNQzGv5OZhXCPuTBKNwNm0rOwr+ s3PAH+2hT5AjeTor0FRHbwI5C6UCB6THCtXfJx52dHJxkseLarAhE6Yrrxn/KTvtTwSM yCCQ== X-Gm-Message-State: AOJu0YylXqVrk5JXUOydTx9VvzsUdMZVjHvyg/q3DP3dZT71ff6eWA9+ gN4uFgaxWM7et7GbSNh7YKtVZn44RMt7EuJyWnnbANoS9qOjv11DFJeqrybvCwM= X-Google-Smtp-Source: AGHT+IGDB9vqcXlGOfTsqQDi0fDJITgrOZsH9TN5J8Bnk1BdqNWsb0qFE7oeW7Dj1+a5XuLSTOkUiA== X-Received: by 2002:a7b:cbcd:0:b0:40d:6f34:5c13 with SMTP id n13-20020a7bcbcd000000b0040d6f345c13mr920130wmi.231.1705661145026; Fri, 19 Jan 2024 02:45:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:44 -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 17/19] tty: serial: samsung: shrink the clock selection to 8 clocks Date: Fri, 19 Jan 2024 10:45:24 +0000 Message-ID: <20240119104526.1221243-18-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_024547_791135_AE82CD10 X-CRM114-Status: GOOD ( 17.25 ) 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 provides a clock selection pool of maximum 4 clocks. Update the driver to consider a pool selection of maximum 8 clocks. u8 is large enough to allow more clocks than are supported by the driver now, and not too big to cause spanning of ``struct s3c24xx_uart_info`` through 2 cachelines when compiled for arm64. The goal is to reduce the memory footprint of ``struct s3c24xx_uart_info``. Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 149f618e22ce..c429029c0207 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -81,11 +81,11 @@ struct s3c24xx_uart_info { unsigned long tx_fifomask; unsigned long tx_fifoshift; unsigned long tx_fifofull; - unsigned int def_clk_sel; - unsigned long num_clks; unsigned long clksel_mask; unsigned long clksel_shift; unsigned long ucon_mask; + u8 def_clk_sel; + u8 num_clks; u8 iotype; /* uart port features */ @@ -1340,7 +1340,7 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, #define MAX_CLK_NAME_LENGTH 15 -static inline int s3c24xx_serial_getsource(struct uart_port *port) +static inline u8 s3c24xx_serial_getsource(struct uart_port *port) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); u32 ucon; @@ -1353,8 +1353,7 @@ static inline int s3c24xx_serial_getsource(struct uart_port *port) return ucon >> info->clksel_shift; } -static void s3c24xx_serial_setsource(struct uart_port *port, - unsigned int clk_sel) +static void s3c24xx_serial_setsource(struct uart_port *port, u8 clk_sel) { const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); u32 ucon; @@ -1373,14 +1372,15 @@ static void s3c24xx_serial_setsource(struct uart_port *port, static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport, unsigned int req_baud, struct clk **best_clk, - unsigned int *clk_num) + u8 *clk_num) { const struct s3c24xx_uart_info *info = ourport->info; struct clk *clk; unsigned long rate; - unsigned int cnt, baud, quot, best_quot = 0; + unsigned int baud, quot, best_quot = 0; char clkname[MAX_CLK_NAME_LENGTH]; int calc_deviation, deviation = (1 << 30) - 1; + u8 cnt; for (cnt = 0; cnt < info->num_clks; cnt++) { /* Keep selected clock if provided */ @@ -1473,9 +1473,10 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, struct s3c24xx_uart_port *ourport = to_ourport(port); struct clk *clk = ERR_PTR(-EINVAL); unsigned long flags; - unsigned int baud, quot, clk_sel = 0; + unsigned int baud, quot; unsigned int udivslot = 0; u32 ulcon, umcon; + u8 clk_sel = 0; /* * We don't support modem control lines. @@ -1776,10 +1777,9 @@ static int s3c24xx_serial_enable_baudclk(struct s3c24xx_uart_port *ourport) struct device *dev = ourport->port.dev; const struct s3c24xx_uart_info *info = ourport->info; char clk_name[MAX_CLK_NAME_LENGTH]; - unsigned int clk_sel; struct clk *clk; - int clk_num; int ret; + u8 clk_sel, clk_num; clk_sel = ourport->cfg->clk_sel ? : info->def_clk_sel; for (clk_num = 0; clk_num < info->num_clks; clk_num++) { @@ -2287,9 +2287,9 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud, { struct clk *clk; unsigned long rate; - unsigned int clk_sel; u32 ulcon, ucon, ubrdiv; char clk_name[MAX_CLK_NAME_LENGTH]; + u8 clk_sel; ulcon = rd_regl(port, S3C2410_ULCON); ucon = rd_regl(port, S3C2410_UCON); From patchwork Fri Jan 19 10:45:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523591 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 19A84C47DB7 for ; Fri, 19 Jan 2024 10:47:03 +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=uC6degdqVKMEFN12Bk0oBMSbXeMwQcOUPOYb0CzoTh0=; b=NsF1p3QBBHcop+ dLa2MJELDVFVjB4rM32yMIQYPcvVIrz5felIHP1KtfeeDa4LyConOllAed/6SPOlWamIGPb6kiBj/ NkueAjnXDNVabpgTM8zLdOYLacLrL8DAiEyzvVbxo/E9eCbLudkWipET4G8Cor359GuXz5Kgwtwa/ ZTfGcpxefs93ekCeE51oiVZlT5q9RlxyI2I6WGxd4RiqMlSXBdJAugO1EwCL/PL/pxcpc00HjFD1N rOCaFaV2zAl+kcbt0Vm5eClIRr9T5cjOJnNbbz7xieUokqhUAq/3Arglgexd4P3YTfDL5Fhv+O2dQ ELM8+5/ajHWPSmxNS+nQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmOT-00585m-32; Fri, 19 Jan 2024 10:46:37 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNj-0057PH-1U for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:53 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40e490c2115so10454485e9.0 for ; Fri, 19 Jan 2024 02:45:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661146; x=1706265946; 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=ecEUv9cB/C4rgpKZf48XubyCx93neS07LHrZaWe0W9s=; b=zmVmuCOYemrulfn4UsU/4d+2X1a2Zm0O1NvOc2zEl40NKbCPUhlTmtR1cOtN8TbrHC 3ygSxS6td+aK8XMxGmdGWxKRuWK8Esos0BoVGk8eyw0AsUalqgKXNcneXTSfVneYNGg0 8sjLUjrQtqy1uGEV9yWN6TOrvzKpqdPhc6NtY4C0Jiz0cfiLhSbijn8/V2dBFZuwfjW/ aVkRd7yNLva3C33guUILI/k3VY0kfj5Payw0OCKb7BJZtRTOZ+eQoum4DtVrfRSrbCxA i05lDVqk1RfgGh+8vjO1xlfT7deqFrN4+pAWy59Rvks7dmVAC10aqK0x5kRBIGBa0+3v KSGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661146; x=1706265946; 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=ecEUv9cB/C4rgpKZf48XubyCx93neS07LHrZaWe0W9s=; b=NXad5qN4UVBfVY0a8hrflOpobAmqdg4pmjeChW3BdnIsA2VRTsQvric46XDbXiMR0d r3Y/E6gnPqigs0LBTdWskLhRWSQWCXqSedUagFjbJ9gRb0TzOZOKfiejqjA0J+pcyGKN gk9VyIOGKQRGETVD/alH6Lkhmhc4R363TqI12hLTsMIB24TsIdyjtWB3HWuNNSG/Dr6h Eg7/ubcQOPqbhnRu8VA/ko5/E0uo18BYyDQpTk0MmwljQOUnF6i2doSlsVt5esq8hyit ZWLruvTBukUNbJusytH66/Qq7smFFkKAf3t6RpVkb+qplyB7O859FUEPugIgKOWtl+aR eXbw== X-Gm-Message-State: AOJu0YwPlrmCoe3PBO1quQ5Ps4AGZr0n/ytjoqUlAdUqgh6DrcelxlPA WW8RYGGySu/Rj3+8sjpDbw11bWq/ky4Av17IQdOYOrSKx06eUSfPHHXPPfXujYg= X-Google-Smtp-Source: AGHT+IFYdU7YgMMRHC+DrUKA5MwlIsxGfbocGuG9y6jEGdz2VaUXMw579pgtjEfWCwn+GLZjJgGcDw== X-Received: by 2002:a05:600c:6b0e:b0:40e:4ad9:90df with SMTP id jn14-20020a05600c6b0e00b0040e4ad990dfmr428957wmb.158.1705661146233; Fri, 19 Jan 2024 02:45:46 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:45 -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 18/19] tty: serial: samsung: change has_divslot type to bool Date: Fri, 19 Jan 2024 10:45:25 +0000 Message-ID: <20240119104526.1221243-19-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_024551_540715_FBA140F5 X-CRM114-Status: GOOD ( 12.21 ) 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 Since the driver was introduced the port features flags never extended. As we don't expect more flags soon that would bypass the first cacheline of ``struct s3c24xx_uart_info``, change the type of ``has_divslot`` to bool. Bitfields operations incur performance penalty when set or read as compared to direct types. Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index c429029c0207..0a03df44211d 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -89,8 +89,7 @@ struct s3c24xx_uart_info { u8 iotype; /* uart port features */ - - unsigned int has_divslot:1; + bool has_divslot; }; struct s3c24xx_serial_drv_data { @@ -2400,7 +2399,7 @@ static const struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { .port_type = PORT_S3C6400, .iotype = UPIO_MEM, .fifosize = 64, - .has_divslot = 1, + .has_divslot = true, .rx_fifomask = S3C2440_UFSTAT_RXMASK, .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, .rx_fifofull = S3C2440_UFSTAT_RXFULL, @@ -2429,7 +2428,7 @@ static const struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .type = TYPE_S3C6400, .port_type = PORT_S3C6400, .iotype = UPIO_MEM, - .has_divslot = 1, + .has_divslot = true, .rx_fifomask = S5PV210_UFSTAT_RXMASK, .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, .rx_fifofull = S5PV210_UFSTAT_RXFULL, @@ -2459,7 +2458,7 @@ static const struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .type = TYPE_S3C6400, \ .port_type = PORT_S3C6400, \ .iotype = UPIO_MEM, \ - .has_divslot = 1, \ + .has_divslot = true, \ .rx_fifomask = S5PV210_UFSTAT_RXMASK, \ .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, \ .rx_fifofull = S5PV210_UFSTAT_RXFULL, \ @@ -2498,7 +2497,7 @@ static const struct s3c24xx_serial_drv_data gs101_serial_drv_data = { .type = TYPE_S3C6400, .port_type = PORT_S3C6400, .iotype = UPIO_MEM32, - .has_divslot = 1, + .has_divslot = true, .rx_fifomask = S5PV210_UFSTAT_RXMASK, .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, .rx_fifofull = S5PV210_UFSTAT_RXFULL, @@ -2569,7 +2568,7 @@ static const struct s3c24xx_serial_drv_data artpec8_serial_drv_data = { .port_type = PORT_S3C6400, .iotype = UPIO_MEM, .fifosize = 64, - .has_divslot = 1, + .has_divslot = true, .rx_fifomask = S5PV210_UFSTAT_RXMASK, .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, .rx_fifofull = S5PV210_UFSTAT_RXFULL, From patchwork Fri Jan 19 10:45:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13523593 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 386E2C47DB7 for ; Fri, 19 Jan 2024 10:47:06 +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=kRRE3sUPRF2R0a0iHF5PAAuhx9i/kWPqNNvcMInO0+k=; b=Wx8/kHqpLDe6dA FNyYNRW4BHREiYaFFw0eiksEccP4W+xGQOYwr9xsOgYUYUNDDOi3iUr1HUy6dcz0W8OVdWl6u4KPU Y62u4O7VKY6TNvKt7tT+Mh0wBBg3CSa0/O1IJbgTkr/Os98qBDF+uLAVHFlA1jRAVTsNk7l6AsRlM tGKO7rn2N1onjDdFa/jcoPO02iu9S901z7268zpAK5hrZGwF5uLXE4IHuSdpNbsIcfUPHUljtd0TZ 3We/atUmqTOyUyvi6dkuCKGVnhCxzIzJPBIUqg4diRdzkHU6bQa0mdFGZAMYePc2IgR6znEe87ZcQ jKUcFctJihappQWpM3RA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQmOT-00585H-12; Fri, 19 Jan 2024 10:46:37 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQmNj-0057Pr-1U for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 10:45:53 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-50eabd1c701so696435e87.3 for ; Fri, 19 Jan 2024 02:45:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705661147; x=1706265947; 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=Dam+ysOKHmekRdWT+0A8uvWFAbklzxZhnxZqNV/mEds=; b=kDXtuWjqwbj0sV9UYv63+p6IWzf96KSfEIicY7crOETvi3hpUVpFB3xK3k+ZbjACsq jX5XmRZDdEoZG5uL3DbAmaM4q9KV+kP+fdjans6dYCD+5/bDrl2EiB9XrxT/YfOFfawU zNIMbBTdxMXFcdDbOga0kjNf5tqt2r7xSaRnNZpZlLZTD7sJ6Y5uj7qKyhhvqoKPcH7Z 5PBXocwifsSSHsleezzBQ1LaIdTch63SRkVow2uNaJptWmfSwfokBxwIZ3+qmG/alVLY wW89r6M0DhkLJ+gXVEmuCH1mSkmkf3RmrYxtGaGu3NZZLA8xD6gwz+hJeTdf+iGJC4Qc +hvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705661147; x=1706265947; 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=Dam+ysOKHmekRdWT+0A8uvWFAbklzxZhnxZqNV/mEds=; b=k9LlkSww+WJZ/OV4GlhgeKb+SOrKwfSfL7+HB13V4c8LHGccV/iJn7AEuvqG4GiYKU O4/ze/7MzU1u9TRuViFzfcRCyD+uyB2vhAWqSic7jrO4aUeymm035iFgoCDW54GrfI71 hhMSZM8mkwcpdxQwERCba3v43k0wBAJBR6mrW1/m6rcXgQI/pdpVKjn+G7bgQYjfIuhW ++RoTMPXwXAihtw1TZoMyadCPNQva8IxoT1w2/68QHJwtOZfvfDtVNpWMImobTfOtNEM SkLl4DKdW25NYAAMEVeqEpIRrgrnfNx3Ps0QIV05IMZnBggfRSiibNlUXCFJvML6jtI9 ur5g== X-Gm-Message-State: AOJu0YzNMhOstmnBWT1q+vxUI1SKCPU5vJwjwHDAsoZIFT8LMF4OzaHK Jwijhf26QwEbp0h1PSL4ebSbXpP1sn+6kall60pOeQgWvSza7bbTGtfH29xxhBc= X-Google-Smtp-Source: AGHT+IGXPpDJDvPliaArYGtaldjiGJwnoOPpIjme4o/zZGILHZV61MCszFmCgh4t0thzE2a5w6utjg== X-Received: by 2002:a05:6512:ac2:b0:50e:7b0d:5b66 with SMTP id n2-20020a0565120ac200b0050e7b0d5b66mr742328lfu.73.1705661147229; Fri, 19 Jan 2024 02:45:47 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 02:45:46 -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 19/19] tty: serial: samsung: shrink memory footprint of ``struct s3c24xx_uart_info`` Date: Fri, 19 Jan 2024 10:45:26 +0000 Message-ID: <20240119104526.1221243-20-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_024551_523062_86B735B0 X-CRM114-Status: GOOD ( 10.92 ) 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 Use u32 for the members of ``struct s3c24xx_uart_info`` that are used for register interactions. The purpose of these members becomes clearer. The greater benefit of this change is that it also reduces the memory footprint of the struct, allowing 64-bit architectures to use a single cacheline for the entire struct. struct s3c24xx_uart_info { const char * name; /* 0 8 */ enum s3c24xx_port_type type; /* 8 4 */ unsigned int port_type; /* 12 4 */ unsigned int fifosize; /* 16 4 */ u32 rx_fifomask; /* 20 4 */ u32 rx_fifoshift; /* 24 4 */ u32 rx_fifofull; /* 28 4 */ u32 tx_fifomask; /* 32 4 */ u32 tx_fifoshift; /* 36 4 */ u32 tx_fifofull; /* 40 4 */ u32 clksel_mask; /* 44 4 */ u32 clksel_shift; /* 48 4 */ u32 ucon_mask; /* 52 4 */ u8 def_clk_sel; /* 56 1 */ u8 num_clks; /* 57 1 */ u8 iotype; /* 58 1 */ bool has_divslot; /* 59 1 */ /* size: 64, cachelines: 1, members: 17 */ /* padding: 4 */ }; Reviewed-by: Sam Protsenko Signed-off-by: Tudor Ambarus --- drivers/tty/serial/samsung_tty.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 0a03df44211d..fcc675603b14 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -75,15 +75,15 @@ struct s3c24xx_uart_info { enum s3c24xx_port_type type; unsigned int port_type; unsigned int fifosize; - unsigned long rx_fifomask; - unsigned long rx_fifoshift; - unsigned long rx_fifofull; - unsigned long tx_fifomask; - unsigned long tx_fifoshift; - unsigned long tx_fifofull; - unsigned long clksel_mask; - unsigned long clksel_shift; - unsigned long ucon_mask; + u32 rx_fifomask; + u32 rx_fifoshift; + u32 rx_fifofull; + u32 tx_fifomask; + u32 tx_fifoshift; + u32 tx_fifofull; + u32 clksel_mask; + u32 clksel_shift; + u32 ucon_mask; u8 def_clk_sel; u8 num_clks; u8 iotype;