Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2785869rwb; Mon, 7 Aug 2023 03:35:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRx+cT75O8igJrNM6Wmd28GXsamzwR+C5P++qwM4b9dX/ldYlhIKbyy9ay+oeB0HKLE/gX X-Received: by 2002:a17:906:2095:b0:997:e959:be3e with SMTP id 21-20020a170906209500b00997e959be3emr7223319ejq.76.1691404531311; Mon, 07 Aug 2023 03:35:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691404531; cv=none; d=google.com; s=arc-20160816; b=JQfg5tTgOA8/ko/TsaZBABkNaP8xxDY5WY/JaqlVujiN1fVJWD5OEyvkSCjxFdHROa bLnXwjjfv0mcu5d0PQ6yo+UvMRSDx+3v2UZcI2/Mfl4RtiAghic4PuxSy0vLJ+0LLwU3 Q69pZr0AE2SNA8UDG1QAngZXOb7wYZ/T25CztkEa8C0uhZYTQY1vd31kJFJ3eEIAgT26 u1uaTeErjT1MEMsMfIlSIHFGC4Hd+JOQ70hGRKCBSY24AjY3MBkFTsFQe0qssannNyaL /8jS+FwUxssiSmYhIsXIJ/hhsMKo2R4EIcXoD1n9d7AO1FSvuoevOfUt9mH3iM19W7xA IYeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=0dDAO1bt/2vWPfDekSlH01rl3211+tDoxSvSMKqyrA0=; fh=roC461vVYL6/Z40oLjY55Ftw4Glt9khsidit/CC/YsE=; b=QzQXNqXdY+TatBIVbb4xGK8k2q0Lqds8IIdJZql3KQ/jNQIUBrdf8q+3OfGZ9DyUFG oiPV5h2BGHuW4JJTnJKufSM6hfW306/7Oh/wGklKda+9XTbS4P6EXLZmNg9ElHNvHlpC mEyBgoC3wUS0ipl+07wbsazkOoK/K5XgF7nFVMlHBGwk5mPSJiOWwi3B1XmfTHQvCTwO Pc1vcqgjVE3Tdncp5Fia/hAv2c0r3eBg+5bD8oJadwgpueBw2C6YfcbZMBrprbVvRZp2 UOQkintv5ytG2V9S8UChIgLdwuuHpqRMB2laKz9F7C+iv2NSXiPExVUUhXzKaw3lAPqS nMtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@smartandconnective.com header.s=20191114 header.b=V9qiAjkM; 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 os14-20020a170906af6e00b0098d1c816d43si5561585ejb.85.2023.08.07.03.35.06; Mon, 07 Aug 2023 03:35:31 -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=@smartandconnective.com header.s=20191114 header.b=V9qiAjkM; 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 S229916AbjHGJ4z (ORCPT + 99 others); Mon, 7 Aug 2023 05:56:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbjHGJ4x (ORCPT ); Mon, 7 Aug 2023 05:56:53 -0400 X-Greylist: delayed 520 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 07 Aug 2023 02:56:52 PDT Received: from smtp-8faf.mail.infomaniak.ch (smtp-8faf.mail.infomaniak.ch [IPv6:2001:1600:3:17::8faf]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EA5AF4 for ; Mon, 7 Aug 2023 02:56:51 -0700 (PDT) Received: from smtp-3-0000.mail.infomaniak.ch (unknown [10.4.36.107]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4RKBMY4RNRzMpntf; Mon, 7 Aug 2023 09:48:09 +0000 (UTC) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4RKBMX6qBgztQ; Mon, 7 Aug 2023 11:48:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=smartandconnective.com; s=20191114; t=1691401689; bh=0dDAO1bt/2vWPfDekSlH01rl3211+tDoxSvSMKqyrA0=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=V9qiAjkMjTDbr7D9WqO0lKigdfdlzbj+HEe9bSOiA2pHQki2d+2hm5wmdTi1R/8gH IqjrqYTt/3u33aMgG7CFrDQJf4T3C2f3z1Nm4Jfjm3mE27uhw+KNl1oUPBFIN2gSS9 05Kk15y2TVHMuUbJfmMGDZ3C7yIGqRmZyjl7Mw0U= Message-ID: <6cd83d97f76217e10ebc8ea788e38db671218ab6.camel@smartandconnective.com> Subject: Re: [PATCH] tty: serial: imx: fix rs485 rx after tx From: Sebastien Laveze To: Martin Fuzzey , linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Shawn Guo , Fabio Estevam , Marek Vasut , linux-kernel@vger.kernel.org, Thibaud Canale Date: Mon, 07 Aug 2023 11:48:08 +0200 In-Reply-To: <20230616104838.2729694-1-martin.fuzzey@flowbird.group> References: <20230616104838.2729694-1-martin.fuzzey@flowbird.group> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 X-Infomaniak-Routing: alpha X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Since commit 79d0224f6bf2 ("tty: serial: imx: Handle RS485 DE signal > active high") RS485 reception no longer works after a transmission. I can confirm on a Modbus/RS485 setup. > Fix this by moving the existing loopback disable code to a helper > function > and calling it from imx_uart_start_rx() too. >=20 > Fixes: 79d0224f6bf2 ("tty: serial: imx: Handle RS485 DE signal active > high") Unfortunately this doesn't fix the regression on my setup and I had to fully revert 79d0224f6bf2.=C2=A0 Since there's a Modbus layer on top, it's always TX to remote then RX. Note that RS485 communication has never been perfect on my setup. After TX the DE line is often held active for too long leading to corrupted RX if too close from last TX. This leads to occasional frame loss in Modbus but it's not a blocker. Hope to get some time to investigate. https://bugzilla.kernel.org/show_bug.cgi?id=3D207751