Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6021729iog; Thu, 23 Jun 2022 09:43:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ugkH1mvlAKA08CbUAC0Onzkl7wNVyxpHBPAqm+r7rXMqnsc5K2njC+/H9YtlYnW4skn8nm X-Received: by 2002:a17:902:860c:b0:16a:20a0:f6e4 with SMTP id f12-20020a170902860c00b0016a20a0f6e4mr22188589plo.164.1656002604446; Thu, 23 Jun 2022 09:43:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656002604; cv=none; d=google.com; s=arc-20160816; b=DL91S4FZkdX2RrMgoWaFeZBqY1UDmPrzF8aK6K5ttnoV7nzlgK+Lt40duLZzm2tM18 j2MAqy1clPGRjGvi/mLARrW0hFKHKGGhM4RL640nluoFwOHZos861bJ3yqtG67ywTI+d dV4giyYqb9kev0xCHdSAh0sVMmQi23faJvUuRla0n4WMjeJSFHVfNSVQcDY7qyb4VRFG VLApcq+QUUmXx6A8HU2Pl+VstbNKHY+fqPN+weTm9Q9xYiH+VxKQHWoGskmiajxzKN+k FqS7Gadjo0TfPvoJXcLxEoTH1dWZ2rpPMIq+awr5wdi+Qi0N+ldoN2z/LeQhJrqt66GF ozXQ== 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=CsEGFL+5HSAQKbFPLHFNQtbp62lKkzI8g7Bue51O1CQ=; b=Whzy4rwwpedX29yLadl1WkbvBxOcDPk2CPCc5RVpLlyriF/IFOTe6zcnZWdJJjtq8X VcoRXTcL4vWjAKJTta1SXK3WXwHSAnDIPbdxVPFO/3DIVnAL+N1tfbBR8CK1h/NRE9Z2 V6UjS39/En/bF2A7Ojjk9irBV3WrHiipbE6XxX/d/1Vz+muis2Oja6yz1SNLjqIEn/PE iZtwMnSHzOUWRb87H8Wo574z3IeN1xnFAqnwskB+GJyAbFqC01v37p2/yA4VOtrNJq8N S9+ZIJ9GuAzuHJ5cTb1nWfG1MmNIXzX1ZhGObeEgNDO4cPi5nkmbv7pTCT1hqZER/L0J gcBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=aP70jm3y; 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 q5-20020a170902788500b00163fe7fc211si47668pll.176.2022.06.23.09.43.10; Thu, 23 Jun 2022 09:43:24 -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=aP70jm3y; 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 S231537AbiFWQJf (ORCPT + 99 others); Thu, 23 Jun 2022 12:09:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229976AbiFWQJ0 (ORCPT ); Thu, 23 Jun 2022 12:09:26 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 523B122282; Thu, 23 Jun 2022 09:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656000540; bh=LVfs23vytr0zimb1O5cVH3Onv4wtchEeptMsy7Lizb8=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=aP70jm3yuTSxnnWrofiS/XAV0Rq51NX9yWAW5auMxsH295cKp8c7M5JjYMH08N4tA hw6qkz9cRLISCJtqFAeEz80+7acYUTLVmfjTe4E7QBnGmU1k3J18EUVDgOlxCjxPpQ Unvkxip1Q5Y5YuRxGZAIVL9tCk8cuYWvOMXENXU0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.33] ([46.223.3.134]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N4hvR-1ndi2N1AFb-011fcS; Thu, 23 Jun 2022 18:09:00 +0200 Subject: Re: [PATCH 1/8] serial: core: only get RS485 termination gpio if supported To: Andy Shevchenko 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 References: <20220622154659.8710-1-LinoSanfilippo@gmx.de> <20220622154659.8710-2-LinoSanfilippo@gmx.de> <2dda5707-6f13-6d33-863d-a88b89e88a88@gmx.de> From: Lino Sanfilippo Message-ID: <52ea773c-b5b0-fc4d-9b85-022676778af7@gmx.de> Date: Thu, 23 Jun 2022 18:08:56 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:09XTQUkSt2KXRLTcHveNlWJxbi5ICmeBBHYjgPq0t9NN6SR5HoN JNMAOBmYFpLQyJvY2jUS6XHEgS07YECT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ymBa sjWpjU4L0sMbMzCINLawm0siI0I+2uwHwXTgUCapxRxJ/t9foBh9d4Z0t0/i9OSCYc1DFFKkc MmnDoqs7jiimrl7BXYdGjjTNc524DsAelHgklrwL2mqrU1r9y3S/i33ZaJgCLM+/gLRYz4+XR j0LdlX9aKsLRv5zvcDKqFeZcZ/cNSTjy+w/9xEJRAOIwILoz9YGxdBKCiZGJclh2Ie56QncCa HaEfQchx7lkRERTPzx3VaTmjMR4summMTYSQRxq/KUHLUIQhvAtsbRXug== 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 23.06.22 at 11:45, Andy Shevchenko wrote: > 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/AC= PI, then >>> they probably want to (opportunistically) have it> >>> >>> With your change it's possible to have a DTS where GPIO line defined i= n a >>> broken way and user won't ever know about it, if they are using platfo= rms >>> without termination support. >> >> This behavior is not introduced with this patch, also in the current co= de the driver >> wont inform the user if it does not make use erroneous defined terminat= ion 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. > Ok I see the point. So what about changing it to: if (port->rs485_term_gpio && !(port->rs485_supported->flags & SER_RS485_TERMINATE_BUS)) { dev_warn(port->dev, "%s (%d): RS485 termination gpio not supported by driver\n", port->name, port->line); devm_gpiod_put(dev, port->rs485_term_gpio); port->rs485_term_gpio =3D NULL; } This would also be consistent to the warnings we print in uart_sanitize_se= rial_rs485() for invalid RS485 settings. Regards, Lino