From patchwork Sun Jul 3 17:00:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12904411 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 C91D7C43334 for ; Sun, 3 Jul 2022 17:03:27 +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=tNaiF9x3jEgnufvGs8gG/P6Xu8PEkOgpLyTUA67W1HQ=; b=b5TTP+ZXaVfpCM AV6ZiBwKQGTK5I6um4aaxm/PZEUahRxgDKiO+BTiXJ7U8HndCyDzSgc8AmB1OONM1n/ovVBxXDmyq Wh6VXyrUMGwFWCcDFcgsS0eEQRaHEgznn+Q59GpcdtzeroHbo27R8R9mf0IIlOi7P2SoUsehssZAx zruyOfelhbOupcxKq6Y/r/8AqAZZ0B1ydYOQrJi2D998sIAumHXREkKqLmokAROr2cFiGFl3WpJYf S9i8b8gO2m/ACjeSwZ19bdfmfE/bU7yQrKvUXAAmrMBFZDxzqmRG7fXdvZdWiyaMQlewkHHI52o/n L6pXoYFgm0qCANGqXpNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o82z0-00HMd9-Ez; Sun, 03 Jul 2022 17:02:06 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o82ye-00HMQz-UH for linux-arm-kernel@lists.infradead.org; Sun, 03 Jul 2022 17:01:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656867691; bh=jKGdNVXp94SoOUgUewE1NIzx0yJCaYTRp187GnBOMW4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=IdYRVDSfnKdRTqfbijTq75loOiKhXz0iGBmFcIybPlhuEB7WCxUiL1tLQ0TW2/IqD RNmBrAQjtiISIkg1lmTQSpL0aaQAVKVedklnB46snDTMFxBXFjC5yBXImMXZCrxGqm 54SakHGE+SuOiiwOr0Giwy/V1J6YdgOI8L/9TZAc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([46.223.3.210]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N3bWr-1nQ9Lk1rL1-010gwU; Sun, 03 Jul 2022 19:01:31 +0200 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: ilpo.jarvinen@linux.intel.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, andriy.shevchenko@linux.intel.com, vz@mleia.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: [PATCH v2 4/9] serial: core: sanitize RS485 delays read from device tree Date: Sun, 3 Jul 2022 19:00:34 +0200 Message-Id: <20220703170039.2058202-5-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220703170039.2058202-1-LinoSanfilippo@gmx.de> References: <20220703170039.2058202-1-LinoSanfilippo@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Y5Ygm9SVZnK1e70wsB0AKqgKClXe4C/6d5MFgt3bO8CTx34rrFpK6RhFzzH45FgnZm/SS zsrzKKwmJiDmTOXfYNiXH4C3XZiAts5ZewHammc4gdxbwnWNnlQa9H9KthRV2BlHh4ZQ0X4y8 NtQXXus2hZ0NwP/B42FKQk6QXJncDlR3LnjBQeDYmC9QQ+pi0VfQWftusGISxwlTPOpCK7Y5y dx9E/ZbSGvdjmYyWzwmd2VL45AU+NklDf7mNIniV7Wxch/WzdfN3QCByZ9VN+3YAv+7SbeP+8 KFstWGx7uocQzTGw8ty0x4KysRjmobl7U9fEVUefHLx5BKMQerJRgntApNIkorvX1Bmd8z6t7 tY1pvovH1gi0svjyZQdN0sF7sKm4Wr79g2/kM9IYxN0ggtGXbhsbrOAng== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220703_100145_304597_E8802FEA X-CRM114-Status: UNSURE ( 9.48 ) 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 From: Lino Sanfilippo When setting the RS485 configuration from userspace via TIOCSRS485 the delays are clamped to 100ms. Make this consistent with the values passed in by means of device tree parameters. Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/serial_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 05ed3acad09a..58cdad5f45dd 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3395,6 +3395,8 @@ int uart_get_rs485_mode(struct uart_port *port) rs485conf->delay_rts_after_send = 0; } + uart_sanitize_serial_rs485_delays(port, rs485conf); + /* * Clear full-duplex and enabled flags, set RTS polarity to active high * to get to a defined state with the following properties: