From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 254D2C43334 for ; Sat, 25 Jun 2022 20:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233540AbiFYUTQ (ORCPT ); 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) 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