From patchwork Mon Apr 10 03:59:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 97058 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1199498qgd; Sun, 9 Apr 2017 20:59:48 -0700 (PDT) X-Received: by 10.84.229.151 with SMTP id c23mr64608963plk.27.1491796788416; Sun, 09 Apr 2017 20:59:48 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 189si8733017pfg.334.2017.04.09.20.59.48; Sun, 09 Apr 2017 20:59:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752352AbdDJD7o (ORCPT + 7 others); Sun, 9 Apr 2017 23:59:44 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:36012 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752410AbdDJD7n (ORCPT ); Sun, 9 Apr 2017 23:59:43 -0400 Received: by mail-pg0-f66.google.com with SMTP id 81so24094677pgh.3; Sun, 09 Apr 2017 20:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=/6FptG3edBWFcbQmsVmfHMBu0LRcGP6Q5ecvfDKmiEQ=; b=ZK42hV6VZGgVxh+bzdBgvJceJEZSrI9G/M0TAYRkeqKQLdKyVy6wutUW7U3rDPK2xC 0PHDysxCFjMngDzRBB2f+qwaxIFiQBkfo7x4W7E+WLqJwurHArc2jN3bRm42OLV7TeCI exMOLsPtANucH0TGyosHMdzvmHY3t1lIRFFC1lynuQBRq1tt2l1dPECdNZ2t/+v1/m+Y RyvQ5kir/nFVjyDVsqicyQRtIwX+3DZNgIhKYkU4ew+6JmeyHRNX5jTWRjzcJX0j6qt1 64dGBXKxIPveRLr3mFFtmwLOJRqIpMbnGX1uZ/GYIDsrtbpsIxnv9J1IfDqd/d+4MKbT WWJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=/6FptG3edBWFcbQmsVmfHMBu0LRcGP6Q5ecvfDKmiEQ=; b=peEYUSfIxbh6p8jWWkP+PwBMN02GCtP9hzCehg9Fymqxtb9f+IDAek7lbR0YNLZlxd Vfjy7M48yxQTecMbt3+B3Js+tUd5VavRC95txgp4lUV/1ojn7yajJW2MC5p2wul5oVIL GTILUZzjhud8l2/wtFSFNvZ/p/5Xsv2lhnc0Tqe3YKpiBzOup46AJvU8PonzHSdMUNG9 gls0qSy1QNLozFhrZ67c2VsPwRjDlpq3j3OUCyDqDFlDR98KSH22nn90gkLyagTm7jAD Z/8m10NHUOcvcX/9ifNGrJWJr/DfgWoqvfG4YuQeuutWmh4SjLIfsCh42WXWSaHCWM6d 7F6g== X-Gm-Message-State: AFeK/H2BDSSwNxXqh5jtTqZJJP++IJEuNoY30iUr70fY0kO32cvFtXpIGgviMtfDWcotIg== X-Received: by 10.98.97.7 with SMTP id v7mr51294090pfb.161.1491796768910; Sun, 09 Apr 2017 20:59:28 -0700 (PDT) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id s17sm21346688pgo.27.2017.04.09.20.59.23 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 09 Apr 2017 20:59:28 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Mon, 10 Apr 2017 13:29:20 +0930 From: Joel Stanley To: Greg Kroah-Hartman , Jiri Slaby , Mark Rutland , Rob Herring Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Andy Shevchenko , Benjamin Herrenschmidt , Jeremy Kerr , openbmc@lists.ozlabs.org Subject: [PATCH v3 1/2] serial: 8250: Add flag so drivers can avoid THRE probe Date: Mon, 10 Apr 2017 13:29:03 +0930 Message-Id: <20170410035904.29443-2-joel@jms.id.au> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170410035904.29443-1-joel@jms.id.au> References: <20170410035904.29443-1-joel@jms.id.au> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The probing of THRE irq behaviour assumes the other end will be reading bytes out of the buffer in order to probe the port at driver init. In some cases the other end cannot be relied upon to read these bytes, so provide a flag for them to skip this step. Bit 19 was chosen as the flags are a int and the top bits are taken. Acked-by: Benjamin Herrenschmidt Signed-off-by: Joel Stanley --- v3: - Correct the bit number in the changelog v2: - No change drivers/tty/serial/8250/8250_port.c | 2 +- include/linux/serial_core.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 6119516ef5fc..60a6c247340f 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2229,7 +2229,7 @@ int serial8250_do_startup(struct uart_port *port) } } - if (port->irq) { + if (port->irq && !(up->port.flags & UPF_NO_THRE_TEST)) { unsigned char iir1; /* * Test for UARTs that do not reassert THRE when the diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 58484fb35cc8..260245deec94 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -195,6 +195,7 @@ struct uart_port { #define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15)) #define UPF_MAGIC_MULTIPLIER ((__force upf_t) ASYNC_MAGIC_MULTIPLIER /* 16 */ ) +#define UPF_NO_THRE_TEST ((__force upf_t) (1 << 19)) /* Port has hardware-assisted h/w flow control */ #define UPF_AUTO_CTS ((__force upf_t) (1 << 20)) #define UPF_AUTO_RTS ((__force upf_t) (1 << 21))