From patchwork Mon Apr 10 04:03:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 97060 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1200717qgd; Sun, 9 Apr 2017 21:04:30 -0700 (PDT) X-Received: by 10.98.76.140 with SMTP id e12mr5941636pfj.128.1491797070384; Sun, 09 Apr 2017 21:04:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a124si12441523pgc.127.2017.04.09.21.04.30; Sun, 09 Apr 2017 21:04:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-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 linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751527AbdDJEE3 (ORCPT + 3 others); Mon, 10 Apr 2017 00:04:29 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:33759 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750722AbdDJEE1 (ORCPT ); Mon, 10 Apr 2017 00:04:27 -0400 Received: by mail-pg0-f67.google.com with SMTP id 79so24126085pgf.0; Sun, 09 Apr 2017 21:04:27 -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=X8UZurvSmKjvaIqcRUb2a34FGrta61JqKfmqRRYWUTyGIwzirnHjKs3lr59QxW+c0F OFpdxdC2SiHIC2LAz/jbE37DxpQpzSlCnqIohlxxwE61i7EmRnILUw0mB9bpteF2CW4d oDUg8f4DKr4I8lVlasMmpp+UPbKOJKs/MhKL5rFO4E4qkGsNcb08Lu0+pIGnk/9zUcXC vMbvZKVkKtvfQinP+Rz2Kq7jJp5HrYOiP29RSQo1ULPb/Bm4sk991Ri4u/of/EiGdvqY R8+K/PPL3MOUpby/TXBp0H3KLCoLKq96pfFEOouia8s20sgmwQzXVyKcqhZSMHQxVEGu qRXg== 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=jv29E0Py35I80d8VcaGZ1/VymS63rB3jrV/kNLlMLrPlR0FmTNR80tA0oQQBtbyvy8 +xJuGjB3K6Y51UGdaMdWYEKaW5meRtbsSQJtSRO3xEcx51qsGvijYmFXsywqo4NRHCg6 KTglmNS9z21o5K/6mSNwrg7s2MJklDdrXe1pfJxxFpRm3+2mKhJNH30xv416czt0ZyKQ teYyjx3F2Vg/QKwqO6riypkYMP4zIWUXQyfOCb/eU7vt/cXIDeMgADI3L5gDUTwVyrHc +WYB77lPkfDB0g4YKlBWtmXBBmNd48+ekuQwi8mCJUG+xfARRZF6cm3zCbQzXsQSX2gW Cl3A== X-Gm-Message-State: AFeK/H30vsdXUC7ibh7uZZUPPf24JdJ5gFAv7bOXJAye3CJa2WPO/KTlQ1vnREjl+gTNMA== X-Received: by 10.99.44.140 with SMTP id s134mr53217701pgs.178.1491797066846; Sun, 09 Apr 2017 21:04:26 -0700 (PDT) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id q64sm21252572pga.56.2017.04.09.21.04.21 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 09 Apr 2017 21:04:26 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Mon, 10 Apr 2017 13:34:18 +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:33:59 +0930 Message-Id: <20170410040400.5509-2-joel@jms.id.au> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170410040400.5509-1-joel@jms.id.au> References: <20170410040400.5509-1-joel@jms.id.au> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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 linux-serial" 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))