Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5219742rdb; Wed, 13 Dec 2023 02:26:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOghUFdLALKgUG6e73+L3K7VtSc4SrUUACnCv7hp3ftkF13yhVFQ23F/rXRX+pkU7rGK9O X-Received: by 2002:a05:6358:998d:b0:170:b5a5:20d8 with SMTP id j13-20020a056358998d00b00170b5a520d8mr8693666rwb.61.1702463189310; Wed, 13 Dec 2023 02:26:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702463189; cv=none; d=google.com; s=arc-20160816; b=USm9E8GT5aNRhA0V3rqo2Cdmi3J6CQ2yPbI/ccA8l8Pn85IeVkVSSXTYg+KVtS51iC Jim7mJJz7DbMEoIzATFF216bDW/dx8S/wz4eEItA6Vc2ViknkuiTgdoXcE16yPW26+zT lgIxOcNWqfzr7NpqESWmDQymED52qCRViw/RWQr4X2DCdUp+kWYcOo8EaT8XHJpubF+1 /rao3v71U/d47gmQZsSedPEG5miRl/jOR441qfaaU5qVc5SyxRpi1QS37RZYtFUql+VW 9TbRs4y+zzKN35m6tyP049tERo3aYRVkUjNde8g85krmHJn5McexR6ZRVXHvz6pY6Oq4 6duA== 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=0rJIQT0vDIQ1Y6YqcAaLbhCsG2cuPVQPU50H5hz+ukM=; fh=mDo9AJ/yd0LvLDNxlF7M3XLvHnGX9YNrpHW+lPaHt54=; b=W/BQnr3BxQr4AR28yrwASWmqZchTwbWryZmmggfrwBuvxpkP1/X3LNhK9Y36cFELHC kz5yRF7UwMZh7ZlIr4FC0Jr26Eh21EwsIgPr15sTyBqgrmqbYDvJb8ytgiuLBIu9PO5l vx+M2UGB1W0UJOWa09IBx6q5ueOBqRKoojomdYAwCb2w7tCL8jGCRDUa6lmSRRI5VOp5 r8bFNlADTs+cyygNbZb8Lt9wofpNwCJ/WCYXJKBIlj+Vv+O2Lfodv006McZ/kmi8M3z1 kNFgMKreGcn6NiV/C43b49O49a0rh0trrpJvDnwMqN4YDMcrSX/2GblhVu9raGO0tART mDZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=n2Kuf9Wk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bq13-20020a056a02044d00b005be00224982si9808734pgb.381.2023.12.13.02.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 02:26:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=n2Kuf9Wk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 637D0806E5E4; Wed, 13 Dec 2023 02:26:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233265AbjLMK0S (ORCPT + 99 others); Wed, 13 Dec 2023 05:26:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235342AbjLMK0Q (ORCPT ); Wed, 13 Dec 2023 05:26:16 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F6A3DB; Wed, 13 Dec 2023 02:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702463182; x=1733999182; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=1tYxh5KDFW8jW7XIdLhEhe4VnSkz8vV7KmPG573q+vc=; b=n2Kuf9WkYzq/SyPgzCXoKmlyZeOueYBPZsyGkzlldf3rXy4Ybq7EQUP2 N1nFINaUQf2214ZoL3E01uM56Ga1HfH+ESLQRkUR+uRW1amUNwjm80bg9 S8q4QXucub4QbXtWL9QIZCpAeV43xT/wxhgpgKcZA8cW1qPS3eLsA4irg otCTRZ8LO9ZWYZyzNMJvDFjb2Sr+iS2kIzQXbCCNYYKTUghfdK8PQtdGE FyQkUB9Cp9Rhq3Xs6kZxHA5fpUJbT1IenHz00SA+mfVdJz1uG7m1/pCpN n1Gmv9B9XpRLMMy5PynzdqwlR5Ilv+VIzBOMUzn9UBqfAHSF5xeyXzyXG w==; X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="16497467" X-IronPort-AV: E=Sophos;i="6.04,272,1695711600"; d="scan'208";a="16497467" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 02:26:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10922"; a="897276991" X-IronPort-AV: E=Sophos;i="6.04,272,1695711600"; d="scan'208";a="897276991" Received: from stetter-mobl1.ger.corp.intel.com ([10.252.50.95]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 02:26:17 -0800 Date: Wed, 13 Dec 2023 12:26:16 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Lino Sanfilippo cc: Greg Kroah-Hartman , Jiri Slaby , u.kleine-koenig@pengutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, cniedermaier@dh-electronics.com, hugo@hugovil.com, LKML , linux-serial , LinoSanfilippo@gmx.de, Lukas Wunner , p.rosenberger@kunbus.com, stable@vger.kernel.org Subject: Re: [PATCH v5 6/7] serial: omap: do not override settings for RS485 support In-Reply-To: <20231209125836.16294-7-l.sanfilippo@kunbus.com> Message-ID: References: <20231209125836.16294-1-l.sanfilippo@kunbus.com> <20231209125836.16294-7-l.sanfilippo@kunbus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 02:26:28 -0800 (PST) On Sat, 9 Dec 2023, Lino Sanfilippo wrote: > In serial_omap_rs485() RS485 support may be deactivated due to a missing There's no serial_omap_rs485() function. I assume/know you meant serial_omap_probe_rs485() but please correct. > RTS GPIO. This is done by nullifying the ports rs485_supported struct. > After that however the serial_omap_rs485_supported struct is assigned to > the same structure unconditionally, which results in an unintended > reactivation of RS485 support. > > Fix this by callling serial_omap_rs485() after the assignment of callling -> calling. Again, the function name is incorrect. > rs485_supported. Wouldn't it be better if all rs485 init/setups would occur in the same place rather than being spread around? That is, move the rs485_config and rs485_supported setup into serial_omap_probe_rs485()? -- i. > Fixes: e2752ae3cfc9 ("serial: omap: Disallow RS-485 if rts-gpio is not specified") > Cc: stable@vger.kernel.org > Signed-off-by: Lino Sanfilippo > --- > drivers/tty/serial/omap-serial.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c > index ad4c1c5d0a7f..d9b2936308c4 100644 > --- a/drivers/tty/serial/omap-serial.c > +++ b/drivers/tty/serial/omap-serial.c > @@ -1604,10 +1604,6 @@ static int serial_omap_probe(struct platform_device *pdev) > dev_info(up->port.dev, "no wakeirq for uart%d\n", > up->port.line); > > - ret = serial_omap_probe_rs485(up, &pdev->dev); > - if (ret < 0) > - goto err_rs485; > - > sprintf(up->name, "OMAP UART%d", up->port.line); > up->port.mapbase = mem->start; > up->port.membase = base; > @@ -1622,6 +1618,10 @@ static int serial_omap_probe(struct platform_device *pdev) > DEFAULT_CLK_SPEED); > } > > + ret = serial_omap_probe_rs485(up, &pdev->dev); > + if (ret < 0) > + goto err_rs485; > + > up->latency = PM_QOS_CPU_LATENCY_DEFAULT_VALUE; > up->calc_latency = PM_QOS_CPU_LATENCY_DEFAULT_VALUE; > cpu_latency_qos_add_request(&up->pm_qos_request, up->latency); > -- > 2.42.0 > >