Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1458966pxb; Wed, 30 Mar 2022 04:10:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxclyjG6ro3qqhNXn2TFWl88AH1SN3mIqOckIZusUa4QnB3NAfSYnj9OjtG7qwtTrYc7UDm X-Received: by 2002:a17:906:7307:b0:6da:92e1:9c83 with SMTP id di7-20020a170906730700b006da92e19c83mr39608086ejc.459.1648638605721; Wed, 30 Mar 2022 04:10:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648638605; cv=none; d=google.com; s=arc-20160816; b=eu87C9bbr1wXG+SDW4CK0XPDB1g0MVEd5Twr/SH5+vd7KEF8hl8gE0GStXkyjd7B5H E8WFK5cYEeOWrnB/z3vHBUS1QOzX7RTcQIdt2lLLDN8hG/skPF+sOQh7y7JXaWWWlG8T J1ZJTTnJKuHv0X+n3+fJLTZ+CvBYnA5vbqbzuMxqE7d6xOoJakX0i8xShwugMSETUnlg KykKGxZQ6wioCM0GUfHAkW6lp6gaHLbX5SqdL9zBUNIZetrDlReLdfH0dOuLhY9DhITq OH2qUQWAeT7RG2wM6mng2Au58LapajK0u7hot2NSEmu7xuykEC158XdHwJ069m2GU/2Z V8/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature:dkim-signature; bh=nA1tDhQT6yyz0RCW/ZAbYtMlxzToy1jJLePTdKpjnYM=; b=fzA7pnz22AL+/XoZd8WYNw9rOJehO6gFkW8onCDxEIJ4hPeZdZ+S1XwgwzrC5ZENlu ArinLJp+sXfPojAYmfhQj2Iuz1FcriZ7HBVanQPEIn6ag/FerzJtGnxTuoomwWGkvTKS 3RjLg4aHhpReld4/MTlQTPpSRnnRGzzpYqtnWbiK8NCOGGRTlr52jGEXJ96zdBGcEN2q S5BJz7587n1IFlwq3xFc2PW8iNh23vms0Ggskhzlq5yejPDw5XzuwBbYGCz+OZrcUcA+ nhyWnzj1fFUkz5fyN0NQxXKU2c2eZQsfDU+G9VoqhSzPAtJYaLAFCSYGVNz2v7OOavyX ULng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b="oDHuceZ/"; dkim=pass header.i=@tq-group.com header.s=key1 header.b=As1uN9JR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w17-20020a1709062f9100b006dfaf4466e5si20692831eji.223.2022.03.30.04.09.39; Wed, 30 Mar 2022 04:10:05 -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=@tq-group.com header.s=key1 header.b="oDHuceZ/"; dkim=pass header.i=@tq-group.com header.s=key1 header.b=As1uN9JR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237075AbiC2NEh (ORCPT + 99 others); Tue, 29 Mar 2022 09:04:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235695AbiC2NEf (ORCPT ); Tue, 29 Mar 2022 09:04:35 -0400 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 912A6DD941; Tue, 29 Mar 2022 06:02:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1648558972; x=1680094972; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=nA1tDhQT6yyz0RCW/ZAbYtMlxzToy1jJLePTdKpjnYM=; b=oDHuceZ/vjo93yXfvzAbsOuQPoKCrdeEoq0QmV50kHgvcprZf9Pk3xub c3CV/CEV2eMjfUelWkSI8sB13mRm9On90kpLyPX4Svs8lyGaWmYI1bNyy 6YEKMVmRZsojeYad6Cz4uUSiKn67M+pB2XfX+9iX91Tcw3ahSFC3piolB JRcovG/bS+PrN8gm5mzj9zeABiGcyxd5ymG7a8H4g3NatIO/urbZSZXJH n8sf/K2lFSnMxk7/sVOSfxzhtG5CmRAF9QxkC6Yq1HzBjeIr6cmgnc5wx Xkj5zFdeVLjBNCNSiJg9uhLAbUFLKg7eVu/4Qi24h7D74fnrL0ZsArBwO w==; X-IronPort-AV: E=Sophos;i="5.90,220,1643670000"; d="scan'208";a="22962188" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 29 Mar 2022 15:02:49 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Tue, 29 Mar 2022 15:02:49 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Tue, 29 Mar 2022 15:02:49 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1648558969; x=1680094969; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=nA1tDhQT6yyz0RCW/ZAbYtMlxzToy1jJLePTdKpjnYM=; b=As1uN9JROmXcNreoIDglAbHKFLD1R42QzLHMevUhrgVGzEVOoqFqyddb M4m2XFBNSqwJd/UoBYFE5VG0DowQIEDTWTXUC/KJxF+UpgTHkQxJBQoDC vEkpC1v7PEtGKNus33mu4NdsuOiDQOIN73ghYo5snVEENwTn0aYV+nM/r Lhcnm6Gp8uE6SLvBQFrvslFP6zkGRNBsVDxWm2kQ5Y7/6ZEzbt0MPtKKB Ae6nIDtDHrGq1/shqVoTxm0eNNLrPQV9UDSebazO+4lYHLpbOISfwAnG4 b9bmNuhU4kP7kGRHQ/7J9AStRFtksygXt+SOEJS1Su9Jmk+lh2bs5G0Bx g==; X-IronPort-AV: E=Sophos;i="5.90,220,1643670000"; d="scan'208";a="22962187" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 29 Mar 2022 15:02:49 +0200 Received: from schifferm-ubuntu (SCHIFFERM-M2.tq-net.de [10.121.49.14]) by vtuxmail01.tq-net.de (Postfix) with ESMTPA id 31175280065; Tue, 29 Mar 2022 15:02:49 +0200 (CEST) Message-ID: <82266d339e09ad16963e16014cd836fa670b3a0c.camel@ew.tq-group.com> Subject: RE: [PATCH] serial: Revert RS485 polarity change on UART open From: Matthias Schiffer To: David Laight Cc: Greg Kroah-Hartman , Jiri Slaby , Russell King , "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Ilpo =?ISO-8859-1?Q?J=E4rvinen?= , Lino Sanfilippo , Lukas Wunner Date: Tue, 29 Mar 2022 15:02:48 +0200 In-Reply-To: <749eee7dd2c7464a8c4d9ea5972205fa@AcuMS.aculab.com> References: <20220329085050.311408-1-matthias.schiffer@ew.tq-group.com> <20220329100328.GA2090@wunner.de> <749eee7dd2c7464a8c4d9ea5972205fa@AcuMS.aculab.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,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 Tue, 2022-03-29 at 12:55 +0000, David Laight wrote: > From: Matthias Schiffer > > Sent: 29 March 2022 11:39 > ... > > I guess that would work. The fact that even the different > > variants of the 8250 are implemented inconsistently makes this > > especially ugly... It certainly puts a damper on the efforts to > > make > > the handling of RS485 in serial drivers more generic. > > One thing to remember is that RS232 (IIRC really V.38) line driver > chips are typically inverting. > > So the modem signals on a TTL level output will have the > opposite polarity to that required on the actual connector. > > Normally a UART will have an 'active high' register bit for > a modem signal that drives and 'active low' pin so you get > the correct polarity with an inverting line driver. > > David > Indeed. As far as I can tell, this property of UARTs is what got us into this mess: Some people interpreted SER_RS485_RTS_ON_SEND as "set the RTS flag in the MCR register on send", while other thought it should mean "set the RTS pin to high on send", leading to opposite behaviours in different UART drivers (and even different UART variants in the same driver, in the case of the 8250 family). Regards, Matthias