From patchwork Tue Mar 22 13:12:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yegor Yefremov X-Patchwork-Id: 8642191 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D92C29F3D1 for ; Tue, 22 Mar 2016 13:14:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0CF3B20396 for ; Tue, 22 Mar 2016 13:14:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 318AA202A1 for ; Tue, 22 Mar 2016 13:14:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759000AbcCVNNv (ORCPT ); Tue, 22 Mar 2016 09:13:51 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36849 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758917AbcCVNNj (ORCPT ); Tue, 22 Mar 2016 09:13:39 -0400 Received: by mail-wm0-f66.google.com with SMTP id l68so29591385wml.3; Tue, 22 Mar 2016 06:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=X3uy7BvoQyjSICw7Z8qExHxnOUHXZlR6Q7GzGth8W7c=; b=Vb4nqqFU/ze+oynQ6lgtxjA5hsCjl8itUx6tjNJA1A4rKcEW/WC1tjnyp+cewhaXX8 4tvJDz4CfASBN77jw63lyG+1Uh3ZkGOm468mXGS9fflYfc4KtUnkRw/kdGMZTFANjPHn qxMvP2qbs9Lkoh63j4FmMJ64cc7OR9K2Ht5ooAVt7ibBAlu/sA8hnkntcwq2lPLxr+6i sb42kzPyms/sKtvQP5841Sh73j9WXvkNaVJsEyWs6ZVcZZEycJHiOr5cheuYKLN6MBe5 ZTojVRhKia5/QyvyMAGTS+N3od5Wez7fJM2P6zW3KCNYnwo2nejm6bt5do8g9Y02cvC5 5PIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=X3uy7BvoQyjSICw7Z8qExHxnOUHXZlR6Q7GzGth8W7c=; b=dnxzZntoBjUNuvdV0WE0Bo9szFvz8Rank5oRae+kr4hIDRjJJWZeqqbtJ4R2Hv/d8u soF0HG4WzmhhE1K8UnIwMXXV2LbZhBGqee8ELnV3HC/IW296wMj3vexRvvQZWljKLuvo qcd9zw5LrSby3xFBUFD3hLsCfII6RWm3eAnFEJ/9Sk8N6Ue88BIjhxnAOvc+nHOeQyyx d0JN8fMzIUl5UXqb/hw5TQzDhIqDH1m+Wod5qlK1Qw9+1+XrQ0/cr9D//PLFrvOyi1F4 Z5L/tS2D8nqhnV6oxwP7TIjfeMD7ttU/PN1Mbw08cjVh6mauiV1SustyceadZLX7qHmM Ixzw== X-Gm-Message-State: AD7BkJIXb7QCTGKeZro5bu4NqqQub+c608HuOtvkPBfmikF8ND9E/Lh9aEmu0QIRxmIPZQ== X-Received: by 10.194.201.166 with SMTP id kb6mr36821359wjc.125.1458652416917; Tue, 22 Mar 2016 06:13:36 -0700 (PDT) Received: from development1.visionsystems.de (mail.visionsystems.de. [213.209.99.202]) by smtp.gmail.com with ESMTPSA id y72sm17384561wmh.21.2016.03.22.06.13.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Mar 2016 06:13:35 -0700 (PDT) From: yegorslists@googlemail.com To: linux-serial@vger.kernel.org Cc: linux-omap@vger.kernel.org, gregkh@linuxfoundation.org, nm@ti.com, bigeasy@linutronix.de, tony@atomide.com, nsekhar@ti.com, Yegor Yefremov , "Matwey V. Kornilov" Subject: [PATCH v2 1/5] tty/serial/8250: fix RS485 half-duplex RX Date: Tue, 22 Mar 2016 14:12:05 +0100 Message-Id: <1458652329-10138-2-git-send-email-yegorslists@googlemail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458652329-10138-1-git-send-email-yegorslists@googlemail.com> References: <1458652329-10138-1-git-send-email-yegorslists@googlemail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yegor Yefremov When in half-duplex mode RX will be disabled before TX, but not enabled after deactivating transmitter. This patch enables UART_IER_RLSI and UART_IER_RDI interrupts after TX is over. Cc: Matwey V. Kornilov Signed-off-by: Yegor Yefremov Acked-by: Matwey V. Kornilov --- drivers/tty/serial/8250/8250_port.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index e213da0..00ad263 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1403,9 +1403,18 @@ static void __do_stop_tx_rs485(struct uart_8250_port *p) /* * Empty the RX FIFO, we are not interested in anything * received during the half-duplex transmission. + * Enable previously disabled RX interrupts. */ - if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) + if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) { serial8250_clear_fifos(p); + + serial8250_rpm_get(p); + + p->ier |= UART_IER_RLSI | UART_IER_RDI; + serial_port_out(&p->port, UART_IER, p->ier); + + serial8250_rpm_put(p); + } } static void serial8250_em485_handle_stop_tx(unsigned long arg)