Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp912352imm; Wed, 6 Jun 2018 07:46:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLG5//CCP4JDRKqVL6oVSKML7iX4v47EDs+lDJ2fwVcTtqmGCfTyWvkVI/RVRb/g4qx2YRF X-Received: by 2002:a63:778b:: with SMTP id s133-v6mr2727461pgc.400.1528296369327; Wed, 06 Jun 2018 07:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528296369; cv=none; d=google.com; s=arc-20160816; b=i/y4LqvlA475VCG9Yq01i60V8/Fnpjoa3MzePmw8Q1MlWLrhbLU/sHNGlCXrmop3rA Qwxnh84gkfucZyc96pD1qpqfLJnwc81lm1WtC/8TJN6Q2FugQX/7du8XGU17eR6oAibf n0KswtIxz1iyJIf53pO2fQGyDSvPeO7rz2tUCdrYj+UZOzfHFHreX7o4cRNwPkkGAYwl Ctx6Iq3Nfqj5h/kzJ08ET+sxchwJMvsqnY2alRwtlZ6JiN30Bc2EYtcsvDlVkgsUuwKw sKZjjFSHI88e65DDRBdIl25HEonlHtG+x9lvXX/yUgcsaMxSjoCxte2a8Oo5T3QUbtUN jq2A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=pplJ6+g4YjYfUk6LIadRfstpT+XSm3TNQNXmh2BboDI=; b=RQdw0d7xnqvxtSr6mYDP1kbuD2xCGm0dc2ZpmKD0YEAC512ljs24xbzc14UVz2r1mJ QEyjSxUzSOsawN5pxtKTiWd4jBVs60w1j4naj8ttoKwhxJ+v+5WYkeDgZ50MhnliOXDw LRlo4llIfPwyiPFAw8ZiRUhBk2UbFWjCXR831zcgpy2nN5RD5dUo/rp1PwjeFmUnXcuP R5ufvbQ4qMYSZwZVDke/VZ79MCRaEjtQ4X2PUjxgWpn7STpimkQ2x5aFZX25bTtmYPWz aCjnCvUu1G95/tZKzAdoBzWdcEUZ1dOf2lUbcfxkhF44rcJ7fB2ZhUkkaEao5VS/AyHw hA3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=eDdsBhqn; 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 d203-v6si23912987pfd.182.2018.06.06.07.45.54; Wed, 06 Jun 2018 07:46:09 -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; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=eDdsBhqn; 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 S1752174AbeFFOoV (ORCPT + 99 others); Wed, 6 Jun 2018 10:44:21 -0400 Received: from mail.micronovasrl.com ([212.103.203.10]:39002 "EHLO mail.micronovasrl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752005AbeFFOoT (ORCPT ); Wed, 6 Jun 2018 10:44:19 -0400 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id 24D91B00816 for ; Wed, 6 Jun 2018 16:44:18 +0200 (CEST) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:to:subject:subject; s=dkim; t= 1528296257; x=1529160258; bh=0nGC6A3RS0HnPIL+NfNWqBpOL+GdjcD2fyM fq8In6Tk=; b=eDdsBhqnt7PwMC3NYF0PXAkvdBZMfOVQNju7z5W2xtFShQSoizO pP4oppXLHstaOzvP8wXQslPg8P5lSxW2ysv2cOyoXc744Fm/JkLGofM/1Bf1e6Gr WJ4dU3rSQtxHK1TybKAZpKai077NLlyo/3DzAX7vxX71WUMtphL+dipU= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com X-Spam-Flag: NO X-Spam-Score: -2.898 X-Spam-Level: X-Spam-Status: No, score=-2.898 tagged_above=-10 required=4.5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, LOTS_OF_MONEY=0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id F6jCejezxf62 for ; Wed, 6 Jun 2018 16:44:17 +0200 (CEST) Received: from [192.168.2.109] (62-11-51-166.dialup.tiscali.it [62.11.51.166]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 66B8CB005D1; Wed, 6 Jun 2018 16:44:14 +0200 (CEST) Subject: Re: [PATCH 6/8] serial: 8250: Copy mctrl when register port. To: Aaron Sierra 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 References: <20180601124021.102970-1-giulio.benetti@micronovasrl.com> <20180601124021.102970-7-giulio.benetti@micronovasrl.com> <1533624932.66943.1528295462220.JavaMail.zimbra@xes-inc.com> From: Giulio Benetti Message-ID: Date: Wed, 6 Jun 2018 16:44:13 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1533624932.66943.1528295462220.JavaMail.zimbra@xes-inc.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Language: it Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Aaron, Il 06/06/2018 16:31, Aaron Sierra ha scritto: > ----- 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? Thanks for pointing me. But wouldn't it be better copying mctrl? In any case, serial8250_register_8250_port() will call: - uart_add_one_port() - uart_configure_port() - port->ops->set_mctrl(port, mctrl); So it would be a double call IMHO. Are there any drawbacks on doing what I'm saying? Maybe I'm missing something. > 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 -- Giulio Benetti CTO MICRONOVA SRL Sede: Via A. Niedda 3 - 35010 Vigonza (PD) Tel. 049/8931563 - Fax 049/8931346 Cod.Fiscale - P.IVA 02663420285 Capitale Sociale ? 26.000 i.v. Iscritta al Reg. Imprese di Padova N. 02663420285 Numero R.E.A. 258642