Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp935817ybh; Wed, 18 Mar 2020 11:51:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsCkWSVlPprU+FymOnYV9levEA+kTfK7WZbFmGde45MuoNW99xmyGx4AlkqFuf3k/x5k98g X-Received: by 2002:a9d:228:: with SMTP id 37mr5419394otb.52.1584557466591; Wed, 18 Mar 2020 11:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584557466; cv=none; d=google.com; s=arc-20160816; b=t/GHgaRymM80O4L0nZJApNxLXt7CbX12weL1ZXUYl1SJljSpBU28aLv6zX2wN4kqMZ x6zd8gXfleKmLeHt+TbsD6XbHmP17nyDjYylkKVTgTANDTwOyRPxecYLORZhgvQOQsel xCV7mGx7lXypxCTP6XAUocQlYkNvd5xCqINCgVKdsy01qKwDobmdXramBI5TgGD4qjon MFJJI794tEQ4/HSpHfQ9GNxKxoXLV1p/lRZAm8ur4rnwnRz1LOItIV+wbj4sPSc1cH7M sPqvHOumt8C4pETORDU9wQiP3RGpWZY+kQ7whxPz22sTktyp9JqbD2TYXI//rj60b4hD MItA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/MXzou875wHD31rORzv0wuUdprNHWsIh+gdw1rMggKc=; b=VupEgOcV5HDkZ8EBUvMK/k1J3Ek4YBBGXrZGnzgZ3h6SPh68UOauFLg1fEBR8WS47p zVrkmQ6yai1UqCN/1X5rQTvEp20Bvu318GD4sq6L9+evHVsxglMjU5tUKysLVF5eg92j pE2CpTLVhtubzk3525wrQLyPa7mtvndfK56F/IYzSZdP9yz0FVO2l/SutP3lZqeetGY2 1cp88tleNzorDZy6LzLAXkP8fcpJFJ3Fq/Kynckf1IPqybtsCmwNgOJUB4+zknKvFPqS mFVA6DySqVbTH0fYAvIrArjLoS7qJNOI6VIvu44YeZ+4g1ghBa1I/wBcrqsoX2D0p6Mu aNNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o14si3817298otl.122.2020.03.18.11.50.55; Wed, 18 Mar 2020 11:51:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726836AbgCRStR convert rfc822-to-8bit (ORCPT + 99 others); Wed, 18 Mar 2020 14:49:17 -0400 Received: from gloria.sntech.de ([185.11.138.130]:39054 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbgCRStR (ORCPT ); Wed, 18 Mar 2020 14:49:17 -0400 Received: from ip5f5a5d2f.dynamic.kabel-deutschland.de ([95.90.93.47] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jEdkb-0005cf-6S; Wed, 18 Mar 2020 19:49:09 +0100 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Lukas Wunner Cc: Andy Shevchenko , gregkh@linuxfoundation.org, jslaby@suse.com, matwey.kornilov@gmail.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/7] serial: 8250: Add rs485 emulation to 8250_dw Date: Wed, 18 Mar 2020 19:49:08 +0100 Message-ID: <5640842.EtOnNDtpGh@diego> In-Reply-To: <20200318153754.dctd4q7e2fodeqsw@wunner.de> References: <20200318142640.982763-1-heiko@sntech.de> <20200318144320.GL1922688@smile.fi.intel.com> <20200318153754.dctd4q7e2fodeqsw@wunner.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Am Mittwoch, 18. M?rz 2020, 16:37:54 CET schrieb Lukas Wunner: > On Wed, Mar 18, 2020 at 04:43:20PM +0200, Andy Shevchenko wrote: > > On Wed, Mar 18, 2020 at 03:26:33PM +0100, Heiko Stuebner wrote: > > > This series tries to revive the work of Giulio Benetti from 2018 [0] > > > which seemed to have stalled at that time. > > Oh dear. :-( This needs a rebase on current tty-next. Looking at tty-next I notice that you're right. When I started working on this I only found the stuff from 2018 I linked to but didn't imagine that in that exact moment someone else would also work on that area. So no worries, I'll adapt my code ;-) > Patch [7/7] is already in tty-next as commit fe7f0fa43cef ("serial: > 8250: Support rs485 devicetree properties"). > > Patch [4/7] likewise. Note that it's not safe to call ->rs485_config() > already in serial8250_register_8250_port() if the driver uses UPF_IOREMAP > because ioremapping happens later via serial8250_config_port() -> > serial8250_request_std_resource(), so you'll get an oops for those > drivers when deasserting RTS early on. Been there... :-( > > Patch [6/7]: Ugh, another duplication of the ->rs485_config() callback. > Just use the generic one introduced by commit 283e096ffb70 ("serial: > 8250: Deduplicate ->rs485_config() callback") if possible. > > The other patches appear to handle chip-specific needs. It's now > possible to implement these in ->rs485_start_tx() and ->rs485_stop_tx() > hooks, as introduced by commit 058bc104f7ca ("serial: 8250: Generalize > rs485 software emulation"). Refer to commit f93bf7589114 ("serial: > 8250_bcm2835aux: Support rs485 software emulation") for an example. Thanks for the pointers and also doing all that ground work :-) > The DTR-for-RE thing seems a bit nonstandard, I'm not sure if this is > eligible for mainline or if it's something that should be kept in your > downstream tree. But no harm in submitting it to the list. I'm fine either way - maybe I also get a pointer on what may be a better approach ;-) At least DTR as "Data Terminal Ready" did sound somewhat matching for the "Receive Enable" of RS485 (and it's also the only other output pin in the mctrl gpio list). Heiko