Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5673463iog; Thu, 23 Jun 2022 03:06:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sRBwU+Zs0KABiYnxYAmZAx2Jn8jW/KY5t4uhd9HbAAGTP0fnGgQeARnzDvbD1B9QI4EgGo X-Received: by 2002:a05:6402:4144:b0:431:6ef0:bef7 with SMTP id x4-20020a056402414400b004316ef0bef7mr9882190eda.151.1655978763763; Thu, 23 Jun 2022 03:06:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655978763; cv=none; d=google.com; s=arc-20160816; b=yQleda29sSnCf7yYhgn9gtT4zYjEsDzuCtnvTjPnV4QbgrlhzzNY9/buqlDFYAskNl M3vMEH2aQTWM8gAEeOQ/xo6qnkoeiomOHVvsbrOTlNWxpIfyEYjSugzHSiqC8QNWAF5W GloWwGou6PLcJ99qXIvUVwroQpl/vyUrqt3d6GSYfnzRix2kZ2NMjDbX4vzYJiDT3VEr QTpSg61fdLvFmzWnf8uNHCva0VySYodxyIuZEoY+Rr7Z+TQ69MxPbpRNemXfy1og+qUA KvrMTcyhJphIWtKOLVJ0chQRa3EiLKVD/O+/9pxHimvyB8L6OMCpJQk3ckf2pknfIShh Balg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=CqZHI78qt9lumbdFWlSiHgcuuijsjPdVdWVBLjHodmk=; b=xicI03aWPurlAQba3XA73Q8FevdbZWmSjPd14j9XSaHSCgDRZXMH4y1yxWwETPrG2I T7Siss+D4fxUoWejqruhUijJ8YymKmKEd51+jvE1EaWMyQRklT7iXjNamGlYSWYSJk1j iX+yjvr0wlfu/wpxuC6pGDeFW4ZxIAT+HFxbVJ1Kys+xMNW0LbT0lkx0yF5DSSaTMIKM YZaXc+fvTbycjlyfCS31UQrPdRkez6qwoHhQviRvz6TyQyC69AIfbXB2u4we7y7UCK/U jTC7D2PcqOPZwG1Dz1z4Yxhb+8BhYY8dZ4ij3CObmGzh26ngB1e5jlsylDC6et2gLnq1 01uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=D38lj8H8; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020a056402510700b00435bcb8758dsi3666936edd.12.2022.06.23.03.05.38; Thu, 23 Jun 2022 03:06:03 -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=@gmail.com header.s=20210112 header.b=D38lj8H8; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231300AbiFWJqt (ORCPT + 99 others); Thu, 23 Jun 2022 05:46:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229937AbiFWJql (ORCPT ); Thu, 23 Jun 2022 05:46:41 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C424949927; Thu, 23 Jun 2022 02:46:39 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id h23so39814731ejj.12; Thu, 23 Jun 2022 02:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CqZHI78qt9lumbdFWlSiHgcuuijsjPdVdWVBLjHodmk=; b=D38lj8H8nJhIo9qkx/MnZ8wJ1AkNoxYBlHUbMF4zwGLQsc73QZg/eYrvqbxfYv64R1 CdXo/2hZprxh0OmqHz63eiVupNkiL4+XXEbcnbk80c7Ovxq+15xb8CTuxVygBkRKOUrn aAba6DsefOi2kHghmRTRYRas8PHUyxqlGxAqfGnmVwOuUg/iBJE70Y3jnebaneuPwRIQ UPutxElfQgar0VmZVnbY6MNeF+wvaMI5vK6qMogMGyzDDlah/j5RuEfM7Fv95zoEX9Vw 6RhssvO9KLptXYbzKnUbonEPYK82iRuJ5b8ienIAqEk03TyQJR6UUwsJRMLDmclvDWbV PFaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CqZHI78qt9lumbdFWlSiHgcuuijsjPdVdWVBLjHodmk=; b=1p/R2+muDh1qgmwioYpFL+jDgcdTfC/XMO4J+1wZ8PICg+kIcBNWR+HYnoAyF4CChb YyT673YRGysYM8KbclFMlz8rM8mdKIFw8sezvnUi1o38ghhl3FJ8MYzf1TGe4yql4jX0 uN7NtEDSte1kQjKEOdhCHj5uLiv0gHliA+xnQT2na0nEWvuhNk0UyRMtRNXVhFXq+Jho a2ITMocXChcLIlSfWdY5TKzq4ZeNmYuO/FzMqbJ54n9cLIFv3gbUoB5rqO/stM38Tkr9 NEmuQF0VYVxmyfSSkne9pD1vytPr50b5y7/xrQ3OkYgbh+OoGH2I7hT5BkXWYpW9oPqe 2QQg== X-Gm-Message-State: AJIora9Q8Q2AGcCYnreocRN1G1qWTGaHLOVM0Gech1ljUR7FEWdoT/sL GVtHgSH3SmFVyxYQ0y6MZDjgcUYAw91e+PKtXbk= X-Received: by 2002:a17:906:434f:b0:711:eb76:c320 with SMTP id z15-20020a170906434f00b00711eb76c320mr7344946ejm.636.1655977598189; Thu, 23 Jun 2022 02:46:38 -0700 (PDT) MIME-Version: 1.0 References: <20220622154659.8710-1-LinoSanfilippo@gmx.de> <20220622154659.8710-2-LinoSanfilippo@gmx.de> <2dda5707-6f13-6d33-863d-a88b89e88a88@gmx.de> In-Reply-To: <2dda5707-6f13-6d33-863d-a88b89e88a88@gmx.de> From: Andy Shevchenko Date: Thu, 23 Jun 2022 11:45:57 +0200 Message-ID: Subject: Re: [PATCH 1/8] serial: core: only get RS485 termination gpio if supported To: Lino Sanfilippo Cc: Andy Shevchenko , Greg Kroah-Hartman , Jiri Slaby , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Rob Herring , Krzysztof Kozlowski , Vladimir Zapolskiy , linux-arm Mailing List , devicetree , "open list:SERIAL DRIVERS" , Linux Kernel Mailing List , Lukas Wunner , p.rosenberger@kunbus.com, Lino Sanfilippo Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Thu, Jun 23, 2022 at 4:00 AM Lino Sanfilippo wrote: > On 22.06.22 at 19:04, Andy Shevchenko wrote: > > On Wed, Jun 22, 2022 at 05:46:52PM +0200, Lino Sanfilippo wrote: > >> From: Lino Sanfilippo > >> > >> In uart_get_rs485_mode() only try to get a termination GPIO if RS485 bus > >> termination is supported by the driver. > > > > I'm not sure I got the usefulness of this change. > > We request GPIO line as optional, so if one is defined it in the DT/ACPI, then > > they probably want to (opportunistically) have it> > > > > With your change it's possible to have a DTS where GPIO line defined in a > > broken way and user won't ever know about it, if they are using platforms > > without termination support. > > This behavior is not introduced with this patch, also in the current code the driver > wont inform the user if it does not make use erroneous defined termination GPIO. It does. If a previously stale GPIO resource may have deferred a probe and hence one may debug why the driver is not working, after this change one may put a stale GPIO resource into DT/ACPI and have nothing in the result. Meaning the change relaxes validation which I consider is not good. > This patch at least prevents the driver from allocating and holding a GPIO descriptor across > the drivers lifetime that will never be used. But it's not your issue, if DTS defines it, so the platform has an idea about its usage. > Furthermore it simplifies the code in patch 2 when we want to set the GPIO, since we can > skip the check whether or not the termination GPIO is supported by the driver. That's fine. -- With Best Regards, Andy Shevchenko