Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6025161iog; Thu, 23 Jun 2022 09:48:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uPEzJVVTBdjFu80F3iZNTUqizMNxjZJUUc7hp0ukkF+x9dsObCF/bM8DiU5xzQx9g93OUN X-Received: by 2002:a63:7511:0:b0:40c:a228:c3ca with SMTP id q17-20020a637511000000b0040ca228c3camr8321691pgc.316.1656002892953; Thu, 23 Jun 2022 09:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656002892; cv=none; d=google.com; s=arc-20160816; b=DRV2gMVAs4/TWIPG4SdiFrcZjmWf8+vDU6oYZFeh/TY7/UOufaZxSx1Z4kBDm6WeYZ vPenU6Hqpg7fIBCffFmMMTX7Y0Wrv9dgN9qIFu49s+Gi3nVTFN4F9H17joXUTqCHFACu kOqi5KvDl8LkGmZf2J9+KFaiizzHFo/lxkvyysSX7AL7tyJ4fSEkmlqsSrtXVH1dzCLi aX/niY6L46wxKeh8OFYQB1zo89WZkB1bPTB0nzO7+6/NTSGtl84Srs9nC7q58ElIrOoj Ftc33LEuuClmrhifPbBMoo3TEcbeOGVqkBqIcyWSY2TR1RX2THWJ3I91BE/pYwiD1fru 5I+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=7/YxDs2uS5OcFYzExJaYmL2UoZ87fEqTjdHo8zP0lPk=; b=xYJaIKn+AKhqvcy02caUsj6OuJL0Nu8KSTTgFdeiYBRLdSm/qRiQp8i5FQnv83Gj/n uose1bvgP4NbMXp5yjXyAsg1Q6ZpFOWcV4v7MOHZtd3QpnC2JdXVRy3YqUrJiLMW+CO1 b+fvHBqMAb6cxnhtaJBrd8VV17i64aPYAQCTebQsMTMkoAkwoO8kwqi+cp2F0T6kTEv5 87H+Vv+HWotpLebt7kGd/wg9Uq8lTBWHe6w4WXrIn3F3n1lv6tAsyU4vZF82a87YGkN4 V6coB2fIElyOaQ5gpGAQtSfZTpZUSR+Ig4MrXFcwkWdBr3Xebxi7QjNXA0vhH3UfKajB HrxQ== ARC-Authentication-Results: i=1; mx.google.com; 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=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 o3-20020a170902d4c300b00163ad368fe7si106410plg.71.2022.06.23.09.47.58; Thu, 23 Jun 2022 09:48:12 -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; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232159AbiFWQcq (ORCPT + 99 others); Thu, 23 Jun 2022 12:32:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230338AbiFWQco (ORCPT ); Thu, 23 Jun 2022 12:32:44 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59D49473AC; Thu, 23 Jun 2022 09:32:43 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6400,9594,10386"; a="261202126" X-IronPort-AV: E=Sophos;i="5.92,216,1650956400"; d="scan'208";a="261202126" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 09:32:42 -0700 X-IronPort-AV: E=Sophos;i="5.92,216,1650956400"; d="scan'208";a="834712996" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 09:32:39 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1o4Pky-000tDG-6n; Thu, 23 Jun 2022 19:32:36 +0300 Date: Thu, 23 Jun 2022 19:32:35 +0300 From: Andy Shevchenko To: Lino Sanfilippo Cc: Greg Kroah-Hartman , Jiri Slaby , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , 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 Subject: Re: [PATCH 1/8] serial: core: only get RS485 termination gpio if supported Message-ID: References: <20220622154659.8710-1-LinoSanfilippo@gmx.de> <20220622154659.8710-2-LinoSanfilippo@gmx.de> <2dda5707-6f13-6d33-863d-a88b89e88a88@gmx.de> <52ea773c-b5b0-fc4d-9b85-022676778af7@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52ea773c-b5b0-fc4d-9b85-022676778af7@gmx.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no 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 06:08:56PM +0200, Lino Sanfilippo wrote: > 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/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. > > > > Ok I see the point. So what about changing it to: You mean adding below after the existing code in the module? > 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 = NULL; > } > > This would also be consistent to the warnings we print in uart_sanitize_serial_rs485() for invalid > RS485 settings. Probably it's okay, but I dunno we have much on this to gain. Users may start complaining of this (harmless) warning. I leave it to others to comment. -- With Best Regards, Andy Shevchenko