Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2059977iog; Sun, 26 Jun 2022 05:47:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tR0a36p5gDbwVC/ePqG98/dq0aC49pUA3KB2UIL2r3eQs+T7XKs3cM+P7VXDNBZS7lBMrW X-Received: by 2002:a05:6a00:181b:b0:525:63b6:7397 with SMTP id y27-20020a056a00181b00b0052563b67397mr9535459pfa.1.1656247627804; Sun, 26 Jun 2022 05:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656247627; cv=none; d=google.com; s=arc-20160816; b=muTNI3IKplvcrOLW6WB4qCCZ8xzgeS6wZUywGHS3idXQLP3R+OGS4TvT5nt093mL8l FPOXZNe6khqqtyL8zjAtkraAP9hXkPvc/QZBEs/+FTPCfNu3hB6DOB72bQscmBGL4FDr Wceq5l14glCet0SXzVdG91fhwU4WxhZvJ7gUqwRQfaeTsZ5+fcSNp0qGPXgT7AstM0Bo h6yS0kYTPsEbxTEJ8Cmrh8LO0tLJyr/GyI4RJLvKbewoZwNU8fkimbSUMQWTjt9sfY5H jmPsczFnezMFSB5JoSR3tKeMjvyhcCtKWNlGeI1zLC82kqsx58DgTGMHtEqMKjPZ8bON I6CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=onOT/Qx0N4ooCf9WHMLopvtfTssu1VAbFUO2Hp+2Ed8=; b=ogBR78U92g+MmcLr9X/lrp1V0HnAHNSTjGgx2tFHtE15A1teMCLB37kFX0zxTJvE4i 16qxYbTTQk+bHmrJKFqbKdhwW9ahWEWxH7T8pjO+sUwwCXLBLyN/81RBg8ovYXqWOx/c l4S+Bsni1nHpNIpCofTtp3bWZWrzyAKXldR9MfL5Esa1rZNuFqc0Q6sLnSS1PFgkXpxz GYsJd8QzrcUn1P3LmHci12b6lquIsMeHPQdlU5kcgk7pH4oZof+uKsALa6CtDHivQDG/ 2n7WnI6CDwPUnCs56s4pk2KMwkRG0HSZN8ZP8wsDxaNxHC4d/T7t9rgdB/G7MB0XFJr4 frQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=ekBEZ8tw; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l64-20020a622543000000b005251fe41babsi9684703pfl.263.2022.06.26.05.46.54; Sun, 26 Jun 2022 05:47:07 -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=@gmx.net header.s=badeba3b8450 header.b=ekBEZ8tw; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234449AbiFZMj7 (ORCPT + 99 others); Sun, 26 Jun 2022 08:39:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230287AbiFZMj6 (ORCPT ); Sun, 26 Jun 2022 08:39:58 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 760A41183D; Sun, 26 Jun 2022 05:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656247187; bh=+Qb3TrnQnb7Tf8bDXxqHXI/Y+7qHL+BXsSHZvSy/8Q8=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=ekBEZ8twOLhALi0YfO/G9Ad1X0oiIuXja39gmcVL8fhgOjSPaEW813p+SEHsNpycA IPLIF2vQ9s/0WIkw/ExcRwIkJlFp0ns0vORXTKvBGPmZFlcQi3RThDUeqCJyTq/pAU 7atjjAWY+tFbTDZK/FGGCkQiD6fbaWp50FfuB87g= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.33] ([46.223.2.248]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MzQgC-1njUod2MdM-00vMyd; Sun, 26 Jun 2022 14:39:47 +0200 Subject: Re: [PATCH 22/36] serial: Sanitize rs485_struct To: Lukas Wunner , =?UTF-8?Q?Ilpo_J=c3=a4rvinen?= Cc: linux-serial@vger.kernel.org, Greg KH , Jiri Slaby , linux-kernel@vger.kernel.org References: <20220606100433.13793-1-ilpo.jarvinen@linux.intel.com> <20220606100433.13793-23-ilpo.jarvinen@linux.intel.com> <20220625201232.GA17597@wunner.de> From: Lino Sanfilippo Message-ID: Date: Sun, 26 Jun 2022 14:39:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20220625201232.GA17597@wunner.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:4LZnFndGw1j1W6nKEdHMzsiyzI0NP4/oEfoDJKmLVL+Iy8roH/o Sr6tyUcw4xyWOovp51TJvkKC8bsOilazvO3PmbBdtGqycz3dgx73zE6VOOc/MLmqDsa9Xvp tMgZIDCvNdbivcTaK3PjV67xziE4w9y4NgjFIn1MjsrFwb4wKK1x0/mDVBpepGrknjYkQfQ Q6y8H1nciey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AO3wIHiNMunVG2 u0vkfaauXMuI2o1N3jUhxRfd/RT5fF7vRz33pUQBCg/6CXJW089wyaHbtNU5s/rzMNEKFXpWd nzxFRw+lIHxb0qWcqMwPfjs5Z+PNRkWP6iQQDIsZ1IakMgzhcn0p1yxTQ== X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,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 25.06.22 at 22:12, Lukas Wunner wrote: > On Mon, Jun 06, 2022 at 01:04:19PM +0300, Ilpo J=C3=A4rvinen wrote: >> - if (rs485->delay_rts_before_send > RS485_MAX_RTS_DELAY) { >> + if (!port->rs485_supported->delay_rts_before_send) { >> + if (rs485->delay_rts_before_send) { >> + dev_warn_ratelimited(port->dev, >> + "%s (%d): RTS delay before sending not supported\n", >> + port->name, port->line); >> + } >> + rs485->delay_rts_before_send =3D 0; >> + } else if (rs485->delay_rts_before_send > RS485_MAX_RTS_DELAY) { >> rs485->delay_rts_before_send =3D RS485_MAX_RTS_DELAY; >> dev_warn_ratelimited(port->dev, >> "%s (%d): RTS delay before sending clamped to %u ms\n", >> port->name, port->line, rs485->delay_rts_before_send); >> } > > This series seems to set rs485_supported->delay_rts_before_send to 1 > in all drivers to indicate that a delay is supported. > > It would probably be smarter to define it as a maximum, i.e. drivers > declare the supported maximum delay in their rs485_supported struct > and the core can use that to clamp the value. Initially, all drivers > may use RS485_MAX_RTS_DELAY. Some chips only support specific delays > (multiples of the UART clock or baud clock). We can amend their > drivers later according to their capabilities. Agreed. Regards, Lino