From patchwork Tue Mar 28 05:44:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 96100 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1552671qgd; Mon, 27 Mar 2017 22:46:35 -0700 (PDT) X-Received: by 10.98.72.199 with SMTP id q68mr28748540pfi.152.1490679995202; Mon, 27 Mar 2017 22:46:35 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 198si3041004pgd.114.2017.03.27.22.46.35; Mon, 27 Mar 2017 22:46:35 -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 S1753844AbdC1Fqe (ORCPT + 2 others); Tue, 28 Mar 2017 01:46:34 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34779 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753072AbdC1Fqd (ORCPT ); Tue, 28 Mar 2017 01:46:33 -0400 Received: by mail-pg0-f67.google.com with SMTP id o123so15836803pga.1; Mon, 27 Mar 2017 22:45:39 -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=C9cqKzd+Ohp19RHS1BUoz9kZlP7kAAeoadi1/sXbF+M=; b=MUPLB3vX9JftsKg4KN/6CCuAGspoMpGmKPG9vHDfQLHWhUmVj066axMoGDnFZjCut8 Fi0lgK/fx1xZnnpxpDkF9A19BWvg/PqjKVtGKvcZW7mSeQn8GOFGRupCnKfkbUZmd9vl Q833cU3Mrm9/LktBMtRe7Pa2o5Biz5XjHLLzSm/NEujXpJhWlZ9LAGNus7W/wCxI7n4K +ZMfDV2RQDfmt137Vz/DRH0pp/tFa380d4lClB590RG7nT2g++rQqQ0JqeSF1Fmn8rhm dfpxeTmMFQ+/4+xDvXr1IHTpbNtvHOnvisdszDUoNUeXfC83oX0cSzXmVPvcSec9lsJW przQ== 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=C9cqKzd+Ohp19RHS1BUoz9kZlP7kAAeoadi1/sXbF+M=; b=A/H5a/T0TC5HIYUjo7Hdj2j2xhrkZrMwC11+XtMHxZQ1Uk1cQ800epKbS5YsmXNe0M 5/5oceuucrt/9Xt8hjal0LznyFyC6EyYR4FKVIT2P1QlA0d1IlbTrzS3kg+S1Y8HYVVC qwltjFrPPYGALJaZlHY/7AlXLAzyt/xPLbeZUXC1wx7QK/ViXpNgh2LTPzVYO8M5QhtG 9f6s3zVFviQbuvz4W8diV3m9bgn7nVgn6xajIv7FMcRcdqLCpIXBLRVJ7a5XDqPp1uKk 7JL8bADC8IzuSZLPODGp5UzNIQDWMhZTe/hBSqbdQDua/hyMRMlVUjtikCMrhOB0ZMuj NNRg== X-Gm-Message-State: AFeK/H1Vn450pdjsTQjR8mxU1xuamp81+c9wXo6guM1/qQ4u9L9ZMjwWjIFNfN5FyCAYpQ== X-Received: by 10.84.254.4 with SMTP id b4mr19200297plm.179.1490679938505; Mon, 27 Mar 2017 22:45:38 -0700 (PDT) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id g5sm4526488pfe.12.2017.03.27.22.45.28 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 27 Mar 2017 22:45:37 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Tue, 28 Mar 2017 16:15:22 +1030 From: Joel Stanley To: Greg Kroah-Hartman , Jiri Slaby , Mark Rutland , Rob Herring Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, devicetree@vger.kernel.org, Benjamin Herrenschmidt , Jeremy Kerr Subject: [PATCH 1/2] serial: 8250: Add flag so drivers can avoid THRE probe Date: Tue, 28 Mar 2017 16:14:57 +1030 Message-Id: <20170328054458.29341-2-joel@jms.id.au> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170328054458.29341-1-joel@jms.id.au> References: <20170328054458.29341-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 16 was chosen as the flags are a int and the top bits are taken. Acked-by: Benjamin Herrenschmidt Signed-off-by: Joel Stanley --- 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 fe4399b41df6..f4c6da107dec 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2205,7 +2205,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 5def8e830fb0..f9e1fa39f553 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))