Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1592014iog; Sat, 25 Jun 2022 13:42:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sl7KwoxlxMFaQmqzYmx3J4DznXbMBHwO/slret/B87b/sM7rBxtFchrEUq+cPncGkEZbQ/ X-Received: by 2002:a17:907:9005:b0:715:76ce:4476 with SMTP id ay5-20020a170907900500b0071576ce4476mr5192577ejc.560.1656189762274; Sat, 25 Jun 2022 13:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656189762; cv=none; d=google.com; s=arc-20160816; b=hg5hR0ksQb0OmfdLobbxHEIyxhTeBMexPlJEN9uI1qCZ6cEVGqWox2JTSJ/x3A0e1R 3JmH6ADhOKqBaU9QbejYpCMhzhyujf3S3MyMyh4/eqCYpugVB/Qh7lCq81Rpeu91G02y j/P6yC6xqFKv3ILWy/bby8aOxW0Yw556YzdR4lQUGUYCXWAGPqMgQynenoLC+wn7EodA UOqh//2ZFg5VW8LLjfXyh5dMHsOF0JHY2z6nU15DuGKkOtOS4wAz7YfigPDFBnJKTkZ4 FNG9FWMM1tzUVwN91m6jjXeXwz7qCOqIE8wKIkNh1Bwx0prThLAt8Yn2OEwXbprLFPX2 rhhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=y4kJOQtfX1IJVBn1OFalA+Os6MpK0YVU0DIv1+OHCio=; b=ZfwyMPfq8BnTlN3KwtSJhNzbIEQa6MhgJNNbV5vTcrpleET8eKofOKLJi1nc/beHoH dlLvrxhhBe791Fk3CS7YMi21wfkrd4vwWIvuV+VQ4veGnE3UGcXWJZK4dXpILSYu6nux sIRK0im4Kcn/EeMxCdUuuHVuDE+p2MOFM04JvTXGeh4ySIcgcWjmHRlgQu/Jbkg2hZR0 DPGc6vJLTHH9qa8te9ku3IxxGcz/flMarr1iwhwg4gTi5Qc3FiiIzzuu1meQBCTGlMgI QLH8uI8DhGIEorXC1450hwQVMjKULoV7wMPRe1S5hOG5jSIfwTGWxLffal/icoqGuxRq v0tQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a170906284e00b0070ed5373a2csi6415497ejc.298.2022.06.25.13.42.15; Sat, 25 Jun 2022 13:42:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233533AbiFYUTQ (ORCPT + 99 others); Sat, 25 Jun 2022 16:19:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233336AbiFYUTP (ORCPT ); Sat, 25 Jun 2022 16:19:15 -0400 Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [IPv6:2a01:4f8:150:2161:1:b009:f23e:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AB5A13F7A; Sat, 25 Jun 2022 13:19:14 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 0B184101E6AB3; Sat, 25 Jun 2022 22:19:13 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id E02B22C046A; Sat, 25 Jun 2022 22:19:12 +0200 (CEST) Date: Sat, 25 Jun 2022 22:19:12 +0200 From: Lukas Wunner To: Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: linux-serial@vger.kernel.org, Greg KH , Jiri Slaby , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-kernel@vger.kernel.org, Lino Sanfilippo , Andy Shevchenko Subject: Re: [PATCH 01/36] serial: Add uart_rs485_config() Message-ID: <20220625201912.GA29720@wunner.de> References: <20220606100433.13793-1-ilpo.jarvinen@linux.intel.com> <20220606100433.13793-2-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220606100433.13793-2-ilpo.jarvinen@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,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 On Mon, Jun 06, 2022 at 01:03:58PM +0300, Ilpo J?rvinen wrote: > A few serial drivers make a call to rs485_config() themselves (all > these seem to relate to init). Convert them all to use a common helper > which makes it easy to make adjustments on tasks related to it as > serial_rs485 struct sanitization is going to be added. [...] --- a/drivers/tty/serial/serial_core.c > +++ b/drivers/tty/serial/serial_core.c > @@ -1276,6 +1276,12 @@ static int uart_get_icount(struct tty_struct *tty, > return 0; > } > > +int uart_rs485_config(struct uart_port *port) > +{ > + return port->rs485_config(port, &port->rs485); > +} > +EXPORT_SYMBOL_GPL(uart_rs485_config); Why doesn't this helper acquire the port spinlock, unlike uart_set_rs485_config()? Is this safe? Do all callers hold the lock? Do we need an assertion to verify the lock is held? Thanks, Lukas