From patchwork Wed Jun 22 15:46:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 12891023 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 F2618C433EF for ; Wed, 22 Jun 2022 15:50:55 +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=hht2T1TkUqLQjvlrPGDmTu0DZJOkXegOjA7L4Ut3FKQ=; b=T28AKSXGUAKY2J bN9qySQtaIqc9/D0Yu88I2yYsmeZTmoczST/p0X94GE7T6k4RfiNFX8ktrVV7oyLbsHcTMUpvzV3s 6tTLVtHqkdJ2mI2JKU1ZKtFQbyqBuua8tcolxKhMYJLgvGA5ZQ7hDFFMqKPHPW2q7fWmmI8XOpUyJ IHirCIEkQZgK2Wn0zvUS9YQu4ZVglRfIJ/h6H9h6LxsWFNR0jXUNglzRJk13CcSt21qaHl/2Q7nac z88czdGnUD8gR3oX9Q7ABexT0UqNcJzJW7EPKzIjtEvHn2PyEquxiYWJfJDDm0xG5ahrRmeHk9VAN rav36IPYTyqI8Cxhacdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o42c0-00BGDS-Cl; Wed, 22 Jun 2022 15:49:48 +0000 Received: from mout.gmx.net ([212.227.15.19]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o42Zv-00BFFW-33 for linux-arm-kernel@lists.infradead.org; Wed, 22 Jun 2022 15:47:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1655912841; bh=USV3fl+twKeaglXK8ND9rNj7pBUi2D1D0ABm0cxEvko=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=UUswrZCOZwnVPIrtWkrISAJD5rAj5sXkVJ6a2FK4S7ogLnKGOE7AB6uoJONiZvpZy GFcYDw2xLOxfQkf6yxGc88/IOu6Az36J/NmES+kIhCRG3ueISlyh961UR0LU3Jxyzu CIOdMM1emnxbSaDDjVOHd5xtT69vpJ8k7X06qKKo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([46.223.2.22]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mwfai-1njsGI44rK-00y96s; Wed, 22 Jun 2022 17:47:21 +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 4/8] serial: core: sanitize RS485 delays read from device tree Date: Wed, 22 Jun 2022 17:46:55 +0200 Message-Id: <20220622154659.8710-5-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220622154659.8710-1-LinoSanfilippo@gmx.de> References: <20220622154659.8710-1-LinoSanfilippo@g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9xkhIG8D0mdfwI9hz360zB7mJ6oMq9I+s4b3xqTMM0p/ 0xJzzxWLVnOKuTZIlVvzjUOdXXVUJAdmlGqCalkfPMEyLR990t5LKFXkAbiLr9WfM3KQM2mem I3HTTWY4nSskMIUdlIpAnyxCDQVHgf307hrkz6giYUj+nuX1M/Gl6HkJVh8OZLVAce6BsGogs 0iySkke9+0e6N26x5iWAvq3QKOOzHQsvWZBaMY0C4/5x9Ur8yYoe+l5rVubK3ETUHRqvaOn9H 3zXdUNjM7pJBe39Z555W7asmxuDquQQEQjBpVeSqGSda/ad7MmWQ5/pBSjWzpP416PveRUMZl I/BDunea9pML9crCdcYZdMlt4ErDobXSqD0fYFJHPU7zBG8v/ozpNOwPg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220622_084739_498653_CEEB16EA X-CRM114-Status: UNSURE ( 9.58 ) 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 fa6acadd7d0c..2e9f90e73e62 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3382,6 +3382,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: