Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1702787pxv; Fri, 25 Jun 2021 21:13:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwENMVzr7HTlYzfW/zs1ExdBKNMTipKHvU6FrhpuFbI1RkZaHeajUxyPWxVFJuvvKDhDiut X-Received: by 2002:aa7:dc0d:: with SMTP id b13mr18941188edu.288.1624680836338; Fri, 25 Jun 2021 21:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624680836; cv=none; d=google.com; s=arc-20160816; b=Z1z9BoDL5earuyLhtAI70CMJeBF6on6QN06Sj2RnMfXiBoJXanOwshDn4eWnYU8+AR so3Zgip6If3mEg+FMOEmNGSy/YaVVIihIeJaXCAxKXWuNdrEfbVkLm8A3sfsFYfEO5xx cZyBtc1ElLpVWiMT+icHcvKZzYTksaAiuLJbNrgphadElwok+Z6eUgOTYQi125DmPATj XFZvWnUpBHv3yYN9CSmB+fCeJPgrJIuu8LjnCUhAdxUJldqKDCSLKkYEfZPx4Yig2sVB yeK5CDf9USWN/c0sffZQA00MCjIUsDDiMqL7D7e7vTb9jL0/w4wrXw9uoVerE26HD84X wc1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=yoS36fQrmxsE3m/1eHFptNPGCIKpMY8+ZCFuTtWdS48=; b=Aic6yBfZwC4vpeIgrrSWZPBMuv/gjUM+fzDRIgVo48OmXbGLr7TnJfB4ObPgDVcOAW mTQKSLAYV9jdlxLkNssS+HMlhXA1P2xbC+PYFefqM+7OvK2qeZ9APzrxeyH+9b2r0Rgb RksI5ssm3TgzYYTSqId91y2UMr4nvAbHhxF/92oDBD4HkhcjjkM9BvAWjU2wD28CMtck Ghx48LVCkH/PG5PTiESBCV+C7ZQ2ha13raprT9N0fXbEzU4s/f7K1qAW+VZWDvlIL4gq fS2kq4rovx3N/BHmm2nHFuHA9iD5bzD9Vx169T0nOBz7zAdwhjUSTL/HHn3FJt/xLKb2 T70Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si7679245edt.22.2021.06.25.21.13.33; Fri, 25 Jun 2021 21:13:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230093AbhFZEOO (ORCPT + 99 others); Sat, 26 Jun 2021 00:14:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbhFZEOO (ORCPT ); Sat, 26 Jun 2021 00:14:14 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 60B9BC061574 for ; Fri, 25 Jun 2021 21:11:52 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 952CB92009C; Sat, 26 Jun 2021 06:11:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 905DB92009B; Sat, 26 Jun 2021 06:11:51 +0200 (CEST) Date: Sat, 26 Jun 2021 06:11:51 +0200 (CEST) From: "Maciej W. Rozycki" To: Greg Kroah-Hartman , Jiri Slaby cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] serial: 8250: Define RX trigger levels for OxSemi 950 devices In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oxford Semiconductor 950 serial port devices have a 128-byte FIFO and in the enhanced (650) mode, which we select in `autoconfig_has_efr' with the ECB bit set in the EFR register, they support the receive interrupt trigger level selectable with FCR bits 7:6 from the set of 16, 32, 112, 120. This applies to the original OX16C950 discrete UART[1] as well as 950 cores embedded into more complex devices. For these devices we set the default to 112, which sets an excessively high level of 112 or 7/8 of the FIFO capacity, unlike with other port types where we choose at most 1/2 of their respective FIFO capacities. Additionally we don't make the trigger level configurable. Consequently frequent input overruns happen with high bit rates where hardware flow control cannot be used (e.g. terminal applications) even with otherwise highly-performant systems. Lower the default receive interrupt trigger level to 32 then, and make it configurable. Document the trigger levels along with other port types, including the set of 16, 32, 64, 112 for the transmit interrupt as well[2]. References: [1] "OX16C950 rev B High Performance UART with 128 byte FIFOs", Oxford Semiconductor, Inc., DS-0031, Sep 05, Table 10: "Receiver Trigger Levels", p. 22 [2] same, Table 9: "Transmit Interrupt Trigger Levels", p. 22 Signed-off-by: Maciej W. Rozycki --- No change from v1. --- drivers/tty/serial/8250/8250_port.c | 3 ++- include/uapi/linux/serial_reg.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) linux-serial-8250-oxsemi-fifo.diff Index: linux-malta-cbus-uart/drivers/tty/serial/8250/8250_port.c =================================================================== --- linux-malta-cbus-uart.orig/drivers/tty/serial/8250/8250_port.c +++ linux-malta-cbus-uart/drivers/tty/serial/8250/8250_port.c @@ -122,7 +122,8 @@ static const struct serial8250_config ua .name = "16C950/954", .fifo_size = 128, .tx_loadsz = 128, - .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_01, + .rxtrig_bytes = {16, 32, 112, 120}, /* UART_CAP_EFR breaks billionon CF bluetooth card. */ .flags = UART_CAP_FIFO | UART_CAP_SLEEP, }, Index: linux-malta-cbus-uart/include/uapi/linux/serial_reg.h =================================================================== --- linux-malta-cbus-uart.orig/include/uapi/linux/serial_reg.h +++ linux-malta-cbus-uart/include/uapi/linux/serial_reg.h @@ -62,6 +62,7 @@ * ST16C654: 8 16 56 60 8 16 32 56 PORT_16654 * TI16C750: 1 16 32 56 xx xx xx xx PORT_16750 * TI16C752: 8 16 56 60 8 16 32 56 + * OX16C950: 16 32 112 120 16 32 64 112 PORT_16C950 * Tegra: 1 4 8 14 16 8 4 1 PORT_TEGRA */ #define UART_FCR_R_TRIG_00 0x00