Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp906916imm; Wed, 6 Jun 2018 07:41:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKMO8WYzY+h3LshVXz64+fdIaPHJ/i4O0g/szDYS51hHpM4eqGwLfRQC52tszeVLc+xtfPK X-Received: by 2002:a62:4353:: with SMTP id q80-v6mr2748675pfa.228.1528296070829; Wed, 06 Jun 2018 07:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528296070; cv=none; d=google.com; s=arc-20160816; b=rSh3YjXFZpvcZtwFtcsGyLSbuPdLiMNI7Lx9FKm+39p9BUcADyU0bgRbNei3BPcCZp Zn4AY/6LRDjsi4sMisOwCbv5jdo67AgVEFUHA3TZxHj7u8+NTy44vCp3fHByOaAkqKyg nUUwRowgX0UE3KlGht83kEVI+j5xGA11rNXXLysAZ0uVudeu38ne1k0O0HU7FvdntkAR vxqSnK7T+HpGCg17i3k0WU1G07Yj7Mj29dP4XjwMPzZX5sBbMTnJeEWg+2hYf/Wgym2G XPPsOnJ+gY18bD0uImlTaaEj1NWrASx/B25Ss1weBpkRT8WSkKAG94A6PgoD8IvZHxCU yeXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:arc-authentication-results; bh=n9fTOEAYJ5TVc66VzqP5wLQRnjjqQYcJRHAOYhGZezA=; b=LZbjf5qDfP/IxDDJlIp80q94XMylZ8N+MRkX0iOmD7UpA5waFHHKyaS+Tslpf/GWdf Qa2cELXoafZPAHsxvtvWZQGcKLDQlAN1II486hkkGtkQM686Iw5wHC5bCGDnUJpRZqF4 fU1hPtAjVp7UJSptco9lAAckQfXqGrxatsN2Tjh9it7pyfrQ0YZL517aKdZ2Zoy759Nj RrczMUcSJKIQfFMrbcsSyWiWlKMR9qs8VvTxZ4epWsCg9Jv7Ld2UDIOGh3XcQcdHEe8F DmKUDp8tAstlWM6xdLGKTbuXjLiCgstAGj+yTtJgCuDFdgGI47UjsKV5Ea3pLX6UDB5Z rRxg== 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 c7-v6si14566455pgt.220.2018.06.06.07.40.56; Wed, 06 Jun 2018 07:41:10 -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 S1752310AbeFFOhx (ORCPT + 99 others); Wed, 6 Jun 2018 10:37:53 -0400 Received: from xes-mad.com ([216.165.139.220]:14028 "EHLO mail.xes-mad.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752240AbeFFOhv (ORCPT ); Wed, 6 Jun 2018 10:37:51 -0400 X-Greylist: delayed 407 seconds by postgrey-1.27 at vger.kernel.org; Wed, 06 Jun 2018 10:37:51 EDT Received: from zimbra.xes-mad.com (zimbra.xes-mad.com [10.52.0.127]) by mail.xes-mad.com (Postfix) with ESMTP id 4932621A3E; Wed, 6 Jun 2018 09:31:02 -0500 (CDT) Date: Wed, 6 Jun 2018 09:31:02 -0500 (CDT) From: Aaron Sierra To: Giulio Benetti Cc: Greg Kroah-Hartman , Jiri Slaby , Andy Shevchenko , Kees Cook , Matthias Brugger , Allen Pais , Sean Young , Ed Blake , Stefan Potyra , Philipp Zabel , Joshua Scott , Vignesh R , Rolf Evers-Fischer , Rafael Gago , Joel Stanley , Sean Wang , linux-serial , linux-kernel Message-ID: <1533624932.66943.1528295462220.JavaMail.zimbra@xes-inc.com> In-Reply-To: <20180601124021.102970-7-giulio.benetti@micronovasrl.com> References: <20180601124021.102970-1-giulio.benetti@micronovasrl.com> <20180601124021.102970-7-giulio.benetti@micronovasrl.com> Subject: Re: [PATCH 6/8] serial: 8250: Copy mctrl when register port. MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.52.0.127] X-Mailer: Zimbra 8.7.5_GA_1764 (ZimbraWebClient - FF60 (Linux)/8.7.5_GA_1764) Thread-Topic: serial: 8250: Copy mctrl when register port. Thread-Index: z3zjfesGJhLZtzTkdnPmsJCHM5caWg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- Original Message ----- > From: "Giulio Benetti" > Sent: Friday, June 1, 2018 7:40:19 AM > RS485 can modify mctrl on startup, especially when RTS_AFTER_SEND is on > TIOCM_RTS is set, then need to keep it set when registering port. > > Copy mctrl to new port too. > > Signed-off-by: Giulio Benetti > --- > drivers/tty/serial/8250/8250_core.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/tty/serial/8250/8250_core.c > b/drivers/tty/serial/8250/8250_core.c > index c8c2b260c681..c8e62fbd6570 100644 > --- a/drivers/tty/serial/8250/8250_core.c > +++ b/drivers/tty/serial/8250/8250_core.c > @@ -993,6 +993,7 @@ int serial8250_register_8250_port(struct uart_8250_port *up) > uart->port.unthrottle = up->port.unthrottle; > uart->port.rs485_config = up->port.rs485_config; > uart->port.rs485 = up->port.rs485; > + uart->port.mctrl = up->port.mctrl; Hi Guilio, I ran into this same thing about six months ago, but I was able to accomplish what I needed by assigning a set_mctrl() function in my port definition. Perhaps that would be enough for your case, too? You should see a little lower in this file that set_mctrl is copied to the new port. -Aaron > uart->dma = up->dma; > uart->em485 = up->em485; > > -- > 2.17.0