Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5849227rdb; Thu, 14 Dec 2023 01:00:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFEu/bOnmjxitFfnfKJE1LNSk64lpEZP8iXkvxl/yi+NNKZsyUfNtaBxGhH3MBroyKPsOK+ X-Received: by 2002:a05:6358:5e04:b0:16d:e151:a7d8 with SMTP id q4-20020a0563585e0400b0016de151a7d8mr6336061rwn.14.1702544429054; Thu, 14 Dec 2023 01:00:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702544429; cv=none; d=google.com; s=arc-20160816; b=y/VuD87LrWOH/3tMZIdlrR6v+MlBL5hG2YQUJbGGP7ETBn44tDOrXIOo4PyAfIhjwt 1dg3OcMgcVYNAkxXvaxMq8OZIq99cMIqzQOnHqtHAvwaJPnfl5XpncrhXAjtsCAKHjSJ 7uPBymucumOvoWoXcc74bDh94jPV13/vQDn53LRjGqaDrWGd8Tz1rhnpSkGjWNAjxdBr hApjhkHS1TU9seaXGl0HpeilCwj/HxwREhui3hAYQNvXUcKsqFPwuM3LVYRZIrLr4aZT QKI+Sed7DPj2XbglxMc9NuVWO7olSvV3DTuvOe3PATHIkBAVC1ZYtYBn8SkDXoRdQyy1 Fqqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=rW7iD3iyUbRE7k05Xorjz5/WugPVbjInuuRrKyCHKCo=; fh=Il6vLvUzUeHG5R8RSH4oKUcGt0Ve0HhtkSqjguudIvY=; b=GBC19swv8PFKHHOJc13jmW0/UoL+Hsh64CYpcrquCGAZd4H4M8sNOYQjVyAh/TdI2V HCu8w2IiYwuuSlcPftFDgbYInoWjJk1Xhg8G/cQQlFotA4kQEddWcJPC/Z1hl7YiGf0v uKJS4+hYdww+YeLW6Zkfopu4uIqSlKQ8IF+EXkcVw0PBDeXZOa4KecmL/5yF4sbk1z7j vZsBEF84SaZmhLQL/ixYYyC3iddc4IT3UG3XrHSbEJ8IV/ukLhoACQwK+6o1Efb1UsdI aZwWGAIzTt9TM4lrZoyGiiRFpjwOYr997Zcj7irL75e+d1esS30UeB1aHZbXwybkhxoZ m2cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=B00+lRyE; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id i1-20020a17090a974100b00286ce76ff01si8232607pjw.146.2023.12.14.01.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 01:00: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=@gmx.de header.s=s31663417 header.b=B00+lRyE; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7C5B48029263; Thu, 14 Dec 2023 01:00:27 -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 S229734AbjLNJAS (ORCPT + 99 others); Thu, 14 Dec 2023 04:00:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjLNJAQ (ORCPT ); Thu, 14 Dec 2023 04:00:16 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E50510A; Thu, 14 Dec 2023 01:00:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1702544401; x=1703149201; i=linosanfilippo@gmx.de; bh=i3Hz+ytUFA4jUXYAsPUZy/EuCtWs2rkgtqsGERhQNr8=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=B00+lRyETfYe+87IC1S0gO42UrRzj4IDXlh5QSrQaqOPX+XYx5aaj7GX6YkYb9uF AAykgwveahf/4uyrhpjTWPw8yZ4B4FUNAi7h9iiLE1bLTP/fFDrNMWdMm4L5wWHHu IH6w26ZKnTf80aTjcEm4n8X9sdoZm1gzArguieF9jFJAeYhY+l8dCPsZ/BT5OOMZh 3513Xpp0mCZEsW1bJWHDP+S9c+m1qn7DyxADCN8hBoYL4P7CkK6S/13rCyznijwzk aOs7m6cMSfRx7WQdMnjsKWAcwGC4A9rmNRcQ1UkfRHXOpcgLFXs4NO/wX4VkntzAr /KbF3bwitUGfbnaBmw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.2.42] ([84.180.3.177]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N7QxB-1rH80a053l-017mQx; Thu, 14 Dec 2023 10:00:01 +0100 Message-ID: Date: Thu, 14 Dec 2023 10:00:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V5 3/3] tty: serial: uartps: Add rs485 support to uartps driver Content-Language: en-US To: Manikanta Guntupalli , git@amd.com, michal.simek@amd.com, gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, jirislaby@kernel.org, linux-arm-kernel@lists.infradead.org Cc: radhey.shyam.pandey@amd.com, srinivas.goud@amd.com, shubhrajyoti.datta@amd.com, manion05gk@gmail.com References: <20231213130023.606486-1-manikanta.guntupalli@amd.com> <20231213130023.606486-4-manikanta.guntupalli@amd.com> From: Lino Sanfilippo In-Reply-To: <20231213130023.606486-4-manikanta.guntupalli@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:pK8MFRjHp2YaZUknT+LRCDyINjh9i/0Jrq0/enwVR0460Vv8uBG jEhoBvjHDZiW26EnG9lgKBjPWoxplSfjGuR22APQXvVrno70BetBrA7LSnxExszo1a/O5gV loInpLjPZxRyVQeVsIoD4xa8mR/aqLRKC+QCl58O4a0vJjWQzZEDtjsldDjbI0O+RoaXHfw karSL1jB/+wDGZDkoKmaQ== UI-OutboundReport: notjunk:1;M01:P0:EI9S+Cq+1aU=;Siw+EKHPttacc+oKnTGnheJocRM CF0+vm3a9XnjSROmSR4PRlaHwFYax+mLYqDdXpk0rCt/S7wCBe4kgryA5z7HH1Qk8/jC5qn/k argluzBsuic8Xdvl4Zs1namxqEOcbwGCx9UE04NQQBPe6jJXFgAThrLJFU7p8zm/3TiTIHjOb 4ooaGAw5Aa96JE/VpnzFZGDCnwTdryMI26wIOHUoNpLavPSwAUAU/9kdP2fK61Z+nt5nfqyqE tJWmHOx+x3nfni11q22hBl2ioHVrRr08KEZgs6gyDBIUlCygZ1oo8mGdhXIhecbgSYtnrsK+C GowdrnlFFBClau64OgmrHBUrkpH6HlgVldEUo7+wP6ssF9UrmumnMpsXYvSvwZG+L4EgsgYHx z/Zrzkd5G8L7IeDJq+8Baic2h+lltxO9vrWzch7XTD6+bpGV/wLLkkrYdcKwKEhKKytu2h+yK fUOEYAN//xiWOW89UZb4+NSP9yYDLabHJNmfLMIus8ze0OGfFxy0sTfZpN7f18ULlPQrVmOdb oPRBnExJNdMLIObU/l4Ct7CdLBZNcTfHRt3JBv1QAGKoC5IR7DqW2bqEdGoj4xMzRgERlmaez LCPoF4+oOTrKmzmzLHCK+mOOCZD6eYq39gsNHwxiPcFX5hT0tCSMVvlbQ6axOerYvqD4+s26M jZ9CEX1NV56FLCPNlACfCkNXttel570pUfgPxjZ1TmLyszRp3s3eHytzj/U+E/CXz3xrVW1Eh faz1DwqpXE7dXbRKU6VGhjCzSUSc4EvBaG7IodmXhQDlMsJC2Js+EojhOGwCYbl/y/xIB3fzu u9d8KsBNlmKugz35thMUdJF4j5QA4SyjINH5RloMTKP69ncSd5nd0Y4NUCtL67qDtmmQm/2FL eKE0ub6FS6jeDcZmujL+72KEXKTWbiwr7mb0gMNQlRlsk5tWh2zhksBr53yK7xY1/CrW4H2hl cNsGTQ== X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 14 Dec 2023 01:00:27 -0800 (PST) Hi, On 13.12.23 14:00, Manikanta Guntupalli wrote: > > +/** > + * cdns_rs485_rx_callback - Timer rx callback handler for rs485. > + * @t: Handle to the timer list structure > + */ > +static void cdns_rs485_rx_callback(struct timer_list *t) > +{ > + struct cdns_uart *cdns_uart =3D from_timer(cdns_uart, t, timer); > + > + /* > + * Default Rx should be setup, because Rx signaling path > + * need to enable to receive data. > + */ > + cdns_rs485_rx_setup(cdns_uart); > +} > + > +/** > + * cdns_rs485_tx_callback - Timer tx callback handler for rs485. > + * @t: Handle to the timer list structure > + */ > +static void cdns_rs485_tx_callback(struct timer_list *t) > +{ > + struct cdns_uart *cdns_uart =3D from_timer(cdns_uart, t, timer); > + > + cdns_uart_handle_tx(cdns_uart->port); This is called without holding the port lock now. Are you sure the lock is= not needed? AFAIK the port lock is needed at least for accessing the circular buffer. > + > + /* Enable the TX Empty interrupt */ > + writel(CDNS_UART_IXR_TXEMPTY, cdns_uart->port->membase + CDNS_UART_IER= ); > + > + if (uart_circ_empty(&cdns_uart->port->state->xmit) || > + uart_tx_stopped(cdns_uart->port)) { > + timer_setup(&cdns_uart->timer, cdns_rs485_rx_callback, 0); > + mod_timer(&cdns_uart->timer, jiffies + > + msecs_to_jiffies(cdns_uart->port->rs485.delay_rts_after_send)); > + } > +} Regards, Lino