Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1184420iog; Sat, 25 Jun 2022 03:11:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uWGGj2Yz6NLmcAfdfPFdu8S4WaMZBy2cXbYpyLMDXP/wS4gGCVAeJ/rTkf0MRIV+Iag/zx X-Received: by 2002:a17:90b:4f48:b0:1ed:45e5:dc8c with SMTP id pj8-20020a17090b4f4800b001ed45e5dc8cmr1146979pjb.131.1656151860805; Sat, 25 Jun 2022 03:11:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656151860; cv=none; d=google.com; s=arc-20160816; b=TR0297o4o/JeMiewvicbgNrf6VhFabBvw5kMLZdUb0ldo8VyD9up4UFm6d/8xR5HgR I/gDxi3pQB9KGEC4+Sl9MDPzVuWLORONlM3cQ7zh9QgTLzraA/SVv01R1sDkeb2UxrdA 1b9UEAHoiMUfix54CNeQDaLrVcFF+TjCfxmikIMPE3VKgTtHsyXLIgJLzjaagySoseu1 EA3tKLiBRUcs04nelAn06Eq9lG9OaB+jyFiIksYZjAuUEG0iQPPBBBgXsPAZZGvqJBZF ABfZND/k7nj+fo5jIN6vWQnxmjBDYrHIVNRA85WlrDYH7lVV8eWzzG75PG53X1V5jwKk mGig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=UD1rultMySjHt2zZl7p8tw86JLzhfgzlElpcSqab/GI=; b=Egn65xtsFKeacpXGcX8GU01kJ5MKVytVslDFkKni2QrXXgVuIaWa+c33ziknAqQsXJ f3CYXYApg/VpuEHRInuD9m2+Lo4rGnHQSYhH2Th9jyvvi+ocZJlVyoVvmcFP1Umt0uTX xmp9tz/tkxeQnqX9z4KkpgQR7CAr4U8nmNzJB80juwcYmlCM2A6nbtg2ZDafroUoZ33y dNKv/yzl6Smgum9NDH68lroLSdteoZ42LVRVn2XEs5qh2uLFx3zp2JIkuZiaCbNpYdDo DadbPDbdDteG2Rsq9bNGfUVws5u8Ln2vqWSHlr6WtG4M6x1uuLxoDHhm2blzI+fmIwl6 TkcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Jgy6u09k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a65-20020a624d44000000b00522af875a2fsi6005878pfb.96.2022.06.25.03.10.48; Sat, 25 Jun 2022 03:11:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Jgy6u09k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232305AbiFYKFN (ORCPT + 99 others); Sat, 25 Jun 2022 06:05:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbiFYKFL (ORCPT ); Sat, 25 Jun 2022 06:05:11 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 704A7393F0; Sat, 25 Jun 2022 03:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656151509; x=1687687509; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=64n5WIu3m8ECq0hcL/3ZwPIajMr/prijxDfl5xl4iOM=; b=Jgy6u09kHvfXmoQqjJ7VMZLPqCn6YY21qIxcXNX5HO6Bw2dNVAeRO/hC B/i341aLux3JMujpC4x9oYVTvkWz+EKUpLDwo2RTHcfeWiOZN5X2N4cDp wnXQJHYkmrYJBgTsVVDT8ztwRn+9p1rXLJ8epK30ixKXogLhOlorjW6gu IY/Aek4BQhXxcHQP3xOordIIF863WL0UHBwLWzg9mACF4ZiFj+NsgTOlk 5OEleYskauskTjkIW6tL9bxVBHh5Vh2MFb05k2PtZXICFxmuqORQNLvGb 1pPXcdmlZLi1RNW8B3fP41wF+XV7ZHg5iASHXpkIDz6tfWHvnIs5toHbm Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10388"; a="367486979" X-IronPort-AV: E=Sophos;i="5.92,222,1650956400"; d="scan'208";a="367486979" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2022 03:05:09 -0700 X-IronPort-AV: E=Sophos;i="5.92,222,1650956400"; d="scan'208";a="645645813" Received: from selvaku-mobl.ger.corp.intel.com ([10.252.60.244]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2022 03:05:05 -0700 Date: Sat, 25 Jun 2022 13:05:03 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Lino Sanfilippo cc: Greg Kroah-Hartman , Jiri Slaby , robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, Andy Shevchenko , vz@mleia.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-serial , LKML , lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: Re: [PATCH 4/8] serial: core: sanitize RS485 delays read from device tree In-Reply-To: <20220622154659.8710-5-LinoSanfilippo@gmx.de> Message-ID: <5d406271-3290-f321-5984-bbc1f9a3bd96@linux.intel.com> References: <20220622154659.8710-1-LinoSanfilippo@gmx.de> <20220622154659.8710-5-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 22 Jun 2022, Lino Sanfilippo wrote: > 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: > -- > 2.36.1 While above works, if we go to this change user-visible behavior route, uart_get_rs485_mode() could just call full uart_sanitize_serial_rs485()? The sanitization is currently being done during probe in uart_rs485_config() which has another challenge to tackle. The RS485 supporting UART drivers are not consistently calling it during their probe(), only a few of them do but it would make more sense if all of them would enter into RS485 mode w/ linux,rs485-enabled-at-boot-time being set. However, making such change might run afoul with the expectations of users. -- i.