Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp234752imw; Mon, 4 Jul 2022 08:16:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1so3T7p0stOWxZPa+1QCllQMneNKSTYUR0u7IT/0dmonZhMF4HBbDx/C+2bn5b3hptrVwuF X-Received: by 2002:a17:907:8c05:b0:726:2a09:c951 with SMTP id ta5-20020a1709078c0500b007262a09c951mr28966736ejc.143.1656947782479; Mon, 04 Jul 2022 08:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656947782; cv=none; d=google.com; s=arc-20160816; b=q+JypkdLZpua2eE5HSQzcvY795qHrsYRoQ+41HM4YQxIEH0qUj9iQqw90FTZqKM9j1 sF6H5xXl6HwVYhlf45S0mNSbF6e0lJgoEx7ku6qUdfrpGQmAIc8f92uXSl8bsgqRNZPv QEv+emedf7ifbitvhoncO8+Z/Tz8sHilUcLhaLdjwm1FRz/dbL8eCvixCBxLTTX7qRzC 5Y3ESBngXnKFGiHJp6JAa8dkumVmiA9NqHzEHQhrHcnp5KOlc44Y2+AQk4jC1SI4QY31 K17J7rDXjcraUVdrqr5hUtPVBfLul6SBaz3cDyNt5NpnZmQfXhvPfiOe9CL5iBRdSRi8 PPRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ZXQargqU+zUSZ5LLzbVZ7O/GL+BkLPl0yqGR2QXQRdQ=; b=iFe0siIUT+tFCBBXUkDm5nBXqb72ysrNJ89kbOlGOZMMaNTKQQdfu0qMIzM0k9MwfO 05piiVYbQWrpZCuQd0vlLLcWT9bao/aEOm7M/yjRoRWRIPm2fiyYs63Ib9PI+j0S0UPe TfGSKJF2C0pHcnmKzPGdcZP3cJohzy23ENpNGmjdNE2GCcsJdwN5jAbIvOAgxaIHhXyd iTkAI4CdAZFHk6Yb6ZITdGXTm/7ZkIDz0+J569HkNmxE5Hfpkjv+CSYzaswVFQ/XSvXn Za4t3VVY+cpCNyxZFYQxtg8amGeqMTm17k9uvFHHpMues32+rQ9+U5Euot6/snhMkVfB TO/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=joU5t0ce; 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=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020aa7cb52000000b0043a729da525si177963edt.237.2022.07.04.08.15.55; Mon, 04 Jul 2022 08:16:22 -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; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=joU5t0ce; 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=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232251AbiGDPOQ (ORCPT + 99 others); Mon, 4 Jul 2022 11:14:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbiGDPOO (ORCPT ); Mon, 4 Jul 2022 11:14:14 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37ADEBC83; Mon, 4 Jul 2022 08:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656947623; bh=lw9l19cpkr4yCqcc6HT5BAREEapDuSh+BtMq4Z73ojA=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=joU5t0cevbn9FI0a3XUrCa89xeWo84Gyc3+bVds9L2qAWszvbCKziivpG4hR6r7oB m0dNdOh+uhTlrn3MmgupsNYjZWUz9xS3REe5+Hy2d34gM7NSFCRv+OhaHNl6z5iMx+ wQeOcrfhPoI0h6AGR585T0/XEYi1H3MvdPBWcaBA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.69] ([46.223.3.210]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mgeo8-1nh3Ep2wyy-00h9Fb; Mon, 04 Jul 2022 17:13:43 +0200 Message-ID: <576feae5-87f3-fbac-4349-126cf5244821@gmx.de> Date: Mon, 4 Jul 2022 17:13:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v2 2/9] serial: core, 8250: set RS485 termination gpio in serial core Content-Language: en-US To: =?UTF-8?Q?Ilpo_J=c3=a4rvinen?= Cc: Greg Kroah-Hartman , Jiri Slaby , robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, Andy Shevchenko , vz@mleia.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-serial , LKML , Lukas Wunner , p.rosenberger@kunbus.com, Lino Sanfilippo References: <20220703170039.2058202-1-LinoSanfilippo@gmx.de> <20220703170039.2058202-3-LinoSanfilippo@gmx.de> <355354ef-61ff-692d-aad-3b5721db420@linux.intel.com> From: Lino Sanfilippo In-Reply-To: <355354ef-61ff-692d-aad-3b5721db420@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:7BLvkQ8Daoruut0OeY5prEW4I+47ILt1MxrQ+u1s/f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M5sNJeFg0vxO3Nv5nWQBbOmZcmwOlW0z9Onudj3JDs87ZoYBXXL0me7WVjPy npO1ARNdrYRHokIAVmoxBnyyw2u9yCXaqfomjutlCg1cZFGQFzDlqoLHYndVQJS2uRK0NQ/lZ vv//o4SAoXC//ux4t7fJC+NXcIRkdJI0G70VxQe1dZaArlXSONgr2tHPxd44tBSOKRYz17Gij VQ0EOFYHHgo0opMIy0ZEoNJxhzXkyZGg0da7GL5a1wSoHGrWqF7iusMTgycLowjmc+ZuHWL/b l+49bBwS5aShZ8fs31cPGs1dspSVcxR+K28Z9PlIVkh+3PAXR4eZ7TDLw== X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,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 04.07.22 11:51, Ilpo J=C3=A4rvinen wrote: > On Sun, 3 Jul 2022, Lino Sanfilippo wrote: > >> From: Lino Sanfilippo >> >> In serial8250_em485_config() the termination GPIO is set with the uart_= port >> spinlock held. This is an issue if setting the GPIO line can sleep (e.g= . >> since the concerning GPIO expander is connected via SPI or I2C). >> >> Fix this by setting the termination line outside of the uart_port spinl= ock >> in the serial core and using gpiod_set_value_cansleep() which instead o= f >> gpiod_set_value() allows to sleep. >> >> Beside fixing the termination GPIO line setting for the 8250 driver thi= s >> change also makes setting the termination GPIO generic for all UART >> drivers. >> >> Signed-off-by: Lino Sanfilippo >> --- >> drivers/tty/serial/8250/8250_port.c | 3 --- >> drivers/tty/serial/serial_core.c | 12 ++++++++++++ >> 2 files changed, 12 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8= 250/8250_port.c >> index ed2a606f2da7..72252d956f17 100644 >> --- a/drivers/tty/serial/8250/8250_port.c >> +++ b/drivers/tty/serial/8250/8250_port.c >> @@ -676,9 +676,6 @@ int serial8250_em485_config(struct uart_port *port,= struct ktermios *termios, >> rs485->flags &=3D ~SER_RS485_RTS_AFTER_SEND; >> } >> >> - gpiod_set_value(port->rs485_term_gpio, >> - rs485->flags & SER_RS485_TERMINATE_BUS); >> - > > I sent a series to make .rs485_supported per uart_port and properly set > SER_RS485_TERMINATE_BUS according to DT config. With that series added > first, SER_RS485_TERMINATE_BUS should also be removed from > serial8250_em485_supported so that serial core can properly manage > it all. > Ok, I will rebase the next version of my patches on your series then. Regards, Lino