Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp521106pxb; Thu, 9 Sep 2021 06:21:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2eWqESCfquB0EfvlCDqdk2UIaC4MVEHo77+qZBbBDYEeRRwtY64N0Sulmug/mUCBMe/5g X-Received: by 2002:a6b:f007:: with SMTP id w7mr2663676ioc.112.1631193666535; Thu, 09 Sep 2021 06:21:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631193666; cv=none; d=google.com; s=arc-20160816; b=JroYbmS42AobYFc21XE3yvZWHoCgspm2nTqQoiZlfOkBitUvrjlkNXU7hKdC83RnOL 7vhMBYBmvnoOXKCl4Spp6nb0qy8zUJUCz27CBzLAXa9hqk6S3RS8knEjFzMe3MoHM0K9 G7L3tZlCNJbfdATakcqkG9LQKfnYM96DULleBIY+eF2FO0GVhDerhnAouNJN7M1k8c44 h1Br/LJL7YwcaTXsmww3ELAakoRzZivNbCngESQfznY6ty34nSfTuNCsrPzQFeezdfci e4ckU4OOEN3Lo5B+4Sjk5SbWt3W+mQKcM2dg/cWqHXMll4QhILHYU5IROrgbF4Hf8RDJ lXHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OyUl8Zm0UVS2lbP83m1NL9ejDyEUwG//rwnveydl5ag=; b=ADZVkdjCs5rpPcp+cR7Bygxy3RrcrtbBjz5juJfpCvyHRuHCtO8+ajlOjiTTS+sA7+ MtOv8UgaQd495tT07rCSLXGddMK7BYmkfAg+/lgpoeYDBIm7yEQudBHdefGy74sqXHkQ Ws5sPgXWDQMCgSJtl11gkzt40NaTJQJjs6W6PGenbdsJSJYrLDNnlNhy1sMI/yMT8U/+ 9OZt7DWf+yL9Vl0q0XV+KxEZ4GOf/hihHVbW3VtyHTnBwT3AMlLKteTZEd9ZZ4sgVn67 ZQf8Ud+6FP6YDCgUboo4rICokeLBWu/BahyhGnKO4Lt6wGb88oneuu8/eR7aMx/co4Qv zaiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ewrK79SD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g13si1955790jao.114.2021.09.09.06.20.54; Thu, 09 Sep 2021 06:21:06 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ewrK79SD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346632AbhIINUn (ORCPT + 99 others); Thu, 9 Sep 2021 09:20:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:43558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357523AbhIINBk (ORCPT ); Thu, 9 Sep 2021 09:01:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F49063285; Thu, 9 Sep 2021 11:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631188770; bh=Sen3VESj6Px/2robRFgre7iwCu/+5nbXyuniCVSJ6GY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ewrK79SDSEBIAg2/tb/3pOo8h2yV64EXADaKiMm5L4l4NUhIj1zvcAC/PmUZNNsWx jsoKYBB9UGexhvcfMYR6EJnTJiYNM0hEmZziSFMyIycdwfQ/50Mg5bC8Ucku1n2D+m PzOY4CeMOJ1did6NAEIpxX0rWednWf9PB0tNNVRH9dE923w2KaT8RkLh/mvyu0K2J3 Q/Aq9svsfyJHOLFb5yu2nxTgYb0nrmEolL8RDb8OoAv9H9AbcVOxMmFLhOSzHQAtaM METNvfcdCrh7kgNOUg1nYIIj8WGE2broFucftK0/2ySwDdDmCWoNsEYa9F5MulXgbf SDBDQ61fYmVag== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Maciej W. Rozycki" , Greg Kroah-Hartman , Sasha Levin , linux-serial@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 23/59] serial: 8250: Define RX trigger levels for OxSemi 950 devices Date: Thu, 9 Sep 2021 07:58:24 -0400 Message-Id: <20210909115900.149795-23-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909115900.149795-1-sashal@kernel.org> References: <20210909115900.149795-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Maciej W. Rozycki" [ Upstream commit d7aff291d069c4418285f3c8ee27b0ff67ce5998 ] 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 Link: https://lore.kernel.org/r/alpine.DEB.2.21.2106260608480.37803@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/8250/8250_port.c | 3 ++- include/uapi/linux/serial_reg.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 20f58e9da2fb..7ac6bb38948f 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -136,7 +136,8 @@ static const struct serial8250_config uart_config[] = { .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, }, diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h index 619fe6111dc9..a31ae32161f3 100644 --- a/include/uapi/linux/serial_reg.h +++ b/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 -- 2.30.2