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: 584561 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7A95C433EF for ; Wed, 22 Jun 2022 15:47:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359499AbiFVPrz (ORCPT ); Wed, 22 Jun 2022 11:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359516AbiFVPrs (ORCPT ); Wed, 22 Jun 2022 11:47:48 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E0243DDEA; Wed, 22 Jun 2022 08:47:45 -0700 (PDT) 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@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:e/jK6Z9VQvfhmbL4/RIZnEERZwYLu9YwLTfCCrPInSYYBm2ZMlu CdYKgEWHWZyP0DyZUusPmYZ7dOqtX0318268vHy0EiQ9da2TtNeALxihcGNyb2GVCKq6WIf K1WN8b7AtCjRUKa0B50guV58p7oloY6sGrhWQiJMpkUMsqd8nZGzppNMBusaPxFoaPa/iU6 3Vi/pHI8FXMt1veuMQuNQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:prhJy9QMOTc=:QgaCgmiMiRr/jtLsmjd/QX yOO5BLgh+6c5I/D7ExYmUEkszGqa1iFGUtVzTEnmdWuI59UKmXPEKEL/opxgHpdFhHpev67aU Re+56rDXQXyzgqWoxT84lFFYoC3w1j2lzNs4PI3b4ADpwW9k8/9AMW327z5l8PbA4DLIfE/Wo gXMjFaiSHBCYAy6oGKOkB1ptHnnGndgCixavf0/NnnCkhN4mNz74SKDLCxgU/5XDWkh1heBUi m9FBLUj2gLKu9SBsySl1JoS9f84CZXUZ7Bi0pX3UovOF9AAADsTx5g++ZODJNbkzF6rT5SNIy mwlZLenjF1gX8rOtaHYpImziRBJHVLMK/wQkRo42cZNrnLjk88oikKfgCDRwI1ypWRj+UJiub TkCE572PllH+X/tZVTSqAmIbuZe7ZyaYrwjCcy/QnIf7c3aH1e3Q3NyjQApcKEdLdQi8feRQH Bql9UIwvcpbgtTVSFY7kNKZGe+FvS1AcNZnsq6O27u+SlkeNMHd5i4K/QJoYr/HdITiTIVs1T 1bg/ffXjDgG0suzrzvgBY1ZzIgaNav8XYzRRY/VrEl6Tr7lYiVfCpN5i23thYtWe3xV2O7oEW HToPEpqarAtMdVh9wJPLCwtQX3SHyJdX/Zhc9Hq1whcHK7Urkydu0RHYEOHAL04/ksZmviQbX 4I5g8hFtDgWyVAcE4GkW7wLhsO8vFwVXAKMnFsMw6icgrFmAj5h0VXcodH9i3MUk9HKGdEef8 DBskoAa3Pcc6XcVIqJwQy7cdqBZ5H9xkhIG8D0mdfwI9hz360zB7mJ6oMq9I+s4b3xqTMM0p/ 0xJzzxWLVnOKuTZIlVvzjUOdXXVUJAdmlGqCalkfPMEyLR990t5LKFXkAbiLr9WfM3KQM2mem I3HTTWY4nSskMIUdlIpAnyxCDQVHgf307hrkz6giYUj+nuX1M/Gl6HkJVh8OZLVAce6BsGogs 0iySkke9+0e6N26x5iWAvq3QKOOzHQsvWZBaMY0C4/5x9Ur8yYoe+l5rVubK3ETUHRqvaOn9H 3zXdUNjM7pJBe39Z555W7asmxuDquQQEQjBpVeSqGSda/ad7MmWQ5/pBSjWzpP416PveRUMZl I/BDunea9pML9crCdcYZdMlt4ErDobXSqD0fYFJHPU7zBG8v/ozpNOwPg== Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.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: