Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3763386rdh; Fri, 29 Sep 2023 01:15:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOuE7SBnl82UoIi6q3GJwhovad0SbQOuil53gPYa8LJYsC0kxPMF+2HL8xNGPZtUdVnzYb X-Received: by 2002:a05:6a21:99a2:b0:15b:95ef:fee6 with SMTP id ve34-20020a056a2199a200b0015b95effee6mr4062131pzb.14.1695975336221; Fri, 29 Sep 2023 01:15:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695975336; cv=none; d=google.com; s=arc-20160816; b=FgcRgJKutlJ7ooo/auoMlmKjRhvh2POpWcLT/CYmbNBQOfeasZpFNV96cPwxhITr+s lZnZEI2jf0twng1Vw3kNwqFrwLXcT4k/7mvY3UrJxU4vLRjBmD2nL13XJlODXjV5K1th 61+Ulo1UF1KED7kSADSDA3vKQFBLuh9MishlIgK3O3BhL+R+m7vi/ZdGrnMt/kKuJ/Yf aWkpUoc5YpTeFTR8AkTIeOyVsLQldgtaFouhQ4L7rvQTW4TtHfGapPEjSUFveJiLWXuo FQnOoKSHHZbBlu/n2CskqqR5pu0h1w8LhChAiScwWD/jgoYHwYkbLltx02ws2cQUtSox AAPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IL4ny/mWxXfhM+8EdR4rvsF0yQKt1qhafQhS5rEjr/U=; fh=yFWzkCk2Su+Bd7PLHK2qaPAD1Voekbw81yWQ9Y2T0ys=; b=Hojdk6oXra1lNvg/jQWbEBFcM4V5Ir/DwgP1kbyzGNKLJzT+g0fayk7u1vaEb6cuNY ZYyIsB2tDxVxwsn1DaxO9xYy7v+etHguwQqJ5hZqXa58JtMCjj9wJYgZWqb2+ftVf442 hT4q+aB3/EucSWsiOOO9514Qg0ukooFDTLxDvWGJb+9+8da4R7IjhUuahFyKhWOhLTik 8LTHMNTmJTc2tfm147/zTCpWCYIXxULpSJ9reF/O4+YUnZJ1PcrkjOJ2wg8Cg/RV6zpr FwyGVgBIOnPsRyYn4UGpyPEX8gTT5PsyZSkn5PI5229PxAWzmNq2e9geM67SqhX/VR/p W5lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uLveylxk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id t1-20020a170902e84100b001b8c824e826si6220429plg.533.2023.09.29.01.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 01:15:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uLveylxk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0D71F80CB16F; Thu, 28 Sep 2023 22:51:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232664AbjI2Fuk (ORCPT + 99 others); Fri, 29 Sep 2023 01:50:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbjI2Fui (ORCPT ); Fri, 29 Sep 2023 01:50:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F172199; Thu, 28 Sep 2023 22:50:37 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03A46C433C9; Fri, 29 Sep 2023 05:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695966636; bh=xkilN8k3NzbzqCiUgNbnaC7gB4bdBzFwDX8FoLrYssI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uLveylxkRyMBmMOE4nSW0CWvAqcpVwt2iCZLV216Q8Bt+d/osFvWKiDptZ9yrAlRq y/NdimLXgp/rPeUYElLldxpw4kieILWUEw6OWwjKLcKHZzpEbVlzqBUoOHUBb6boD5 +Da0JdeT691gQbZLeLn2yoksD4uToaSqfMKfzokQ= Date: Fri, 29 Sep 2023 07:50:32 +0200 From: Greg KH To: Lino Sanfilippo Cc: jirislaby@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, ilpo.jarvinen@linux.intel.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, l.sanfilippo@kunbus.com, lukas@wunner.de, p.rosenberger@kunbus.com, stable@vger.kernel.org Subject: Re: [PATCH 1/6] serial: Do not hold the port lock when setting rx-during-tx GPIO Message-ID: <2023092906-untainted-entangled-4d17@gregkh> References: <20230928221246.13689-1-LinoSanfilippo@gmx.de> <20230928221246.13689-2-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230928221246.13689-2-LinoSanfilippo@gmx.de> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Thu, 28 Sep 2023 22:51:02 -0700 (PDT) On Fri, Sep 29, 2023 at 12:12:41AM +0200, Lino Sanfilippo wrote: > From: Lino Sanfilippo > > Both the imx and stm32 driver set the rx-during-tx GPIO in the > rs485_config() function by means of gpiod_set_value(). Since rs485_config() > is called with the port lock held, this can be an problem in case that > setting the GPIO line can sleep (e.g. if a GPIO expander is used which is > connected via SPI or I2C). > > Avoid this issue by setting the GPIO outside of the port lock in the serial > core and by using gpiod_set_value_cansleep() instead of gpiod_set_value(). > > Since now both the term and the rx-during-tx GPIO are set within the serial > core use a common function uart_set_rs485_gpios() to set both. > > With moving it into the serial core setting the rx-during-tx GPIO is now > automatically done for all drivers that support such a GPIO. > > Cc: stable@vger.kernel.org > Signed-off-by: Lino Sanfilippo You cc: stable on many of these, but do not provide a "Fixes:" tag showing just how far back they should go. Can you do that so that we have a hint as to what to do here? thanks, greg k-h