From patchwork Wed Mar 21 02:52:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 888524 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 405ZHj2wgKz9ryG for ; Wed, 21 Mar 2018 13:58:25 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="BzwFBisi"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 405ZHj1FVWzF1ZS for ; Wed, 21 Mar 2018 13:58:25 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="BzwFBisi"; dkim-atps=neutral X-Original-To: linux-aspeed@lists.ozlabs.org Delivered-To: linux-aspeed@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 405ZDg1y23zF1Zk; Wed, 21 Mar 2018 13:55:47 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="BzwFBisi"; dkim-atps=neutral Received: by ozlabs.org (Postfix, from userid 1023) id 405ZDg0Ll9z9s16; Wed, 21 Mar 2018 13:55:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1521600947; bh=t/Xx6xq47cCweFWjVlDpDlMcGm8cYsBP3OHU0r8Sbwg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BzwFBisimno/juqfABiZyfvoN3lLYqc/RVKsJchyizroB0F10QNMHwtfjSBX41Gi/ +93bLCQeFdwml79ZuZEd0g/q7Q6hxo/VG5Bi9uAmkU28sCMfTJYh4bvS5ulfJIoUx+ I0G6w9UWtm0IC5keGBqLAPReM1jVTa6bgRJQfxb9lrv621SAkRaT+TOrDvmaCqz4y3 5LlLM9tjY57AFVcCEBf9bmS/+SyvDhTK1Y8E2XlGIO3rziDvC6F8iL8mdhsod0RpKm FY+1hyT+OtN5bsNTpO3QcjLrTU8qBHW8FEuOHonimDzGCah/FvQHrYNHLeQ7YF0QsX g6JgH0Pkb3UGQ== From: Jeremy Kerr To: linux-serial@vger.kernel.org Subject: [PATCH 1/5] serial: Introduce UPSTAT_SYNC_FIFO for synchronised FIFOs Date: Wed, 21 Mar 2018 10:52:37 +0800 Message-Id: <20180321025241.19785-2-jk@ozlabs.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180321025241.19785-1-jk@ozlabs.org> References: <20180321025241.19785-1-jk@ozlabs.org> X-BeenThere: linux-aspeed@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux ASPEED SoC development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-aspeed@lists.ozlabs.org, Greg Kroah-Hartman , openbmc@lists.ozlabs.org, Jiri Slaby , Jeremy Kerr Errors-To: linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linux-aspeed" This change adds a flag to indicate that a UART is has an external means of synchronising its FIFO, without needing CTSRTS or XON/XOFF. This allows us to use the throttle/unthrottle callbacks, without having to claim other methods of flow control. Signed-off-by: Jeremy Kerr Tested-by: Eddie James --- drivers/tty/serial/serial_core.c | 4 ++-- include/linux/serial_core.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index f534a40aebde..8f3dfc8b5307 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -678,7 +678,7 @@ static void uart_throttle(struct tty_struct *tty) if (C_CRTSCTS(tty)) mask |= UPSTAT_AUTORTS; - if (port->status & mask) { + if (port->status & (mask | UPSTAT_SYNC_FIFO)) { port->ops->throttle(port); mask &= ~port->status; } @@ -707,7 +707,7 @@ static void uart_unthrottle(struct tty_struct *tty) if (C_CRTSCTS(tty)) mask |= UPSTAT_AUTORTS; - if (port->status & mask) { + if (port->status & (mask | UPSTAT_SYNC_FIFO)) { port->ops->unthrottle(port); mask &= ~port->status; } diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 1775500294bb..bf600ae0290d 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -232,6 +232,7 @@ struct uart_port { #define UPSTAT_AUTORTS ((__force upstat_t) (1 << 2)) #define UPSTAT_AUTOCTS ((__force upstat_t) (1 << 3)) #define UPSTAT_AUTOXOFF ((__force upstat_t) (1 << 4)) +#define UPSTAT_SYNC_FIFO ((__force upstat_t) (1 << 5)) int hw_stopped; /* sw-assisted CTS flow state */ unsigned int mctrl; /* current modem ctrl settings */