Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp724017imm; Wed, 6 Jun 2018 05:08:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLzFzbXCRyLXywNZKC5U+y2cWQVYOPtHGovalOez2EzYj6hyhNxp4ql0XmMxJRHqC30KnzQ X-Received: by 2002:a17:902:988c:: with SMTP id s12-v6mr2974458plp.304.1528286923066; Wed, 06 Jun 2018 05:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528286923; cv=none; d=google.com; s=arc-20160816; b=THoz43QLuGefr6RZDWrhaavuFrKH9DXyfUzlvkWTTtJqJ1/mm6A00wkBdL2FPVpH3L pGGNyiOJeldv0TVUwhZjqpXF///uuRtrAFkK1heUjEbALJP4Kd857K/QmrlEXe6YLCBH +8wZ5NvwfCAC2huxEs1wl94NQ0nBwcn48FduBCBNMstOeSFkaxhl0k31v67wBeIU1xk1 AkND173x19fGYrfm4k3hgyiS/G+KYc7YQZGhuL4JMhI4dBO5BHCVFcL+2ermflFpUDap g4rbLL/opZuzZlTwZiPytOFLmivmRxKunsrUBHGeuepZkshCHF3X3M5zecqxo6EYNDMM hjfw== 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=vqLl5fSAcde6w+SLYswkAgg86N4zKZ2neMaDwehK/pE=; b=rni878rvh6+H/myYRdIYwXACd54bVbiUzIqKBG1i2zKktDA3GAU+dB22ThnuJ3nWUX rJ4SToBPPinDO2R8M9uaryxP23q6uS/1bbl2uCyQ8BVyOaAxBgNbSaZfYfs0kB6oG7lj LZLirqpa71iUg+F2q1K+5hYgcd5n79Z3FCXZ9wCFtD8jiUmOHVRNq9KmUovs4waOH2NE FIaeo4+Rc3O/Yac2S6Rgfh5JGRvQU4KyRM8G/lfAHU89SRbV7G6xRwajXE9Kc0l0mcjq AZxs28rEmSrBwhzFQ0mx6xrHxo5XIClrHmWXJpEAUGl5pMdKMps6s1WMKNqsYqAYZmYD +KEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=JEkPL87O; 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 z7-v6si39902597pgv.614.2018.06.06.05.08.27; Wed, 06 Jun 2018 05:08:43 -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=JEkPL87O; 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 S1752078AbeFFMHx (ORCPT + 99 others); Wed, 6 Jun 2018 08:07:53 -0400 Received: from mail.micronovasrl.com ([212.103.203.10]:60257 "EHLO mail.micronovasrl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968AbeFFMHt (ORCPT ); Wed, 6 Jun 2018 08:07:49 -0400 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id 68C24B00830 for ; Wed, 6 Jun 2018 14:07:48 +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= 1528286867; x=1529150868; bh=eWdBAottK4MzoScv7rqe9AS64C3ROsrflbo A5vWYV0k=; b=JEkPL87Ol1w8HRllgGEdAf/T/76sSvZop2HWiuN4u4ToRLpmVlw PTH1bCom53mnKPUUKFPPlYzjHW1ShObOAXF76mI1YeGCohBRz1PttK6dZrXk1vbT v1i8j60/GsNHoAOfCF8Z8VUHPnrczPNCz7OEH+MfjdzuAZDYG6YLOYjw= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-10 required=4.5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] 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 A-ru0kSL755Z for ; Wed, 6 Jun 2018 14:07:47 +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 99467B00330; Wed, 6 Jun 2018 14:07:46 +0200 (CEST) Subject: Re: [PATCH 4/4] serial: core: Mask mctrl with TIOCM_RTS too if rs485 on and RTS_AFTER_SEND set. To: Andy Shevchenko Cc: matwey.kornilov@gmail.com, Greg Kroah-Hartman , Jiri Slaby , Matthias Brugger , Kees Cook , Sean Young , "open list:SERIAL DRIVERS" , open list References: <20180606094942.71190-1-giulio.benetti@micronovasrl.com> <20180606094942.71190-3-giulio.benetti@micronovasrl.com> From: Giulio Benetti Message-ID: <5bda9e82-369a-ff5f-fef8-f3933c6f1c64@micronovasrl.com> Date: Wed, 6 Jun 2018 14:07:45 +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: Content-Type: text/plain; charset=utf-8; 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 Il 06/06/2018 14:03, Andy Shevchenko ha scritto: > On Wed, 2018-06-06 at 11:49 +0200, Giulio Benetti wrote: >> If rs485 is enabled and RTS_AFTER_SEND is set on startup need to keep >> TIOCM_RTS asserted to keep rs485 transceiver in RX when idle. >> >> Check if rs485 is on and RTS_AFTER_SEND is set and mask port->mctrl >> with >> TIOCM_RTS too and not only TIOCM_DTR. >> > > This one feels wrong to be in serial_core.c. Perhaps in 8250/8250*.c. I've tried to avoid modifying serial_core.c but if it masks mctrl only with TIOCM_DTR, it forces RTS unasserted. Another way could be: If rs485 ON and RTS_AFTER_SEND set, then ignore RTS driving in 8250_set_mctrl, would it make sense? Thanks -- 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