From patchwork Tue Nov 10 03:12:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3997 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 52DF61C41A4 for ; Tue, 10 Nov 2026 04:13:26 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-27444-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-27444-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 9B96160B369 for ; Tue, 10 Nov 2026 03:13:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794280394; b=dGXkhAl4zBj1JvRo2U763zrIRiHuAZpPRHe9Myy/eeJ2IsO640Ek4uz+MQiDvZA+kdOW ZijmJyqYM0muYrYM4MH/F4HZIxTTVN5qKfmbPK7wkWizVPIkvuFaV2F24Sbrdsr19zWk3 RbD8H0itqMrRi877y8meAs+AIE+AtqhRpZpSErU7nwUbhd8ICp5wy3BjtCZbWmDGaFxA4 HrMUZzf680zWpiu42FY7+65/OE70ho6AHI4fQohWJ5OgqRgTuXyYassWhNxaj7g68CE6W 0qmw3vEc36TQ0zWZrd1e+ZNq/2VsB2MQNvCJ8TXzQiYDquyEKSRM80kSpnNIE19Eecg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280394; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=KsGmsSOFoUFqhki7bSOzws9koK/vjaFo7VoIU6A5xpA=; b=nHTlYMXJ57vZVtYChE1cCgfIjhzeD6dgybNawjTcEjXjdh7xx1zKzv7aKEHA/o333M2K LEkdRMK435R715ARAgIK0MOa+VAKTU8hbTNAAqZ6PAOJLdzH19Xl01PhaYULitUStVwY1 Ao21S6p2WogKeYQvL8jHWwy36MofYScBmUen2fEl9kaVo1IUteLcSuInKvehVZ6euGn5Z EOL0wdpBhNrfSoewRVv9QQIGL4JHs578SvWKF0Nq7MDdGLwhgMT1TQ/y0YZzYPr9t95YA 4zz9XCMEHcMwtCUQL9b8fNlycbvtpWx7Qor7PzXGdmQ8b2L8bQ8Vh9d98C5ksysH+uA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=GPDDV8WB; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD8F4606A33F; Tue, 10 Nov 2026 03:13:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=GPDDV8WB X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794280394; b=fD1aIM/uS9AtaUlRBK5ENsMNbBWHAOG5f2Xt7/diUt6abIBI70LD+7aij0tIW7qzURjg bMU56HuKykZj9ero3EV75WIo+86VtHHpfCCOdHD5mHg4diww3ILZReF4KfB+Pzaw755gI yt8UcqialmV9dT6SpJYBhNWdxm65qU52XCM791qQ+sspTsjfOBomXNAzwKOwjdo0M3f4E maEcIvwr+PKN7RZQMCPlabimv0xFrEVd2r+deRwFCN/qUvF+TnT9AnPCvjqaavoP6/y/5 paWSs46jBblXSC3B8fRFm/PQr/1zh13oRDt3ufDI7kDctq1wQeT5EY6a5EIv2wDcFKA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280394; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=KsGmsSOFoUFqhki7bSOzws9koK/vjaFo7VoIU6A5xpA=; b=Kc3zgb9nfjMYvkIGDR6LW1KqxKr4Ru6oImLXnSUwUbFbvHbspne5mKChPOjcN9ZIjdPu LO2OEIB2ONdRFi3ooCkJAWP1u+a9H8ygO/B5WHu6L10S4+Ze61E/Y93Z3g43IIVuXa2eu ovOt2RpIjMCDfXuOzdQrhtGRZrBMv/TnkQJ/K1iZ9xI7Ny2hctV5mWOq/Xq9DQH4hjGdy WjEweYJ38XG29qY9XhQRvDN74kYi8lquIcfIi4ErH/8chsQsA4KtR5jMSDVQFkCldDIJj bl8USk2qy87IgESYzT+P46qTU16EiRqWzVdMXybvoQyD4hOc3zxGZvkHOqvJrxyRTbw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=GPDDV8WB; arc=none smtp.remote-ip=209.85.167.182 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB2FF60A2601 for ; Tue, 10 Nov 2026 03:13:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EB2FF60A2601 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-51f2e9e6987so941786b6e.1 for ; Mon, 09 Nov 2026 19:13:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794280393; x=1794885193; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=KsGmsSOFoUFqhki7bSOzws9koK/vjaFo7VoIU6A5xpA=; b=GPDDV8WBw2XZ2eu+0eixWURbxwqWxGUoNSCfolzQa+qV8Rtbv2+GcZgUTAVhwVS76K gh8XWe7uXgjEX4zaj5SS5OXnt7EaSNEhmrTKYQSjBPnuGT79PfHTSFgHphlmMSIEJpNL 1mr7X7hMbd/TIfMPutMwVMQX1Hokqypt6GsHo/oaF2xRZEQSk32oN9Sh+w/DKYEak4x3 cd9P6vCCrBMc5Q3Xbda4+CUbKFfcWkHG7eF5mGHbh/AFwwONpHtZl2Rbt0aC1z4CUWK0 yb3t5Uv53svYDM2xuRRwUR+iU9KYitfc8v7kEkItGBAwhgWV0PY7OhijvBKLB9+0v8Zg HNag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794280393; x=1794885193; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=KsGmsSOFoUFqhki7bSOzws9koK/vjaFo7VoIU6A5xpA=; b=N5MjSeRrOHJe++UkSJdfBPk6J3OPNBQyQWF3jSL2Wa5FxAgnlfWXBcNwdLiTkH81U6 LicoP5ytUMM4iOt64dANKKwBMhm7Sd7TG2qsgSPiei+Pa7wDK/7nOQgpnnwX34sx6KwL eUodXy3G/Q+c17FrlVcGuTTRg0qminTOSs4e6ChdH93tHLRReZdzB0kE0VbaxbJQmkBn XSSqIad0K4qtUak32kXdqDQP9CjPW4K5RQrFUnAzxHfOjldVz7B20IN1x2NNanyFvKyr FBQR2ZflMJCpdkeUZkLOb74aKuqJI5km9tUiv2DeQda3CQB4Wzf70jA9f2J2W5jZNwdm u6wA== X-Forwarded-Encrypted: i=1; AL+hErEyQKx/Q5OgUR+8fU4SiS8YzueO23tLEkwz422GNmDfN/4fnWMw/fSbZxcaSs+5X0tN0Zh1ptDCpx/RgA==@lists.linux.dev X-Gm-Message-State: APuU4Z8AF9UqUvg5cekI1wzGRNVFEQvAchllt6H6eUim2aqobOCopVKw XgEoAf5DY+EIIbRljkM2qkFMXu46pDV8GjdvhcQtf3gGN4srmmIqAmie X-Gm-Gg: AYBFou24u+GKBh5zSUcvJxEUXvGGllTL8FO32yI919tk5GTzDArO/aO7akcSd5JyDmN DObSTOuH3FevOuGP3dj1tlo8cEpZzTdvFCSlAnY4FbfkuuBNVqhVYF+hq3U9i1gfZD4Qqxq9qbs F2Wb924bmJffibeuqNd10979GTYpnr/LJpk2bgsY9rkOxyImvcUg0MS5htVHxnWjYn6/xEzXNEL eOW5YvvHYQA137CfMP0jMADtc4DZ0PSdwKzAmSd7/i8q7KxTmA2XkXcLeglq91CD6La2FQWjiPj ikc1n3QR0PR6cUDoVPbTqIQS3fhhuRWR35hDfyIp6/bDmH5A4mBqPGTg0XJM/W6aBvhlRxJ2ipq zRQO1etC6vrE05j7k/Hr99VEJBXAty7bnDzjlTGnQA7p/IEkudg3GCaAL7gTyigLFnoMFDg44hi srdREeL3+AQXDj/TN+p3mIxnT/ERDnLRiOLel8INiFuB87DBz/1ttGho+d9UzaXgs7eBsxb0LUP kIG0ukOcpNrjy+vtTZBdrsaL0+MQkaM9O8Gfpp6rWJUu6FZxMjeChgq+0oLaQvUnC9gxa4RMHxX fyBNeTlul4tbA7asVOe7L8YGqLAfk2mU72pB+rJcyY7rAn3HqOnG1HUiJIGz6RuP+hO0njpEzon ZYeYqK4YdvPRB3BVXpTOE9e4mgq+zXUbYbFT1TLDWKHtSq3y6ni1SN7VNE8+IvTS0abe5Y/uo/C R8He6nGxZXwlENz+hEdppTR+3NM7LI38CIn9QIQp/K0rwiHjyJnMuz X-Received: by 2002:a05:6808:11c8:b0:568:195a:3bb0 with SMTP id 5614622812f47-568812d0fa4mr697292b6e.23.1794280392814; Mon, 09 Nov 2026 19:13:12 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 5614622812f47-56905736b92sm1019236b6e.8.2026.11.09.19.13.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 19:13:12 -0800 (PST) From: James Hilliard Date: Mon, 09 Nov 2026 20:12:50 -0700 Subject: [PATCH v9 01/11] serial: 8250_dw: allow port setup to report errors X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261109-submit-h616-uart-fifo-v1-v9-1-3f03961dae8a@gmail.com> References: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> In-Reply-To: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> To: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, James Hilliard X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.31 / 15.00]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; RCPT_COUNT_TWELVE(0.00)[16]; FROM_HAS_DN(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; TAGGED_RCPT(0.00)[dt]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; TAGGED_FROM(0.00)[bounces-27444-noreply=patchwork.local]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.77.114.92:received,174.29.1.49:received,209.85.167.182:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.232.135.74:from]; MID_RHS_MATCH_FROM(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; FREEMAIL_TO(0.00)[linux.intel.com,linuxfoundation.org,kernel.org,gmail.com,sholland.org]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 52DF61C41A4 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX Return a status from dw8250_setup_port() and propagate failures through the DW and LPSS probe paths before registering the UART. Use the existing LPSS cleanup path to release board resources and IRQ vectors on failure. Keep the current setup behavior by returning zero on both successful paths. This separates error propagation from the configuration validation that will use it. Suggested-by: Andy Shevchenko Signed-off-by: James Hilliard Reviewed-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_dw.c | 4 +++- drivers/tty/serial/8250/8250_dwlib.c | 6 ++++-- drivers/tty/serial/8250/8250_dwlib.h | 2 +- drivers/tty/serial/8250/8250_lpss.c | 4 +++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 9cbe076463e0..8fffb1f9ab0d 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -766,7 +766,9 @@ static int dw8250_probe(struct platform_device *pdev) dw8250_setup_dma_filter(p, data); if (!data->skip_autocfg) - dw8250_setup_port(p); + err = dw8250_setup_port(p); + if (err) + return err; /* Use the BUSY-safe sequence for both integer and fractional divisors. */ p->set_divisor = dw8250_set_divisor; diff --git a/drivers/tty/serial/8250/8250_dwlib.c b/drivers/tty/serial/8250/8250_dwlib.c index 91b3607b64e6..4a06dec6e263 100644 --- a/drivers/tty/serial/8250/8250_dwlib.c +++ b/drivers/tty/serial/8250/8250_dwlib.c @@ -208,7 +208,7 @@ static const struct serial_rs485 dw8250_rs485_supported = { SER_RS485_ADDR_DEST, }; -void dw8250_setup_port(struct uart_port *p) +int dw8250_setup_port(struct uart_port *p) { struct dw8250_port_data *pd = p->private_data; struct uart_8250_port *up = up_to_u8250p(p); @@ -250,7 +250,7 @@ void dw8250_setup_port(struct uart_port *p) dev_dbg(p->dev, "CPR is not available, using 0x%08x instead\n", reg); } if (!reg) - return; + return 0; /* Select the type based on FIFO */ if (reg & DW_UART_CPR_FIFO_MODE) { @@ -270,5 +270,7 @@ void dw8250_setup_port(struct uart_port *p) pd->srbr = DW_UART_SRBR_0; else pd->srbr = UART_RX; + + return 0; } EXPORT_SYMBOL_GPL(dw8250_setup_port); diff --git a/drivers/tty/serial/8250/8250_dwlib.h b/drivers/tty/serial/8250/8250_dwlib.h index 7191cabfb086..4d32651956ab 100644 --- a/drivers/tty/serial/8250/8250_dwlib.h +++ b/drivers/tty/serial/8250/8250_dwlib.h @@ -100,7 +100,7 @@ struct dw8250_port_data { unsigned int dw8250_get_divisor_dlf(struct uart_port *p, unsigned int baud, unsigned int *frac); void dw8250_set_divisor_dlf(struct uart_port *p, unsigned int quot_frac); void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios, const struct ktermios *old); -void dw8250_setup_port(struct uart_port *p); +int dw8250_setup_port(struct uart_port *p); static inline u32 dw8250_readl_ext(struct uart_port *p, int offset) { diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c index f1b4b975571a..7ace0515038e 100644 --- a/drivers/tty/serial/8250/8250_lpss.c +++ b/drivers/tty/serial/8250/8250_lpss.c @@ -350,7 +350,9 @@ static int lpss8250_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (ret) return ret; - dw8250_setup_port(&uart.port); + ret = dw8250_setup_port(&uart.port); + if (ret) + goto err_exit; ret = lpss8250_dma_setup(lpss, &uart); if (ret) From patchwork Tue Nov 10 03:12:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3999 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id E5C051C41A4 for ; Tue, 10 Nov 2026 04:14:02 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27445-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27445-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 3DFB13EF56 for ; Tue, 10 Nov 2026 03:13:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794280395; b=cI8kRLMK8G9OMAcDI8aE1qvFWUxqJL/bpj7lM75za7PhGs1OcMdH6vq+sdSxOq7a9een Ltuo0Q2t3041kuw8DlbUtRrWAU+BK/GfNMkdut4fGauDWn5Tz2GhwjXOjz56/0FHK1zbs lXjDD/Lz0Nn1tKfxFdXUoPKCv/bJEf4SoQmdDE7+E+L9qS81F3ZC7Of2+E1o0OswZzjKP 4YrczckI3aFdQ8fVCGQKIkEXX9NyXJ1/Dv3SSf0ZDWoyyJ2op6nR+dpWzC0QoSM8JsUah NNKhv7V049w0Og0AE2wjwbIWg5mJ/EdxUwTyi427yaT3L9HBNAy+8MdmG+gsvpuXHfw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280395; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=Z7aXPSFORx9h5Qfn55QWDlYJPN2WJIsHxPzHhos4jn0=; b=uaKyQjGoHShSJ6oGUT6IItk2z8LYbYQvhn2V2aIrngP/+8FlE4FNR5dTG8sQhdec6Yvb wsO3abJC1eLliOvcwgDWNlGJT3fPxc2/++b+TD7Rg2vc8fE0MJLjrbCRJTrACKQ0AQXB+ Ti6KJfdBAh4Teg5JCQa5ZUiV3EDNgbptbITcTM5powqJEuVmpdPnnS5E1HP4XyfisFweS 9g2edjsMVvhQZEapDcwGfQjtvavvocHhX+zUQ8sKnpMdhA51ue7GUmcFsreSq9k/fkdUb /pmMXmuOEABw1pIFrcKvpn22Vzq//4i26aKz5GjNevlicvNY55VZKlH9TqyUu7kGj7g== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=fFIUryB8; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C7AFF606A32E; Tue, 10 Nov 2026 03:13:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=fFIUryB8 X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.170 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794280395; b=DH59dfVmki9ApZMCtVzEzWE2zTTHlq0W+ZuKa6TZQ5XQscpUwkNlPBObHzBBvBdopWOE g5/Ib4ghK4oyvXG1J57c88dvnfy9Gk4FEwklvXFaMVFiHXfqocPY6pISuWXTAE7SB+48A mgtJAKuyOmkWjqwLTsZ9oaK70pRv7nVNwKCYLmAuNFoPUM+Ima+2mfP3SQ+Y4MNShlHMS TyW3htecbxk+EELgiS+QyJOsYpxR9/LY4VcrX9eaa9KqcVFaqkqZoLH4sPamtK/YiNWfL Si48hZ98w7ZLi0zIOnOfeyopwPuLbdMDTS2Om+85sqUtREC3KIttUyPwLbaG4lKFyuw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280395; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=Z7aXPSFORx9h5Qfn55QWDlYJPN2WJIsHxPzHhos4jn0=; b=bpEuJWj8Exm7xn5ScMp6Wjp2IR5fnJjQ5eXYhfAByS9YjsoZRyhH4cjfVI5iPpC5PBS5 LG9LrtUFa3EExhkPchBQkHAvFvG8yDbp6ftVPZiStAW9qO9sQkhc8rexO5KkguhKTw+Du fnYL6T8DPRtzZMBuxc7PU6OCxZivduKQLcBL1t958BLyXMyoapiduZxmjktesmpTp2FNq oMBhbYyYZAfkC1usmaF4n3XzqjafOav7G4mKGjeyCBd9vKBuPZS47Mgh8bQ7Le8bIL2vx CyZwxWjfUy5ws4/a7WkLz1R4XLP/HrlXlTndXhFbDLGaDrC/PYwYJGQ5QJBGMlGlj0A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=fFIUryB8; arc=none smtp.remote-ip=209.85.167.170 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5592860A260F for ; Tue, 10 Nov 2026 03:13:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5592860A260F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-53656465d1dso736543b6e.2 for ; Mon, 09 Nov 2026 19:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794280394; x=1794885194; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Z7aXPSFORx9h5Qfn55QWDlYJPN2WJIsHxPzHhos4jn0=; b=fFIUryB8ViVWwAmn6CwiFxEOtRRvGVwdmLUn5rfwkLFYs7ebCEQHkxJfAqH9RqqB5k xOeEIX8Ye3/EXSD92vAQXQoOs4Yp9/+XUk2B7lG6SYazVrCWdeJqPFfK9UMTvF9mt1EW 77Ts/OCwKFmT2bQ0mXhWvCHIQ6zBIn3w7XGlnS/3JrSyXKPKWyCGgSz27PhGTI2MGzKQ rEOlb2p105cNbQDYw6rjxhaJgcyc7pKROhc3Fvdgr4dsw2GwZtrjrBC9jiVkB2c0W8Pd tBdb7b8CW2VGvPzI5rbrmt8nw5PbTbo/LKdv+kcZ77XbW+1ONoK+vnk36jksB30KTQoO qjOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794280394; x=1794885194; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Z7aXPSFORx9h5Qfn55QWDlYJPN2WJIsHxPzHhos4jn0=; b=CIE92TcM32/JPisCp7FiYT2GHJN4sAHbyekPjZmEh5Z95Tfba4A/UkaFoeRiBQRGRk 5GLZUuBF8HM0UH4spfbtTnCzIm47PZxbbK/ljdId53BNYWZgCvIFWi4Vg6t+1I6i68rv Rsagm6Ve2JyXfJw1hv+g+Pvz2f5H0oQNBq4K89ilYvAi/54QPjKq0m1QLcSMk2lOZJYZ mX7Jnhi9JUt9dLlKGyXrOHTNhTbsQqemZ3QtbL4HTIo+V4QseFYbQ9QaNI7RexIbQyJp gXgVXfrl3272rD/QJMNGl1RtmwANpGtP12Me5NWaWFy3kvBGKSQ7/N808VFs+JCSa5Eu GUgw== X-Forwarded-Encrypted: i=1; AL+hErGViCq3CQXfpCK/rtki7W0f1ROW1QKJH5I52lRPKPxdSxSdEnMJEudAHCirzQAlixt6BeC8Cx1i4Qh/8Q==@lists.linux.dev X-Gm-Message-State: APuU4Z9yCRfOGqFsMc+kRw9Hh65kvsLQf999VohzosS7hHcXlQNujPAL rA7RFpWjXIetg6/b/BlsFqJ3j75uOajpDmOCtT2oa5CBD7d7mx3LnPA8 X-Gm-Gg: AYBFou19UNW7hSvds6ijOLGgV6c6RqPrM93s+ejeldn63wIvnEi8a9L19RbWeb9DDed hTduKTiMHT+RO/M3Lg5ZAjsSX8CIQu4j3GWueIh4PfkytPmeEp4ZczyKniQCpfhN/T6YAnYixnB 71HByxKmbgzHwxIRCtKj/JE+voLMSh9SOQHynH8c6LbRGGcTd40NsXldcd+DpfRHMLy14V50RIa ODUapZvDp13SL8AHn4Kg6pTqXtygYTiD2rL968RYrk7YGEkje1on9GWqiquy6Uz9MsPmCJMx5EY Hy1daduKarEI0RUleHOGE1ej8spfdVCa9m+dTf/T9fJyjM2W/jhC8y01hpuvTM3dy65OZ5waDG4 IPhZAZ3LxtKFQHkx2YrTDNgvbNSKM0Jha1HLB4paUVw2/xAs+ktOkR8svP6v9E049zrmbxgIid0 jDtaw0P4OL1yBwzCxl0ybWbzP0GpFr22rMMxPBx5sTHA7ePABmvjljrWQ8mpjNjCwyw4+Z1I0mC b8EzEtz/r7Nv/MjRxhoI3qa+Nrtif2bHLPvk8V3fIGpLx0o2a0iToVZAYlfUY3szPmeKb7Ajr1p vmExBDZ6NiKDK9KHQIuF+cpUIrDHYk2WYJZrN/oBE5KEWnc9BhQdh+ParKf2Gs3isUjjlccaIPq g+OmHdvZx02DjXjaNeCs+2VCNmxGwRb6MbTivEDToRZH2sxLJuLpLq+73H6Ep1avGJX1jhUvItT kLWjyX9bqQYTbGnmwcnGom1mGt3J2d8ePM6wPNrvMK02KE0vYRvdLb X-Received: by 2002:a05:6808:1810:b0:568:e5e:8058 with SMTP id 5614622812f47-5683cbec0aemr1136816b6e.19.1794280394206; Mon, 09 Nov 2026 19:13:14 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 5614622812f47-56905736b92sm1019236b6e.8.2026.11.09.19.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 19:13:13 -0800 (PST) From: James Hilliard Date: Mon, 09 Nov 2026 20:12:51 -0700 Subject: [PATCH v9 02/11] serial: 8250_dw: select port setup through platform data X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261109-submit-h616-uart-fifo-v1-v9-2-3f03961dae8a@gmail.com> References: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> In-Reply-To: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> To: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, James Hilliard X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-1.19 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[6]; FORGED_SENDER_MAILLIST(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[dt]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; RCPT_COUNT_TWELVE(0.00)[16]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.77.114.92:received,174.29.1.49:received,209.85.167.170:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]; TAGGED_FROM(0.00)[bounces-27445-noreply=patchwork.local]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; FREEMAIL_TO(0.00)[linux.intel.com,linuxfoundation.org,kernel.org,gmail.com,sholland.org]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: E5C051C41A4 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX Select feature discovery and DMA attachment through a platform-data setup callback. The generic callback probes the optional registers and attaches DMA when a FIFO size is available. Integrations with a fixed configuration can supply their own setup before the port is registered. Allow setup to return an error so integrations can reject invalid configuration before registration. Replace skip_autocfg with the Octeon setup selection. Octeon is a 64-bit platform and continues to skip optional-register probing while preserving its existing conditional DMA attachment. Select the DMA setup helper directly for this integration. Keep generic setup for devices without matched platform data as well. Reviewed-by: Ilpo Järvinen Signed-off-by: James Hilliard Reviewed-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_dw.c | 44 +++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 8fffb1f9ab0d..613907b8a40f 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -64,6 +64,7 @@ struct dw8250_platform_data { u8 usr_reg; u32 cpr_value; unsigned int quirks; + int (*setup)(struct uart_port *p); }; struct dw8250_data { @@ -76,7 +77,6 @@ struct dw8250_data { struct clk *pclk; struct reset_control *rst; - unsigned int skip_autocfg:1; unsigned int uart_16550_compatible:1; unsigned int in_idle:1; @@ -596,7 +596,6 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data) p->serial_out = dw8250_serial_outq; p->flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_FIXED_TYPE; p->type = PORT_OCTEON; - data->skip_autocfg = true; } #endif @@ -631,6 +630,33 @@ static void dw8250_shutdown(struct uart_port *port) d->no_int_count = 0; } +static int dw8250_setup_dma(struct uart_port *p) +{ + struct dw8250_data *data = to_dw8250_data(p->private_data); + struct uart_8250_port *up = up_to_u8250p(p); + + /* DMA setup requires a FIFO */ + if (!p->fifosize) + return 0; + + data->data.dma.rxconf.src_maxburst = p->fifosize / 4; + data->data.dma.txconf.dst_maxburst = p->fifosize / 4; + up->dma = &data->data.dma; + + return 0; +} + +static int dw8250_setup(struct uart_port *p) +{ + int ret; + + ret = dw8250_setup_port(p); + if (ret) + return ret; + + return dw8250_setup_dma(p); +} + static int dw8250_probe(struct platform_device *pdev) { struct uart_8250_port uart = {}, *up = &uart; @@ -765,21 +791,16 @@ static int dw8250_probe(struct platform_device *pdev) dw8250_setup_dma_filter(p, data); - if (!data->skip_autocfg) - err = dw8250_setup_port(p); + if (data->pdata && data->pdata->setup) + err = data->pdata->setup(p); + else + err = dw8250_setup(p); if (err) return err; /* Use the BUSY-safe sequence for both integer and fractional divisors. */ p->set_divisor = dw8250_set_divisor; - /* If we have a valid fifosize, try hooking up DMA */ - if (p->fifosize) { - data->data.dma.rxconf.src_maxburst = p->fifosize / 4; - data->data.dma.txconf.dst_maxburst = p->fifosize / 4; - up->dma = &data->data.dma; - } - data->data.uport = serial8250_register_8250_port(up); if (IS_ERR(data->data.uport)) return PTR_ERR(data->data.uport); @@ -862,6 +883,7 @@ static const struct dw8250_platform_data dw8250_dw_apb = { static const struct dw8250_platform_data dw8250_octeon_3860_data = { .usr_reg = OCTEON_UART_USR, .quirks = DW_UART_QUIRK_OCTEON, + .setup = dw8250_setup_dma, }; static const struct dw8250_platform_data dw8250_armada_38x_data = { From patchwork Tue Nov 10 03:12:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 4000 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 398B61C41A4 for ; Tue, 10 Nov 2026 04:14:26 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27446-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27446-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 5E252443F7 for ; Tue, 10 Nov 2026 03:13:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794280397; b=EgssRPSRR4hcmfBZYa1aAC0gyCgYC0n7RQ8qgOJUYyrGdVOvYy0Ah/zpPUWud/g93yYW mQ8NJcbjB/cYI+2U4p+OZPioZ2kWvgCF3IlxFPaAPXccY/gK19oGIDhMgg7k6KTc5QnVx PmiT+ON1ebD3eTPolmBoGys6TrQjlw8/qbcO/kBmd/hgS0/ALN0ZbKJsh7UN60t1b8hZ0 nu5GLpk7xpJlcpOW9y/Uf6t5NDYKu8uX1aZvjAbWqEwGUcMwQOYVgFp1CPPe5948c+67q UcoYU8jTtxTs1c1fCVpLZaP7LvzGMizNSP7dK1VwAS4ABnw5Xj4qBU9FQYmVm2NJHfg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280397; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=E9UoBDBjwLLwDb4WmV28avfpsh+5/w/6UybGFvQ6fZk=; b=A0XivaquZAN7XszdGd5ORvDwJgLK5qIpUwwppQ8Hg+1qsb/gUn8T7rEvp38iRQ4MwCsR Xc/EAWWzBf9zEhX8kgnGihi8WtFkghtKUdCzjZ4eywwybzkbiguRtjIcvTiTNIv5WCxEb v8OI0n1cVn7gtf5ea9dDtKzcwazlOg2dlXhHGLVNMbHzdXLnhgq1tiiFOjMBgtd592g3L ER8NKzJwCCAE/vuJuDPzU34nYT6j/lBlgwKExrIhja1JU0ezOy61En4fveNspkVtNdPIz fpQkpDwllTyhsdHoDctbTDAc7Z20Pu7OKWohyMqPvypk5KIo19KrjOc92FtSj/vdgNA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=lp1Ss9pX; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E057E60A262A; Tue, 10 Nov 2026 03:13:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=lp1Ss9pX X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794280396; b=wIIAWo9C0p9Wtr1WfBJjWtMJkEvsDhlUFH91lLD+c0UKK2KT5sjmhzcLSNlny1wlKBuY HlGhiJ0WGU4qPP7INsU0c7Nv6ei7pGltBOT11uidukYKHn0xjeJBr5Tb+ILjy1ssgzCJU /ZeuCE+pkhG2kb39GVdJ0pLBvCBuyc6jYh0zs9jYfGPAazVmPSeIIoLcpuBzNxg03Vxn2 sqR7Y71oLgcDiLkEV7NJoKgQeA1YbgHaIdY/4zh+ekxahTnNqaibG6sbe+00+SLHYFz3s l/v7tgtM172pvmpvduKopNsfeJ3P7HKg5pOAymMg+aJeZax5b7YLX2+qtNC81HSbavA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280396; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=E9UoBDBjwLLwDb4WmV28avfpsh+5/w/6UybGFvQ6fZk=; b=DhKbrknki9NN8oxVzyewSA+/c7f+Ksd00vinRs6ST91/CE9vgSDFLc3sjtJiq4zzNssf mHHPvmh197WTFf1yCbVOZ4q8A+AjixTEOMR1vZIPD5V/deEq4qrwo2GmvLbYdt8q2M1dF v5Ilwm043pilRRYTE3zEL1K/p7wZmOjLQgDik16sZx+5QeVnR8y69KcZEmQpdLqTLJWKs H0JgedV2TN2V/aSosnpY54OKOuFsMfmH1B82zWPVxcK4o0s/3ea3ZLMiFq+SiB0+Z9nDn umEDT4H8JMUNZzFLRIcKLUQrvBNME4xgmS1F+S/Q9oEsrhfjxyKslT8YGhOQIkSGpDw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=lp1Ss9pX; arc=none smtp.remote-ip=209.85.167.182 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DB5F60A2620 for ; Tue, 10 Nov 2026 03:13:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6DB5F60A2620 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-53dbe9b8d6eso1283552b6e.1 for ; Mon, 09 Nov 2026 19:13:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794280395; x=1794885195; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=E9UoBDBjwLLwDb4WmV28avfpsh+5/w/6UybGFvQ6fZk=; b=lp1Ss9pXSFw8DZvu+3sMvDN7OwP686K43BB/+cn98rz/HiY15mAVR9P9pv2O9WMYHn 2zZLyFmU29ZqQHbKZtl+K/Xp6Tjjwkd+RrJxMbnNd0j/diQdAvCFolGMuWmjM5WkQ3Ev 13oHUPLfmpFsdvwOz9DeFBIGjh5Pr0uprzZGnfae7HcH9xDkzsQh4+Zf6vFejtdPzCXn hMnFgx313VXYG9O4Sr7SIlw/QDfHu1daVuh6XaxM7eanTtm2fkU4LE9/8mhbVTd0CqDQ poQzZvwwqSlbV5dWqUyveVLYpbw4kpodvgmlqTU9avvIjXLHILahrRa2pmXBK7VHr9gu JpVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794280395; x=1794885195; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=E9UoBDBjwLLwDb4WmV28avfpsh+5/w/6UybGFvQ6fZk=; b=N7DBNVE/lwzw0D0kSC1HWsfFSxqQ+ht67tXXp171hYZUWCS4m94OschIJ6u94MWc4N zYfdD4sWQfTK+HY3Ie2UmP6wony8+rqE6/bb0W9titJGey2PnAGa/oYPYszIhmQ4hExm 4LakZr8Gs92wYNRByDaN/krQ5xfD5JEmicwCLAxgwU3OEmxK24Nq65UMarzNkgS+bnFW ak+ZlXHwOm+5XKdiH17YvkYOYgoa3gYwncWco+TenLY9pKWD9a5Unv1/E5EytUAOwbDD eAu8I6yJ/E1DYxAFa6mWvlCkFUSMbgSmOpGLh1UEQ5XCPd+cdxQ/JZIa8Y3JUyK9wdQt jfzA== X-Forwarded-Encrypted: i=1; AL+hErFJLGOhWoGAvzjcEOzHcKwYl8PPAbFq16U+QhCO47C2PmXA94N0UpMsihxzJcZWztLT+tD4+XOIBXAQPQ==@lists.linux.dev X-Gm-Message-State: APuU4Z8baDBGVqI5EH2gt0WV25k290y9yVpz2OEvZleaTJXppzxw9WeI GqBRKJIkI2ImENBRz0shjOf9PMwHnoYbqMVz6t0frBQPtERxe52gH1mG X-Gm-Gg: AYBFou0hfMomwT69C4XtHHOKl1R8FytKzBmt9aFIUV1BFo6VcNnR4fZsLr0s7nxVoFR eyDeEFRD+ZjijkkQAQAyoUIKS3CyEaohBoZZJB28rmkwbMoUW0UJLAgGNsPdPRv0WgNgy7zOjoO Y5sPb0dp4cMiG/OhN53m3DSlJ9zrrp5CYSMWWGW+PFkt7Z1ho+f4BTCExqCPBg1sSYJL+M74jbd bxTot7uJy/ZJeo4D9LZEzoh/4qoHBeCk8ILQQM0mtMK0/YCAFlRSwwhVwE4m7sRSuL3sksBxBBI vHV1VPeZwueV6++WAMbos6Qs7tkIphz0qCIS/5R4r9YTR46FDlvEXMGa532oIs4AHvW5M59O+Tg CZBYgwsBC4UYcWgFcGUayNEipT9Fp001bI/pCKTIsOndT4RKNTP4zcn7rfcC9DptNL6sq7C917F f/9YXOAQtmOZQPGqqLftk7CNMAT9gwLb1EcNEnNjlxNAUaZyjIA8JxN0ElD0zFKbospM8n+iw2M CuDK2ovdHDwwG4XNrMwnFbZcd+B0zJP6JuIeAqzcnqObB3UYWdys293RxMdVQ9kt0z3Oduq3HY2 9qfkgqQOPFrqv+o9JnedZgUODUKT5MhkGJF0P1BwWPgDmibkE4pmOgKG581aaW9ffuvfs+weL9f cZmYdS517rdVhR+crM+ft47YnwKiVK+OFRumvwG7kNOvajIFJF+iRsjsmlXjfR74/B/GH04w3H5 TExIOznnhx1+1ltjfWeBUFJyat+gzuqF6HH4Ns/7GUAf0TL9UJizhGWc1QB62lmlZton/eFPo0+ Q== X-Received: by 2002:a05:6808:3089:b0:4fb:c2dd:c7a5 with SMTP id 5614622812f47-5688127ca80mr655733b6e.31.1794280395471; Mon, 09 Nov 2026 19:13:15 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 5614622812f47-56905736b92sm1019236b6e.8.2026.11.09.19.13.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 19:13:14 -0800 (PST) From: James Hilliard Date: Mon, 09 Nov 2026 20:12:52 -0700 Subject: [PATCH v9 03/11] serial: 8250: widen RX trigger byte counts to 16 bits X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261109-submit-h616-uart-fifo-v1-v9-3-3f03961dae8a@gmail.com> References: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> In-Reply-To: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> To: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, James Hilliard X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.31 / 15.00]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; RCPT_COUNT_TWELVE(0.00)[16]; FROM_HAS_DN(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; TAGGED_RCPT(0.00)[dt]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; TAGGED_FROM(0.00)[bounces-27446-noreply=patchwork.local]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.77.114.92:received,174.29.1.49:received,209.85.167.182:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]; MID_RHS_MATCH_FROM(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; FREEMAIL_TO(0.00)[linux.intel.com,linuxfoundation.org,kernel.org,gmail.com,sholland.org]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 398B61C41A4 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX DesignWare UARTs can have 2048-byte FIFOs, with receive thresholds as large as 2046 bytes. The byte-sized threshold tables, setter argument and sysfs parser cannot represent these values. Use u16 for the threshold tables and byte counts throughout the 8250 conversion and sysfs paths, including the uart_port callback interface. Keep the FCR encoding byte-sized and preserve the existing threshold selection. The Moxa setter continues to validate against its 128-byte FIFO before writing the byte-sized trigger register. Signed-off-by: James Hilliard --- drivers/tty/serial/8250/8250.h | 2 +- drivers/tty/serial/8250/8250_mxpcie.c | 2 +- drivers/tty/serial/8250/8250_port.c | 12 ++++++------ include/linux/serial_core.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index 21ed9c41b751..939b7d4209f1 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -69,7 +69,7 @@ struct serial8250_config { unsigned short fifo_size; unsigned short tx_loadsz; unsigned char fcr; - unsigned char rxtrig_bytes[UART_FCR_R_TRIG_MAX_STATE]; + u16 rxtrig_bytes[UART_FCR_R_TRIG_MAX_STATE]; unsigned int flags; }; diff --git a/drivers/tty/serial/8250/8250_mxpcie.c b/drivers/tty/serial/8250/8250_mxpcie.c index 4935a5d1c1a3..4f0b881b4f83 100644 --- a/drivers/tty/serial/8250/8250_mxpcie.c +++ b/drivers/tty/serial/8250/8250_mxpcie.c @@ -257,7 +257,7 @@ static int mxpcie8250_get_rxtrig(struct uart_port *port) return serial_port_in(port, MOXA_PUART_RTL); } -static int mxpcie8250_set_rxtrig(struct uart_port *port, unsigned char bytes) +static int mxpcie8250_set_rxtrig(struct uart_port *port, u16 bytes) { struct mxpcie8250 *priv = dev_get_drvdata(port->dev); diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 36b2b0a2c05c..452851815ffc 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -3008,14 +3008,14 @@ static int serial8250_request_port(struct uart_port *port) static int fcr_get_rxtrig_bytes(struct uart_8250_port *up) { const struct serial8250_config *conf_type = &uart_config[up->port.type]; - unsigned char bytes; + u16 bytes; bytes = conf_type->rxtrig_bytes[UART_FCR_R_TRIG_BITS(up->fcr)]; return bytes ? bytes : -EOPNOTSUPP; } -static int bytes_to_fcr_rxtrig(struct uart_8250_port *up, unsigned char bytes) +static int bytes_to_fcr_rxtrig(struct uart_8250_port *up, u16 bytes) { const struct serial8250_config *conf_type = &uart_config[up->port.type]; int i; @@ -3073,7 +3073,7 @@ static ssize_t rx_trig_bytes_show(struct device *dev, return sysfs_emit(buf, "%d\n", rxtrig_bytes); } -static int do_set_rxtrig(struct tty_port *port, unsigned char bytes) +static int do_set_rxtrig(struct tty_port *port, u16 bytes) { struct uart_state *state = container_of(port, struct uart_state, port); struct uart_port *uport = state->uart_port; @@ -3094,7 +3094,7 @@ static int do_set_rxtrig(struct tty_port *port, unsigned char bytes) return 0; } -static int do_serial8250_set_rxtrig(struct tty_port *port, unsigned char bytes) +static int do_serial8250_set_rxtrig(struct tty_port *port, u16 bytes) { int ret; @@ -3111,13 +3111,13 @@ static ssize_t rx_trig_bytes_store(struct device *dev, struct tty_port *port = dev_get_drvdata(dev); struct uart_state *state = container_of(port, struct uart_state, port); struct uart_port *uport = state->uart_port; - unsigned char bytes; + u16 bytes; int ret; if (!count) return -EINVAL; - ret = kstrtou8(buf, 10, &bytes); + ret = kstrtou16(buf, 10, &bytes); if (ret < 0) return ret; diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 4eeb8253752a..97301ef66af0 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -461,7 +461,7 @@ struct uart_port { unsigned int quot, unsigned int quot_frac); int (*get_rxtrig)(struct uart_port *port); - int (*set_rxtrig)(struct uart_port *port, unsigned char bytes); + int (*set_rxtrig)(struct uart_port *port, u16 bytes); int (*startup)(struct uart_port *port); void (*shutdown)(struct uart_port *port); void (*throttle)(struct uart_port *port); From patchwork Tue Nov 10 03:12:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3998 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 6E86D1C41A4 for ; Tue, 10 Nov 2026 04:13:36 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-27447-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-27447-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id D3FF960CFE0 for ; Tue, 10 Nov 2026 03:13:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794280398; b=cFsXY4nGsSa9O4ErZF8RmH20OTGM5POj3AGpx0R16nC2I+0h7SXKT41Co0A2RbNIiCz3 rwSBfjkt4k5j306fwE1D3zwUGz7U9MGrVxO9xPQ2+fsNC86tNRDvnfLBoB/8TsdRc0P60 C3V30G854dR2tQC3b87ZWR6NM6Zkt6sE4Z976H26RxJ0ah1bSKtlDUh0pSjo8tcoTQVM7 ZsefxvCKZsUMHSBy8U95sbz8dQLbYPHPWnVQK4Cu6N01dTYTSZWvhu9jSGFQ6JlG3Spro LcQTHkflq8rVCWvaNpSILZ2inpdtadGVuxpYHxphTr+FxMhhLMgJIt+8SKG3SJPlUJQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280398; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=wQd2y5d3c9Xle1BZoXd9DRgnl2+Av/870a5uei8ZYeo=; b=isMWi862J/2+Om98vWyLUQ4lO6gEvRKNWvAoV+4HcIKLBIeF2T1Jci+SbzUOhJYHatu8 m6DSdNyx8CZNmsOtKmsa1EPE3lEpFwyjR8imq+sSma5lP+3hb/qSIpxQEkS6wCTqeHFEq /zALKEfJ3wjDGJN3b17G75VSg2uQBFxYBGcOo7GUJIFlP76ns72Ri9R0HNZaElSrtR/xf 1mupLuY6cXOETCG+a1is4ij7zuAZnRbfia7N/mew0zhHUNtFZN4JBuYHveF8EHMsM2Wvz W1l5P/sRLegfUcW2LvJo7x9Qtnll/3QEhWzLAO1at23fdpFisX6P89EeHVc5GvIiI2w== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=ar+g2QD8; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B15D60A2639; Tue, 10 Nov 2026 03:13:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=ar+g2QD8 X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.177 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794280398; b=hd64p4sucHLz5wk3B4jhregFZqrEcUdxbHipcv5A1QugstVh3xzOIfLefTZZyyW+JesS 7HmTv4g834a99FAzEdbsBDhsohTgp95fylAoRgo0sTo/jt3c59tE+OBilFG4c4Eyzza92 HYvaDxz6y1xyrCgrBC3TbBwr2bQon7X6iFqrbbUiBOh7vnmdK2nszHSt9oOJOCks1vekN 8GgujmfepOsYuf+tfNko3Rx2Sw+W42bWOeCn9gm5vZJ1x6o5LbyF9f8dSIhaPBTpd5nOE iCFOYyhs3Rmx1QbIF9+O4gMs3r/tM4hvD8hXyKMWDCMuZ/s5CsjQhkBKc5uYOcbRWAg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280398; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=wQd2y5d3c9Xle1BZoXd9DRgnl2+Av/870a5uei8ZYeo=; b=XyXTvs5rTZEuj00EDMUGdn77SZCYXGuzc5L7WfLEIR98STEWYYr5hUxpPsjYAAe1BlTn eDggXks+ju0fDs8x8a4WMB/4PxvUNNVIWgwVCK4WvkBk6ocgn+W/G3PX4Z01GQ/VchzT+ sr9Y9KpFnC4HtPirBJmmb7wQuLJEvASQuo8bz81mUJEx5CzUrnpTE+2UsJK9U01g7w+BX Ui0rrj38rtOgPpk64LAOpqKAPKD5hUbdUbVD4FvO8sCq6xGtV5T3aOGIk27CZPl/dA4qL R/7mjF6li/RIAE4Xd3PbHq+2zBCQI8QScSdC8wMG4d7Ry943le64GR1GfwhyOxL3+fA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=ar+g2QD8; arc=none smtp.remote-ip=209.85.167.177 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5FD560A2630 for ; Tue, 10 Nov 2026 03:13:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E5FD560A2630 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-4f48d91ba7dso874923b6e.2 for ; Mon, 09 Nov 2026 19:13:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794280397; x=1794885197; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wQd2y5d3c9Xle1BZoXd9DRgnl2+Av/870a5uei8ZYeo=; b=ar+g2QD8XlhgDInkpxY5Hh1tOsD6V1fJoFqWlQLD0OvyQoTuPdIyPT8MhCWBmbN4OE zTf4QkcMdrLQV7uU6vDM7Mj1kEfbnFE8QG3vqpqlsWgID7LDr4ktGTRqdHZzriW7hxSq bGE86xrYqQqshhW3x0aOgl7X58LY1tK+1A+FO3OafJwEpKHVwQG4dDZDTNaN3OOstWMb eTvcRzap8bvNMK+T+pUOvarGDGuFz6gyxBNq1UCe3Z7hXA2Gn6A79xyfP2iXmMv12kM4 WrN37G4PaBREABTGUQlVHoxSNDupcBd7JbXVXvUrNE0uwcg93GIMgu/vC/qiKVZC3qhv Lotg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794280397; x=1794885197; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wQd2y5d3c9Xle1BZoXd9DRgnl2+Av/870a5uei8ZYeo=; b=JTnBO2ChZ4LMjiJEeQJ8EaLcZLLd2+Vzro/tq7FK5J233u8IN0bbD2tTetEDHDweZH BLiX/XyNerTCsyLGstBgRYepwvuLb15fRldn9lBUJANU9YpFp++4KYQifuqKa3ywyGlp DEor8xYBjfF9MHOqScDLR9YSGNxgeSUFGvkv4xutizaVYdAvbaIlieJSOPtWAqKLHXze kYt5NeT4B4YkltU3RDW8aFPPGZIwR4axyKj9RfRho+clNmwuUOAJ5at1dETbjq84M/6u yjhAGRNEBT2Zc0F+z6Cmcsh876ail98t6a5jfr0BD8JS5ArjTOPJ/G8T6h4xoO64eCc+ 0R9A== X-Forwarded-Encrypted: i=1; AL+hErGxvNDhDU+oY3zlBGpe+R2smpoa0/ewPGmpX4ewKu7huUwHjitM9dt2fsuOu0kaW/dqT5kfGFmps0gWcQ==@lists.linux.dev X-Gm-Message-State: APuU4Z//Via4tzGkMsMsuuwUxqrrliys8duMydWlHgWKBI3FlBf4r6s2 pt6ebZ6AfXnfHYADGblMYfde7D90wTbGew420gchiaJuTXRfUdfYEs/G X-Gm-Gg: AYBFou0zXjmbtnyLYJVIPf2vqlATlL+FwdcGLu0DIhSToZkQaY6+kMsEfbbw7ZAuJc7 uF+dPtQRih4efYftmy+YRA9VT9P6+iEOFkWk5qeVLspUNvOvz5jhYGGfNKjptSop64oKu2yneCg iNU/YBnDFz43nvckk4Z8Q4FIUDm0vpCF3WRI/la7dsDpCphnma9i/9LQs8R3tGbTVu7aFXl/MD7 J8AOwbjqCY2jr4Al2/PW8IgfxUOZ/R6yPEuC2Ohxs67ZdMoljNEphWgmxj3zg1mOoJWFYmRLlHv KbzjRXYzBs33z+o44+W5zmVqY1P3RhLX5jN0wUAWhxTUlGRMNfIFVe7PXiTaMzayz74IwOlIeNQ SWXtB0ktWK0DiUAYABsPygYJ/Wr+Syr4Rpq4HzUPGbguf5FYUS5N5YZvTem7Drtn5frO5MWteqh XeAMTWiZLaMZwXGh/BV3o6felaa5tHtL0DsN4eRTIMDIUJnEjOMf+70RyMNL9UNPXl0t1gKRbId 3zVxiFNWQR8wu3FPLtjsf1nwyEtjRMt267XNeRkz1TEg5VpxG+3gMhM4bBDX01KvxnofviYt/CK QCB+mHqLa1l9MxHPeiy4fNw2n1mieYQIgQKTnI0ivCrRxNUlt5oZPVghi35svLLrw1OE9oF0lC7 xquSywbAHKJTtig+TG3YIT9ov6CyQfFOP6on04V0Z9iQJRNndXr1lsMxTyYakUMaBWJV7xyOFWZ CXm1fSdDvk2353Jq37jKX8gEMGQkmq+5B5Lgy/WvMmKXyLRJxfLu1J X-Received: by 2002:a05:6808:1787:b0:564:347c:5a7c with SMTP id 5614622812f47-5683cd801f3mr1322272b6e.59.1794280396724; Mon, 09 Nov 2026 19:13:16 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 5614622812f47-56905736b92sm1019236b6e.8.2026.11.09.19.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 19:13:16 -0800 (PST) From: James Hilliard Date: Mon, 09 Nov 2026 20:12:53 -0700 Subject: [PATCH v9 04/11] serial: 8250: share the RX trigger conversion helper X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261109-submit-h616-uart-fifo-v1-v9-4-3f03961dae8a@gmail.com> References: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> In-Reply-To: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> To: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, James Hilliard X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-1.19 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[dt]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; RCPT_COUNT_TWELVE(0.00)[16]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; TAGGED_FROM(0.00)[bounces-27447-noreply=patchwork.local]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; TO_DN_SOME(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.77.114.92:received,174.29.1.49:received,209.85.167.177:received]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; FREEMAIL_TO(0.00)[linux.intel.com,linuxfoundation.org,kernel.org,gmail.com,sholland.org]; MIME_TRACE(0.00)[0:+]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.232.135.74:from] X-Rspamd-Queue-Id: 6E86D1C41A4 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX Drivers can supply receive-trigger thresholds through the RX trigger callbacks without adding a legacy port type to uart_config[]. Extract the threshold search into serial8250_bytes_to_fcr() so those drivers can use the same conversion as the generic 8250 implementation. Keep the implementation in 8250_port.c and share it within 8250_base. Include the unsupported-table check and preserve the existing nearest-lower selection and highest-encoding fallback. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Reviewed-by: Ilpo Järvinen Signed-off-by: James Hilliard --- drivers/tty/serial/8250/8250.h | 2 ++ drivers/tty/serial/8250/8250_port.c | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index 939b7d4209f1..8729619160ea 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -73,6 +73,8 @@ struct serial8250_config { unsigned int flags; }; +int serial8250_bytes_to_fcr(const u16 *rxtrig_bytes, u16 bytes); + enum uart_port_type { /* Internal 8250 only */ UART_PORT_AIROHA = 124, diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 452851815ffc..73bc9e7ab703 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -3015,16 +3015,15 @@ static int fcr_get_rxtrig_bytes(struct uart_8250_port *up) return bytes ? bytes : -EOPNOTSUPP; } -static int bytes_to_fcr_rxtrig(struct uart_8250_port *up, u16 bytes) +int serial8250_bytes_to_fcr(const u16 *rxtrig_bytes, u16 bytes) { - const struct serial8250_config *conf_type = &uart_config[up->port.type]; int i; - if (!conf_type->rxtrig_bytes[UART_FCR_R_TRIG_BITS(UART_FCR_R_TRIG_00)]) + if (!rxtrig_bytes[UART_FCR_R_TRIG_BITS(UART_FCR_R_TRIG_00)]) return -EOPNOTSUPP; for (i = 1; i < UART_FCR_R_TRIG_MAX_STATE; i++) { - if (bytes < conf_type->rxtrig_bytes[i]) + if (bytes < rxtrig_bytes[i]) /* Use the nearest lower value */ return (--i) << UART_FCR_R_TRIG_SHIFT; } @@ -3032,6 +3031,13 @@ static int bytes_to_fcr_rxtrig(struct uart_8250_port *up, u16 bytes) return UART_FCR_R_TRIG_11; } +static int bytes_to_fcr_rxtrig(struct uart_8250_port *up, u16 bytes) +{ + const struct serial8250_config *conf_type = &uart_config[up->port.type]; + + return serial8250_bytes_to_fcr(conf_type->rxtrig_bytes, bytes); +} + static int do_get_rxtrig(struct tty_port *port) { struct uart_state *state = container_of(port, struct uart_state, port); From patchwork Tue Nov 10 03:12:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 4001 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id B95F01C41A4 for ; Tue, 10 Nov 2026 04:15:12 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27448-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27448-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 0ABF480CD5 for ; Tue, 10 Nov 2026 03:13:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794280399; b=GyLObVQce+m8Lc1takhSis5vk7D786RYCiIE5rGIf55BaToSXi/IEg6iAcQYchA5crOp UKDAhbKz2SNr3cFJ45sQ4An1xUXqVzVybBNlcBTk+lg78u+dLbQa4XT1Ys+DLggmYGMvb PGjxFxX8iZcytT3c3EW2yRW9LPDbdhwtIm1KEJxxKjSIJ2aGnRg9TpH+S53e2gSn2KkCv 1q7qUbbxm4A5+B4RaEWpeUuPF2Y2ofHxlFbCMajOzm3vfZ3xZlNfI5yVkJ88zomGe8iIn DatQlj0oqcc1GkImtoV+h9rOxOr43kyC/bFjoEB/Z+DoJdwALzQ9NCsl0NMwNfmRRJQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280399; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=9v6fhE64vJST/e4wIKc/qZZ4G1qcfWVja1/2g7y5JFA=; b=zqIexh69LZqFlIOmOiRlCjph5BpZK8ur3YBI/3cuDdZgt4kUXBL03DuGFAOhnLBf0e/J Fb7FZvR2t0+a/E/fYxtIbr/Q95YRMp1+5a+UZuPyy1fR+aVQu3gctDUMVOMycGsvoxK5D gkraw08N/B5p1NzMHyi2t3ZZFMfr5ZlGZeJb0QZUiyaaaFO+0dBKKF0d3So/rcIi7ViL5 ctXT1QuH8D7p32b8aADTpheI/85YRx2x3zol0zIV3z3gTqPYfAHsySMBAjnhycNhvAiA7 0afciI8lVpueBKHaRSvjKGoGBWCTzX+yqHcifGtC58LQQvqmmBgCkCN9i/6pprMhLcw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=CGj0n9o2; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6881560A3806; Tue, 10 Nov 2026 03:13:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=CGj0n9o2 X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794280399; b=lmMX00UjCsiFqINC8X5NzA1iluCpuMkrkiFmQvNoBtKy3T36XlbolhxjD+WETGQN02I3 dfQTygyA/64XWvyuTiEt2eZUcIwC7b9P0sY7sPA7G6cCyirPYUBH6wCZ4dL7TSjhTrmew 55EbGPMBULrW1jWF6W+xlrfl4yos8GiTpYzPsalbN2VaTTVbJRk67InGYH1HGlMfuW/oC cmZkVsPHXM7k6bJ5C6fXTGHjqis77DZIXHaXstrRnJ2uaONGPxTVJ6UpggVpMnjJN5BO4 za+Wf9To6kDIB3d9Nj1GNRphMzK5CIrWUpNi/eFTWuz92U9QtktKnVYNm36ZV8YOxPA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280399; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=9v6fhE64vJST/e4wIKc/qZZ4G1qcfWVja1/2g7y5JFA=; b=coAqWVa9STcAjW4hoyOJO7aWAg5nOjGLEjkS9FzWYtA4QZkO2yK+RK9oLRHdoA34KLRp i9gsjvXpvxH6rxNwLByp/PyDYh1KooQ1ojEEhktQQVNh/YC7yVaVppNyH5almZyl0sVtw p3c/ltvSA9kreZJMz5+Kg+P4Mo2yN2SD91sg/xB+LWe7BKVtJDgawGCPsKSftNLUNtF3w ijp962zKr/0786iXGZ99BeBbI3S00zmqfoIbQVZjdG2FfmgBxAT5CrCxrOSW6UKv8uox+ 7ah6dsmL+mOfCga5bAf9/iKXa6EwmdY2mz0uETHu56XdaeQIzYcA2XQgyaSI96RzwFg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=CGj0n9o2; arc=none smtp.remote-ip=209.85.210.50 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0CC2606A31C for ; Tue, 10 Nov 2026 03:13:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F0CC2606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-85a5455bd3cso861140a34.3 for ; Mon, 09 Nov 2026 19:13:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794280398; x=1794885198; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=9v6fhE64vJST/e4wIKc/qZZ4G1qcfWVja1/2g7y5JFA=; b=CGj0n9o2ZM2GUGYDO22Q0VZIZaMosOb6Ew8BYsAAc1/ZcfyPsJLlkHI3HRCtjxM736 MLBj1nCFvdrsjOUikFdVf77cjFfRum7cThukkKA+gVHOjQ8AhClahx42ubMRo9BDUmyT kvu5iRiBlcX2SiEHoYdtX0qGq3tiIpBsMHqjd0wdQWG7eM/oi2KThsXy6TwvsoyEY4Pa +rBAFBBlBi1WOm9ewJK05nBPwuBDd60z5r5lRxsaaPykBPmpaEo0RCKx4jGRBzXQxqnO rT/2zCTnZOQ1TiNIXF+8d/0bq+IvqBLfwZb+Q8KrEcDoSYIaDddJoSDJ0z2xEELVxlEf GciQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794280398; x=1794885198; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=9v6fhE64vJST/e4wIKc/qZZ4G1qcfWVja1/2g7y5JFA=; b=bpV8MtiC0ugWnsdmatOG8Pj3ZdQFx1jeCTbX67UroMnBQQ4FJdaW8qShvwt8SXwIok KXdelNt+thAtM2x01NrcE9c39/Kaaq1qCKxytStX3JbXkLfN2NY4+Qg2sxgEiuTwxblG cA2dJsEkf4fmnrRtDu37nwYpKEbj3Xl93lKojJ84xBtBaZLNjEdgTvWtIwNIeymX45ZW +6Tsqibz/NbVSAPWkaZRBLpOZ8NIjXHRGFBMVardHa+hpEj5wjNzefdUz7FXxuODdPSC y3V+iwzG/jXnlJ2VgGJXzlPhSQMoPeCB3LzAjEqKePuDZleyPicV7k6Xi4kAV9HrFHo8 iBzg== X-Forwarded-Encrypted: i=1; AL+hErEe11HKZkblS7AMNp5JaOepI+HhiJdbVByw/IU5CyE8u68gNHtv/Bsqgt6CxwAk7k0B5NIvwx8Qqz7y/w==@lists.linux.dev X-Gm-Message-State: APuU4Z/612CVZfZgiAkCjdxv+JdI7vQyXo0u1Ud0rpttnXhTebgRv1on aoXS68Nt5uTYBiK0tHhJjoXzW9B1K7ejEfDxCjB5NSxb+rWmxBrDhwiV X-Gm-Gg: AYBFou1r4LUDMdqADFVb0kyQ8hZ32OtK37lAxzeRoBHuORf18dJ8EpYlSu5ZVo+3eTW Kcvoz75IWb52+R+20VJjpbaM/QuDgZVcmcZvjOSNWFSwxqG4RFCnY5VZR7Plqyxuthzt8CtuHUD F4aEpifqWenb5wIG8pGI//PyCS87ji5bKFyAi7wE1RlRS156oV+vYdqTbOgESf4lgFZWiD57fVW I+TW2JcrbaVLwulyHVhK0S7Cjt0vVGsgmzvqCmcPrWChGxBCsp63t/5F5GLIxSK/F49p3iBQajI RM7w+onr+5cV8DASvGcUZi8e64PlFqZIjieEn4utnAByJF1NHYFaDMxOfP0I8sqvMufgzSh1JNQ DMQIyJAqDwOaK0bXhZLj8yCTxS9+DaH0kwlH0mAaCwIVWUpMMAjfWYnNNj5naOU4xZ67QyUsmfH fMbA7mq/rfaIPkhhx1U7z+VlskDiz5seAt1YdDQrD1JwaRORi0sf0QFdpC4B4AZOBoqErdD0nEM RysKXn2qh3LIJkczG/bCg0QhrZyA8eajt3aQ5L9/Rb6wqPdZ+OA6p0flYaoCVp6m5X4yNwyJ1Co OILITSjz8Q7bAnrUpeoaZc0HN1SS2pUUYc5nx0y7ZRHVnP45i9FfOutlPLg8imAVxNuRcJU8ZDh 2E0Yx7rEBZKjWZYzM3CnFRUWOLOTtKKAq2urgxV9YELesBXwfk9aqIXKG+olPciAGcBCkok6BXV v0Gr94pWNz53H4RWoZnEoHyhAKY8WZM7ske5/oyhoNJeq+HNA1TtSz+jBRGQ+2/uBIE4qBBazc1 Q== X-Received: by 2002:a05:6808:3c48:b0:568:2e:531e with SMTP id 5614622812f47-5683cdcd52amr1079208b6e.59.1794280397927; Mon, 09 Nov 2026 19:13:17 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 5614622812f47-56905736b92sm1019236b6e.8.2026.11.09.19.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 19:13:17 -0800 (PST) From: James Hilliard Date: Mon, 09 Nov 2026 20:12:54 -0700 Subject: [PATCH v9 05/11] serial: 8250: expose RX trigger controls for custom callbacks X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261109-submit-h616-uart-fifo-v1-v9-5-3f03961dae8a@gmail.com> References: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> In-Reply-To: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> To: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, James Hilliard X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.31 / 15.00]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; RCPT_COUNT_TWELVE(0.00)[16]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; FORGED_SENDER_MAILLIST(0.00)[]; TAGGED_RCPT(0.00)[dt]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.77.114.92:received,209.85.210.50:received,174.29.1.49:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]; TAGGED_FROM(0.00)[bounces-27448-noreply=patchwork.local]; FREEMAIL_FROM(0.00)[gmail.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; FREEMAIL_TO(0.00)[linux.intel.com,linuxfoundation.org,kernel.org,gmail.com,sholland.org]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: B95F01C41A4 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX The rx_trig_bytes attribute dispatches to a port's get_rxtrig and set_rxtrig callbacks when present, but the attribute group is registered only when the port type has a static receive-trigger table. Allow a port that supplies both callbacks to expose the attribute without a static table. This lets integrations such as Octeon provide their FIFO-relative thresholds through callbacks while retaining their existing port type. Require both callbacks because the attribute is read/write; ports with a static table continue to use the existing fallback handlers. Signed-off-by: James Hilliard --- drivers/tty/serial/8250/8250_port.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 73bc9e7ab703..d87e2b852c3c 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -3152,7 +3152,8 @@ static void register_dev_spec_attr_grp(struct uart_8250_port *up) { const struct serial8250_config *conf_type = &uart_config[up->port.type]; - if (conf_type->rxtrig_bytes[0]) + if (conf_type->rxtrig_bytes[0] || + (up->port.get_rxtrig && up->port.set_rxtrig)) up->port.attr_group = &serial8250_dev_attr_group; } From patchwork Tue Nov 10 03:12:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 4002 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 0ED891C41A4 for ; Tue, 10 Nov 2026 04:15:47 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27449-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27449-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id CCDC7C7026 for ; Tue, 10 Nov 2026 03:13:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794280401; b=o76gBmXN3r49zmlUErFRpdnGqHsZt7gniNP3ezxFCNzdFTAiEocv46226tl9bl5I+fC9 3pwnSCU+9HdRqRh1SMV7EqapvgRO8tALP3AGqjb7bhcJyDg5xKnCykPenAYTzk+zPZiGE xfqYfFd+Ttovp8m2jgqQSG4lUVxDGN4lLYfA9HBDR8KZGbz8ajasKid7c0wwBeJoq0HfT g4VUwe/vuLWrCXw2RTADvpICnPuGByaoPLEbQCIiJGH83Ls+0X4ex5+X8xSgQzLcSzBBY f0uHpSjKtw0VCbwfMfpy9Ivd44egHDv/+Lw7Sargm+wuShgr1v5xOp9pHO3ie7ncMOQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280401; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=3G3CWQIL0JbSsmfNksLi3Fp/1YxbYzf4T7l8kEzH84Y=; b=oLFju2jzOzmfd2bM7UZOLrrUoVWmIyWWqA//EjZTukK9CzQh8+x1Kpcnf6fnqzBx0AV/ o28vQB01pv3XMDCkxN5GBjZMHYjXo9//3VkVjc+xoynPnKNkzt/XSnP0dhnUGFQEmTCDd oViVsl/pWmJfT6ZseWczxD2lbwslM+lKowR4WHj10DK27QfpBNSswIt1qz/+HHzLOq6Uu qDA87tnxqmnGek3bLuo0N1EHw2nJLhznnS19qpNFubCDy+KJIXr4ybPg64T/PBWF1TJD7 TgF/XBPOzLhN1ZyKs5Fzj9Hwf5aikJdOwEyTULPZbQcUks47t5jlW5gPR6p/sdOlqKw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="mL6iqc/p"; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2AFF60A381E; Tue, 10 Nov 2026 03:13:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=mL6iqc/p X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.54 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794280400; b=w9FuZ0xEHP865/kj3BcSwcNux8DUzeh7CcGFwzlZB9D+La++BvVxb8l5IzfG6F9hH7u7 ThuKAahHtT7a61iRaf98LMqE2Ze2yhwOcpkIbeN4Mq84si+cg7+NpvrJ36L/XD5WcGfSb KLbfoAI85atRWzRp+VEor0vuAYJOajuDVcPgrIHSDyBYCKKxwIV9ykDfNtu4OdyASvBFd 16ElWMyUOEry7r31qsp0QEc+HmLGCYkpJLuXJCUsECNmBneGnSQrrnbfbB0slZnVStcWP WrCIl5+dx+wafW60jn278cfZfIX9VHGDt//SzwwuN9UeeovY7iw/sxX6UnnVRKK+UpA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280400; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=3G3CWQIL0JbSsmfNksLi3Fp/1YxbYzf4T7l8kEzH84Y=; b=VYYewuH0uHl030/bXQp/3NcRUz0eoIzziW/JjkQPUd3avGD8pXqMNdrDYobwfDKgVUop RyxrE79uz0xGB/lxQKDeFAFw+cweqFJx8m00EN977Hz52OA49H3hIjKslqBhyiOkQKNVT +peW/gxoP7aJ2EmnOwjxJdDLvri4VadJ10JgNd587ojQjRS0M0aTfwCV87fAQwWtL+1EA Wl9p0pr7tnjGFBR+b4NgRFGTh+Of1/FZK/yf9EECa+8h/A17e8E+L5nJan7jimYweNiHd TAKAoDll+ukBRVsO6lN0MLHKsr6js+ATpdkFYHnQOIj+/42pKrcxACUYpGas1w0E2wg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="mL6iqc/p"; arc=none smtp.remote-ip=209.85.210.54 Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72BAF60A3818 for ; Tue, 10 Nov 2026 03:13:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 72BAF60A3818 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-8241a56cd70so1004011a34.3 for ; Mon, 09 Nov 2026 19:13:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794280399; x=1794885199; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3G3CWQIL0JbSsmfNksLi3Fp/1YxbYzf4T7l8kEzH84Y=; b=mL6iqc/p2qBiWKvMYAGfFIurmGkue1Joqx/py8zt3pA7AA3hMEYVGRq0XS2duZ1OJA uW0ZJstYU/dA3VVe6uCHrIzOaKnjgY+mCPFuy8UHVbHaHaJ4whKznYDXsIfdgCZycnVi 2jt3VfUrBnkXqS94kHAQ02dBhehHA/9YJ7yKiLkKiXgUuj3xB/MLO+iavDvHK01UiV8W /UyFhKuTjs6WdeT+UxEGjVP1m2hVH6jpDqGOhxqgF4z34nuFCsmNycPEx1c0rfQUIJgZ +wm+ZqpTI/kZAJ7XMliQ69gxmSLB6efyj8r3W/3V8NFYOkWgZiHtB2Wse8a7PQjNtuIm jP2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794280399; x=1794885199; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3G3CWQIL0JbSsmfNksLi3Fp/1YxbYzf4T7l8kEzH84Y=; b=jYcqWFTWh/p1dQc/uMhjZNr02SjGHtR+VNnk2rP5iyTYdN4Uajv3cJEPOc4A+pIjge T5WW43MrKXjiEEfKf4sVoPV/Vva5iMAPW2LUI84J0DXz5kcr8umDKxsr9Nb22S9tEdKe y8h+jbA1YaDb01taBwhXGgFoGNFv1y2mSshyRNYfG8G/A72D3bDtQ0Cy07RZfmyzUXmc BGQTIFnEVUDWvbjQgVA72PBjkvHnROC9yvfr4VNKePkzolnko5vuBNuVb0S3Ul8lUFED kKAd0FkSH2FdRfApGkrzab7sIufme3pxA/dx/K6TCFV0S9j9qPrvuHssItpc1ASv8rdD awGw== X-Forwarded-Encrypted: i=1; AL+hErHM98nc35iq+Te5WFK7WugCynOgQmA82Q73uYmXakCnkljJ4hqXqAG8UDxIvVQO/dN046eVHk2sN2UtgA==@lists.linux.dev X-Gm-Message-State: APuU4Z9hf8KNcf2jDFGrgorynuTbCZlaD2FGxrDTD4vAEVgpctG/ExiD ndJPSsZk6CySyFPgo+fKuJLmORPF9Nd2it6Q0lxzziTOXdlIUgMSNksO X-Gm-Gg: AYBFou1VZ6SIVXXB5eno6qO6BbxHQ+qauYrwQJTDranFzDZz7JtXP+uHjdZp9SFSLZi 5cWfPPeTwYV+xBa5QB/wfZCvzK9ojUVOyfXOveRNtXpUtrTx7ZQdSEPeedl3qDy4NuxNJxw47V3 41i/hoYMbRQBKy/aubk5KnAHxwHNV1+qlb7/dfq3zsAoGVkatXTpPXzf3Eshutf8J7vRCsjcnhQ Oio5eVqFxoZP/uGEgC8Gw2T0Qf16xn1ARX3EsmSH6immugPyR5AwlyDIbQib3wCMR8wVa8cTcQj nDkR1KL+lSX3QIAWJ2iE4u2fr7FZNH0d5cbS/2f5DdKoGBPHuTPeHp0NHLkmsxmbnEyvXoY1iqs txM+ppj++OIpcmcY3ZbLMu6vpGrtGSpfW/4V908DUEktWKM9fQSfC//MJMECvkKZuoN7sSYwUXY ZS6LCZpCC7Qp3yWU/a03zKOVUiZMaDh30Fvq6FL8FnZBeHdcsQX+HBMcqAJ0FEyLIWDYOGK/nFd Y281oe7Eliw6BiOd5JwLx+3PqQqV7f3IVvSFhR30rO7LjkpkNO7xKMQLxFvmiFKRr9MWivKQIWs RUsHE6YK09T2PmuplINytoqbrm+keaUQF3JuQ6gyf9fJi7dRAUgMdlRm8j9JIZqN+UFT3VSUWeR sqS1Qc5Betzf4SF+ZnfhpmGJExRpB2cj28EWWk9zJmGhTotYTGcfVjz+eHFLJ2lZSYVQAbiyG1B DPPyh4w7ozI5jwQ+E5dXsvsQPnVctblWUgj4tm2WVoU8DaVEkDqoyW X-Received: by 2002:a05:6808:c22c:b0:568:e61:dd02 with SMTP id 5614622812f47-5683cccaabcmr1071675b6e.43.1794280399379; Mon, 09 Nov 2026 19:13:19 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 5614622812f47-56905736b92sm1019236b6e.8.2026.11.09.19.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 19:13:19 -0800 (PST) From: James Hilliard Date: Mon, 09 Nov 2026 20:12:55 -0700 Subject: [PATCH v9 06/11] serial: 8250_dw: derive RX trigger thresholds from the FIFO depth X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261109-submit-h616-uart-fifo-v1-v9-6-3f03961dae8a@gmail.com> References: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> In-Reply-To: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> To: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, James Hilliard X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-1.19 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_FIVE(0.00)[6]; FORGED_SENDER_MAILLIST(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[dt]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; RCPT_COUNT_TWELVE(0.00)[16]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.77.114.92:received,174.29.1.49:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]; TAGGED_FROM(0.00)[bounces-27449-noreply=patchwork.local]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; FREEMAIL_TO(0.00)[linux.intel.com,linuxfoundation.org,kernel.org,gmail.com,sholland.org]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 0ED891C41A4 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX DW_apb_uart uses receive thresholds of one byte, one quarter full, one half full and two bytes below full. The generic 16550A table describes these encodings only for a 16-byte FIFO. For example, the half-full setting on a 64-byte DW FIFO is reported as eight bytes instead of 32, and a sysfs request for 32 bytes selects the 62-byte encoding. Build a per-port threshold table from the discovered FIFO depth in dwlib and install receive-trigger callbacks for CPR-described FIFOs, including LPSS ports. Keep the setup helper available to integrations which obtain the depth without probing the optional DW registers. Validate that each threshold is positive and representable before constructing the table. Serialize FCR updates with termios and the port lock, acquire a runtime PM reference before accessing the device, and propagate resume errors without changing the shadow or hardware. Update only the trigger field so changing the threshold preserves the FIFO contents. The FCR mapping is documented in the DW_apb_uart databook, section 6, FIFO Control Register. The existing default FCR encoding is unchanged. Signed-off-by: James Hilliard --- drivers/tty/serial/8250/8250_dwlib.c | 87 ++++++++++++++++++++++++++++++++++++ drivers/tty/serial/8250/8250_dwlib.h | 2 + 2 files changed, 89 insertions(+) diff --git a/drivers/tty/serial/8250/8250_dwlib.c b/drivers/tty/serial/8250/8250_dwlib.c index 4a06dec6e263..6cfb7674ac11 100644 --- a/drivers/tty/serial/8250/8250_dwlib.c +++ b/drivers/tty/serial/8250/8250_dwlib.c @@ -1,18 +1,27 @@ // SPDX-License-Identifier: GPL-2.0+ /* Synopsys DesignWare 8250 library. */ +#include #include #include #include #include #include +#include #include +#include +#include #include #include #include #include "8250_dwlib.h" +/* DesignWare FIFO-relative receive thresholds */ +#define DW_UART_RXTRIG_QUARTER_DIV 4 +#define DW_UART_RXTRIG_HALF_DIV 2 +#define DW_UART_RXTRIG_FULL_MARGIN 2 + /* * divisor = div(I) + div(F) * "I" means integer, "F" means fractional @@ -208,11 +217,85 @@ static const struct serial_rs485 dw8250_rs485_supported = { SER_RS485_ADDR_DEST, }; +/* The trigger is the masked FCR receive trigger field, in register position */ +static unsigned int dw8250_rxtrig_bytes(struct uart_port *p, unsigned int trigger) +{ + switch (trigger) { + case UART_FCR_TRIGGER_1: + return 1; + case UART_FCR_TRIGGER_4: + return p->fifosize / DW_UART_RXTRIG_QUARTER_DIV; + case UART_FCR_TRIGGER_8: + return p->fifosize / DW_UART_RXTRIG_HALF_DIV; + default: + return p->fifosize - DW_UART_RXTRIG_FULL_MARGIN; + } +} + +static int dw8250_get_rxtrig(struct uart_port *p) +{ + struct dw8250_port_data *pd = p->private_data; + struct uart_8250_port *up = up_to_u8250p(p); + + guard(uart_port_lock_irqsave)(p); + + return pd->rxtrig_bytes[UART_FCR_R_TRIG_BITS(up->fcr)]; +} + +static int dw8250_set_rxtrig(struct uart_port *p, u16 bytes) +{ + struct dw8250_port_data *pd = p->private_data; + struct uart_8250_port *up = up_to_u8250p(p); + int fcr, ret; + + fcr = serial8250_bytes_to_fcr(pd->rxtrig_bytes, bytes); + if (fcr < 0) + return fcr; + + guard(mutex)(&p->state->port.mutex); + + PM_RUNTIME_ACQUIRE_IF_ENABLED(p->dev, pm); + ret = PM_RUNTIME_ACQUIRE_ERR(&pm); + if (ret) + return ret; + + guard(uart_port_lock_irqsave)(p); + + FIELD_MODIFY(UART_FCR_TRIGGER_MASK, &up->fcr, UART_FCR_R_TRIG_BITS(fcr)); + /* Changing the trigger alone preserves the FIFO contents */ + serial_port_out(p, UART_FCR, up->fcr); + + return 0; +} + +int dw8250_setup_rxtrig(struct uart_port *p) +{ + struct dw8250_port_data *pd = p->private_data; + + /* Each FIFO-relative threshold must be positive and fit in the table */ + if (p->fifosize < DW_UART_RXTRIG_QUARTER_DIV || + p->fifosize - DW_UART_RXTRIG_FULL_MARGIN > U16_MAX) + return dev_err_probe(p->dev, -EINVAL, + "invalid FIFO size %u\n", p->fifosize); + + for (unsigned int i = 0; i < ARRAY_SIZE(pd->rxtrig_bytes); i++) { + unsigned int trigger = FIELD_PREP(UART_FCR_TRIGGER_MASK, i); + + pd->rxtrig_bytes[i] = dw8250_rxtrig_bytes(p, trigger); + } + p->get_rxtrig = dw8250_get_rxtrig; + p->set_rxtrig = dw8250_set_rxtrig; + + return 0; +} +EXPORT_SYMBOL_NS_GPL(dw8250_setup_rxtrig, "SERIAL_8250"); + int dw8250_setup_port(struct uart_port *p) { struct dw8250_port_data *pd = p->private_data; struct uart_8250_port *up = up_to_u8250p(p); u32 reg, old_dlf; + int ret; pd->hw_rs485_support = dw8250_detect_rs485_hw(p); if (pd->hw_rs485_support) { @@ -258,6 +341,10 @@ int dw8250_setup_port(struct uart_port *p) p->flags |= UPF_FIXED_TYPE; p->fifosize = DW_UART_CPR_FIFO_SIZE(reg); up->capabilities = UART_CAP_FIFO | UART_CAP_NOTEMT; + + ret = dw8250_setup_rxtrig(p); + if (ret) + return ret; } if (reg & DW_UART_CPR_AFCE_MODE) diff --git a/drivers/tty/serial/8250/8250_dwlib.h b/drivers/tty/serial/8250/8250_dwlib.h index 4d32651956ab..b896dd9bebb7 100644 --- a/drivers/tty/serial/8250/8250_dwlib.h +++ b/drivers/tty/serial/8250/8250_dwlib.h @@ -86,6 +86,7 @@ struct dw8250_port_data { struct uart_8250_dma dma; /* Hardware configuration */ + u16 rxtrig_bytes[UART_FCR_R_TRIG_MAX_STATE]; u32 cpr_value; u8 dlf_size; @@ -100,6 +101,7 @@ struct dw8250_port_data { unsigned int dw8250_get_divisor_dlf(struct uart_port *p, unsigned int baud, unsigned int *frac); void dw8250_set_divisor_dlf(struct uart_port *p, unsigned int quot_frac); void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios, const struct ktermios *old); +int dw8250_setup_rxtrig(struct uart_port *p); int dw8250_setup_port(struct uart_port *p); static inline u32 dw8250_readl_ext(struct uart_port *p, int offset) From patchwork Tue Nov 10 03:12:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 4003 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 9F9251C760F for ; Tue, 10 Nov 2026 04:16:26 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27450-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27450-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 82DE2C83B6 for ; Tue, 10 Nov 2026 03:13:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794280402; b=q5o574vzEpd1ne81wfbau+1QXDIQMT7jN3PHq8F10hW3VzxrK+OEFvW06ZYL+NERaZ57 Mw6kd0f9bXH4M6oZPZEwx6Q6orQqFno1QrtU5ki0HmiPK56wMbBBfmwYT37jcNHycR4zi +VFwvmNLkOyjBThLvn39DPebTINRlC5MBwK8gCSI68BBK7715jKZRRCjyndLtKWncApuQ IKXI4GFYaak/xMWdSZAkhCuHT/6xpoFkoXYuut4mY36ecp/pmOVOUjpr0N3WaAlqKB9Jf VNdHu/hqgw7viRMo6LN4APnpcy9Hyx4eHOqte6oWCwZvkhC86ydMLxnx7IRKg9WSd9w== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280402; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=HRoIIA2wpujQ0+Dd3LKXeU40GCpk4ukouOoolwO0ux0=; b=gShAp9Wo8kgjJ84x6/+hHd/IXLGvSf6VpNOi2wWZbDD39cErax6TU95svKshD7NaIKFB pUaYb86AslCufblc1DSGcT3xR9sQXt1Z8h2oHiE/yIUTLN70DtLeWHYIRTAs1UEvQieIt 7D59plvM1jLDHYfwQk5ebKy/q6CfYXiOCXvUBXjITNtPyGzC7v2NiTqyUugOkB9qJXFLW qnFviqJkiKDaeN8US0EL7HVXqCYAXOf9aZgAEXCSdggu2F6IknkwisHRmGyFN/7FunFa7 2JQFbn7RDyPbNCdo/hbSbwb4qFkVbFBeLTsaK/QzpK5Fpkh2u01u7EbuurouEVOJD7w== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=JeqaFdp9; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 457DF60A3839; Tue, 10 Nov 2026 03:13:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=JeqaFdp9 X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794280402; b=O4Zbj3GElkIH96CQPm+LXmkhhtqmkkyTwUOHmNq1ObKUwgte2BZHJ6Eg8GWCt7gKHeaX OWeKF5t6M5UemrSyiA+LQ/2VY68JVX48AmF40LQlusH3SX/ycqpDAV85SBKlU8Vlyn/e4 JVZYkJ+FBSSz8pLBg6ugJW7iVmujtXETjDbLAkUWkcKPWDhslV2YNuaRSYSg1YNZYkok1 1pMJfgYAm8g3lSLEu5afn63cPc0kN6lBqyDKboOGLAF2atdH2RX01jn/qafeWxCaIEs85 SYcCHHF6hy+z3xWcTjaTp0BI0Lb35UIcVr1LSicFEaBp9Mply6Q6QhwAiX+iPvaYkKg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280402; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=HRoIIA2wpujQ0+Dd3LKXeU40GCpk4ukouOoolwO0ux0=; b=Qz66OhOAR5mWFuu9nVD0W9rAL3rTQ73Tg1mGu3Ckv1JvzDKLDliiKMYOtM5ebvKynOo/ YGT2m6csDjVMmUMB6qGUrm8/224BTphgmR265kNoHAl9K7BFbaGwzhT8kqYtYEU222XVw xMop5M2GIxsQlyFTrt5S9yjCgXTMeM+edrEFjamQojSSaRizYqY2rWs6gyNRiu9esnMRS ryXHsQHmcw9XLqtasECyd9jUSW9B8k0oZ1idvZKIPFGn4IiNLY8gparpVkY2OaGcS2Trn JsnX8JetxXpVCtCCIPD5D0h65/MTwA9JR3S00py8Izvl8WfWI1tqr5L/yeyULFCVd+w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=JeqaFdp9; arc=none smtp.remote-ip=209.85.167.172 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D070660A382F for ; Tue, 10 Nov 2026 03:13:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D070660A382F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-4f14642adb4so872223b6e.1 for ; Mon, 09 Nov 2026 19:13:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794280401; x=1794885201; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=HRoIIA2wpujQ0+Dd3LKXeU40GCpk4ukouOoolwO0ux0=; b=JeqaFdp9PchGav9n0BtI2/5BQSQ/H15AITyqDiM7NDgSpkmX75p8gBUNV6q9SX/GnC wEMVALgoqzas5eD4r1Sy5kHy3wT5GPfnoE6pt0r3JFaOLkaYuWKQUIilyuwrHYr/stlW d3Uek2hkA4UhOr2r9aHJiknJDlFqjDdnpsAv2cld8LBJJTfqNM1TFddTbJq3NStO/WHJ E5mxb+n3cn+8s1TZSe4xSyWCUpdj02mvWdlAg5AsVK0P80KAU/Hy8UAOLYQmvDDXXrol x6/VqW3tDlK4vLNTtMcF/kG1YBWRuhcCOJfm05ozX0FYcjgwaOEaerYV6ERJtpRQDg7y JaWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794280401; x=1794885201; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=HRoIIA2wpujQ0+Dd3LKXeU40GCpk4ukouOoolwO0ux0=; b=b85zT5HSFr2Hh8va0E5wCinx9eGCNChBikM4Z1CI/PoTorVoESvqglIGopxbHzmKuz K8RCPJnGVYRRjpTN/a8Om0O0oEu0LuaSB+8KKExgmQBEmWTh9ARYmsfwDUjl4iBmkTUj LS0ysHx+e/Gu65wgJE6bjcNFJAM5Qf4pyLr3tN3i4xrKdBCTOO0Ve82rb+rK7hjjIyjC 1dH8a1IOq+sJre/il/cOUXSkQkDh9q+F+CMKJxLfKEtXIeWlRP5/9PDqHfbpfXUpuWf+ bgNkCHyQzgIhmjE2i57vruihOVyAA/U5YHuql9Aij8uOjpmB4/WOObjftVQiYcthrzbd gfGQ== X-Forwarded-Encrypted: i=1; AL+hErELocUxn8qB7fgZGJufG/ujnMXPaZntX3IqJ+iWxSLxkZmhdQdus/WGps8sCrzHoZbIAOs2Oq11PwrXtg==@lists.linux.dev X-Gm-Message-State: APuU4Z+oudBj7pxNIgSHjskGOtMLNpaWO2ci48q8yU0QtOTTC5Y4Ngqx DYiL2wQtA5yinQuPhkTrDvzqtny3OuJprIlsmrUbaWLcyT/Lxy5DRDhs X-Gm-Gg: AYBFou2Re/LqhM6CqzS+amsKdMIfTQN6ncpMg78aXvY4ZvqgFzKhW7KzTRZ2Zk5UyCV mScz6mZThsXRqeb72f15Z4EX+p+Yjb0/tQMPJ5NE5/xuYrzpnGNVAqsqShUvpdZD9CPDFgM/3fr YcsPFSeT10KtfrBQ/eD28C4m/FP4Ju/c1DQeTt3nDYflD4jkUZUqJhMLP1DJqs+B49OIRwM6ODu admI1FiBSOq1zd9xPmh0LtbRctS8bdmjy4wFpm/eOkBA346/qhFDoHKZssOdJZTz1SzjpohxjEV 4+RtCh82odIB4vG9XQzR31TVyiKcb0JkL0whjqOw8LVQRh7sU2f4VnawX1Wc+Dj8Wy8ORFKO1Su qStmH4wMOCB9r/t2/Pu4zYpLqdOxbmJLTgaU7Wqfg168KiZ+T+y3GOQssCe4a27ruXIdnjky5eA P6A0xpbO317EIi8G3o4+IQI6ATyWRCrOcuweGOysmZASK4PslgwjqsqnG0+dVcGpZbvWZptLsNq 5vlouRdlGXJjianBCNYzqu0s0FLGRGTeAycQSWtFMdo2InEvDjwENo6+kbM0DKrij5ZdLQwZXHF fdfY6+M8GKOFwlLzMp+lzWca9P0qVG16fAgqiNyU4AnGP/3gKET81x8ydkSA4H9Nil4H4xDgHuP LvPmG2vDExdwzApyvtnKM4fa6g4yBgL8LUH5Tq6c0613SCDVHivszP+ZO5BWGloX8tjFaLFLPat iotc3q2l5JwmUnXb78oPgDmtWX8oSStuTyeCEA4lttwMTP/Ba6FVcU X-Received: by 2002:a05:6808:1303:b0:55c:836:5955 with SMTP id 5614622812f47-5683ca2f716mr1299570b6e.44.1794280400815; Mon, 09 Nov 2026 19:13:20 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 5614622812f47-56905736b92sm1019236b6e.8.2026.11.09.19.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 19:13:20 -0800 (PST) From: James Hilliard Date: Mon, 09 Nov 2026 20:12:56 -0700 Subject: [PATCH v9 07/11] dt-bindings: serial: snps-dw-apb-uart: add Allwinner H616 X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261109-submit-h616-uart-fifo-v1-v9-7-3f03961dae8a@gmail.com> References: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> In-Reply-To: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> To: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, James Hilliard , Krzysztof Kozlowski X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.31 / 15.00]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com,oss.qualcomm.com]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; RCPT_COUNT_TWELVE(0.00)[17]; FROM_HAS_DN(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[]; TAGGED_RCPT(0.00)[dt]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; TAGGED_FROM(0.00)[bounces-27450-noreply=patchwork.local]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[209.85.167.172:received,100.77.114.92:received,174.29.1.49:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]; MID_RHS_MATCH_FROM(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; FREEMAIL_TO(0.00)[linux.intel.com,linuxfoundation.org,kernel.org,gmail.com,sholland.org]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 9F9251C760F X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX The H616 UART has 256-byte transmit and receive FIFOs, but its DesignWare component parameter register does not report the FIFO depth. Its optional register layout also differs from the generic DesignWare integration. Add a specific compatible to identify this fixed configuration, retaining snps,dw-apb-uart as a fallback. Signed-off-by: James Hilliard Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml b/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml index e2ca126d58ba..fc1289073241 100644 --- a/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml +++ b/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml @@ -60,6 +60,7 @@ properties: - const: renesas,rzn1-uart - items: - enum: + - allwinner,sun50i-h616-uart - anlogic,dr1v90-uart - brcm,bcm11351-dw-apb-uart - brcm,bcm21664-dw-apb-uart From patchwork Tue Nov 10 03:12:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 4004 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 8D7251C767A for ; Tue, 10 Nov 2026 04:16:56 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27451-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27451-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 82743E0C3F for ; Tue, 10 Nov 2026 03:13:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794280403; b=uTAgb21w2BahiFYNkaJrEcfC7nNliCV6u2rpWm/HyHTu22AlohVBa4EqVY/rFCZxq7j8 JoV4fJWwU9lWCaSCCZ8YrUrooNtLaplyVIWLe+h/MCo20SgCrLn8qzipdoDxzzPHfOfby O/9qTF61zgAFI+Ag7SxUuwIdHS/BoaD2ALV2ViPt0DP7fa9ivL3K2Ncrgy2Wp5GR8nFRN TUZFdIM9zxFRoirzsBQEW3covaaCiYxBu1NCivzLL3c9CuSYRCAmzhJlsDVU+rU8NzuIr bDTIUJBhNEI8MqE9zcIogQYi9mCHY7QEIRaOdJ8hj1Yuyd+CotU/rKFI1mhMnZLjcWA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280403; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=mY44dbM5nzrkV+ospj+zR69jcUle+qy1oJf0Y3qvlKo=; b=TkLWAnLbZaJ2QA0FR5SuK2xOma13iy3yCVpPWIfbwvmQ/FRB/qfzNfOOZJhJ1NodKnC/ nJn5V1BQoAWKmNgDIh42mlWQXborAEgilIooKYiVCXvz0He0ezDu2T//A5KVq+KtZtks1 EngC0/loF345JAs/ZxKuOT2IqPG391YlXUD6ceJ1EbH7gEMSRFEQGgIi3/fli0ALkCBgM gIrBhBJinsULeIRk41Bqfo9IUVYrLSX1+JkM62QfKxA9dgnEzcp+cyXf3tLUwu0IZsEvx wn2FLzFJJjh0bKUr61uE8mnlMEhsXZqBoS1BpwNf9/CMQoFy/RQIfz5dAqDcnbAo0SA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=X2sgRd42; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90F5260A5BCB; Tue, 10 Nov 2026 03:13:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=X2sgRd42 X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.161.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794280403; b=dlLdQ3lKgRkgXxeIgkImIB3FtUoUXKFtEOPgQqR51bIxKuLzhnIVODgaTYZBVZepC2gD 5CF0zxNFza9Pb2wNr2vg9Y8bVNK9c52IpVRF0dKDLA/ueIP82t4FskkZXjr60os8NtYU0 Q6QLXh0AWds4jd0X1H+/+gKga21Z3pYqjyNbJWYHZ0sdWVuxqk22cF3lk00iuQA5cspGV TSEKTsZ1Y8POFvqxoSjCB6FllRGtZMq6rXSeTGJ8xmuvB9WP+7MIOMnSxS1HuqCRhH0Sh QEv2B7yB1Ng8YXUpW7TJDOmwO75s17lchAuX36iSAFR2yukpCRt323wtodlra9zQq8w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280403; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=mY44dbM5nzrkV+ospj+zR69jcUle+qy1oJf0Y3qvlKo=; b=qD6LM9aYAWqzsRyVPgsG6RHHkl+4M/V9zoAXfzHRHhZHH623jaJ1hMUguSubu+bx4T8b jDmzGQSaLgJA96LRy8HokS/YMUliC1nyuSkQ680dHZs0ieXFiOBd/PbOsBbdn20fHIAyn xgqp1egng8t6OjCHgafG5xyhAQN2xPLJwt7cLWHryl/+vwSbnkzQhMZLe1RcnzMvtyKCR NaEDBth1I2uUUR4PORp1Nza1wsxMMjKuyEgAQNOyvKvj5mqHf9rL7i5og7RceUeudY7h7 7nO5ox5DPRyKCKpOu3NCqOoZuUjizRtnmiZGsnrXkL2ezWiR4no7qMrYDdvZSHTIb5g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=X2sgRd42; arc=none smtp.remote-ip=209.85.161.48 Received: from mail-oo1-f48.google.com (mail-oo1-f48.google.com [209.85.161.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2377360A5BC5 for ; Tue, 10 Nov 2026 03:13:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2377360A5BC5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f48.google.com with SMTP id 006d021491bc7-70059e4dab6so858824eaf.3 for ; Mon, 09 Nov 2026 19:13:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794280402; x=1794885202; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=mY44dbM5nzrkV+ospj+zR69jcUle+qy1oJf0Y3qvlKo=; b=X2sgRd42vMmNNN0KphVxDWizWhQkmI/0BdCYHrkjtYR9wWErx8xvyjOtwvTCF4Q8sw aSyGLynbNdz+7eu2zzOpIjm0P0nsIal+kFeMa4MPmx/haDaAaVgAnBAr5NM19kR29hCi vT0AxYhHhosIz0116KywK/xVdFIsuPbUmjeUuDuhK+RSX35x+28IjCnxzF6i+c1dPF1k 3shQEy6ZbzxiLMrmT0bDV/0JIfAwu55eKkfzlqLEmEC35zGabftxrt6XQVOPqf6UG9Xj 1dJcSfaVm0YFD7QX5/Wr64xnu1FWFlpu7jH1dmtBgVEdXmi4zJppIUG618pOPNnURbAV xK0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794280402; x=1794885202; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mY44dbM5nzrkV+ospj+zR69jcUle+qy1oJf0Y3qvlKo=; b=p4Waie/CF4+7sHX7Vhj7M3G36sycoa3VqU5xFlgxIEYc/hh2zkc+gjZbIWjBTtij/B AiAZIBh/yIL+PXS1ONhzwx8wqgznj6+W+R7u10vU3smHVLnt1fhwg3NJ61oURUjXjqX/ w1cBn/QMaeSyZviMb7sQpmSwPIFsqj9VVKjZy5Em0l+RiJJu5EzTX34Y4oHe0aerJJZy QaHiPJYIK4RmpC7dUHgJUUXsTAoxHp/jDdrfsZDTszfWCmpy3HPgSa7xn7PkZbu2pnzE UAVyXavGO+uOjDd2bQOcE1J//C7HxaN27FgiXc7DxjUorlxe47erZNG0br9g3CKhDmaP CmFg== X-Forwarded-Encrypted: i=1; AL+hErEVSOqD+XV4jN1OtEBbYE07VS/xBWxGNvOIsYBmk6GNZSah7hgAA2bOyqZN8CRGTe1zRG4jYb4QLIYkQA==@lists.linux.dev X-Gm-Message-State: APuU4Z+VS4PLizpBgsB+RLcnb/YTKNTCXQ54ciPJNeVjKl3plvBEENGn cY+ZcSnw8qD2gyAoO/Zb8GLVKutyx3D4kLmNDmonXdF8DhVbs/UqjqsR X-Gm-Gg: AYBFou0rcAsDyFD6PZPoNKHGn+Lh+id9wVdwqqZ/EBcfAEWFcQyr0s9Bm7KybkxytYy KbCsxV02k8GM2/BfpmRwBV7tOF+zyCgyve1ZXauBkjUfpdEU9kAS/3SDZNrGqFWXdMA8xegOc9d E+hvcjink8pa1t+5xPQzx4NbMdG4aT4y1NvBIpdKHRHKBGkWSMUDG1XfY7Z7fXF4+lTZ3GeQL9m pJHqSkV9EpcUQnj/oUziee/dnNr9V0Po6FfqjLah9esedjTqdkiAcB5/0k0Vfz33HHq2c/fd/qf Jr5Jz84BUlEHvoRR28JNe6suzTpEpPw0LVxAola/0FZ6cU21pMljWiB/0MdeeyUgqXexurYhQTG aEbDBtQl3bE41c39TWLlyWcv1Ew+eG5BSi77lsFgzjVLTv71GxhUQdXasipRJods9HT1pkgcVw5 SvX/vDx1v07qw1+7MxZXkWZtiq4ZHMfcJClbxNGQVT+h5EvcDzAyq0kpshwY11U+rn70SojwVhj A4KdQHs7jDYfmcqA2MVCfQzoG60CQVG5YyTCattwCp2+JAIwmZ8r21nfnOfBGxN9msUvIoL4sTt cMTe16xiiZnfyIs9pjXVY5Ao4bHco/GifgVSpR0p9IkD/bHtiOPrT+Rp4Kkk5JrONmmhc9pFPJD 44kPhXI5jBcxkF78UCoKkiABKf57l1OmtRHM8DSN3T2uwEfGA22uIR5DcRLFfaSspUPIIIrZ9Ls ktthftPj39eLwBUIB9Y5+5MmCVM2sOLV45DPbJ8qpFcdRP5/JRieGuwkdbdHfMNHrOD5ldMwsuG g== X-Received: by 2002:a05:6808:1713:b0:510:7dc8:5ff7 with SMTP id 5614622812f47-5683c945eb5mr1088933b6e.19.1794280402120; Mon, 09 Nov 2026 19:13:22 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 5614622812f47-56905736b92sm1019236b6e.8.2026.11.09.19.13.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 19:13:21 -0800 (PST) From: James Hilliard Date: Mon, 09 Nov 2026 20:12:57 -0700 Subject: [PATCH v9 08/11] serial: 8250_dw: configure the Allwinner H616 UART X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261109-submit-h616-uart-fifo-v1-v9-8-3f03961dae8a@gmail.com> References: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> In-Reply-To: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> To: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, James Hilliard X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-1.19 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FORGED_SENDER_MAILLIST(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; TAGGED_RCPT(0.00)[dt]; RCVD_COUNT_FIVE(0.00)[6]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; RCPT_COUNT_TWELVE(0.00)[16]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; TAGGED_FROM(0.00)[bounces-27451-noreply=patchwork.local]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.77.114.92:received,174.29.1.49:received,209.85.161.48:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; FREEMAIL_FROM(0.00)[gmail.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FREEMAIL_TO(0.00)[linux.intel.com,linuxfoundation.org,kernel.org,gmail.com,sholland.org]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 8D7251C767A X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX H616 has 256-byte transmit and receive FIFOs, but its optional DesignWare component parameter register reads as zero. Generic 16550 probing leaves the port using the 16-byte FIFO configuration and its trigger-level table. Keep PORT_16550A and supply the fixed FIFO depth through platform data. The 8250 core derives the transmit load from that depth. Use the shared DesignWare receive-trigger setup to describe the 1, 64, 128 and 254-byte thresholds, with the normal half-full FCR setting selecting 128 bytes. Advertise automatic flow control so CRTSCTS enables MCR.AFCE, matching the DesignWare termios path for hardware CTS handling. Select this configuration through the platform setup callback. H616 has debug-divisor and RS485 control registers overlapping the optional DesignWare feature probes. Use the fixed configuration with BUSY-safe integer divisor programming and software RS485 handling. Keep the UART clock enabled during termios changes with SKIP_SET_RATE. Its clock is a gate on the shared APB2 source rather than an independent baud-rate generator. Signed-off-by: James Hilliard Reviewed-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_dw.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 613907b8a40f..a55f60330a51 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -63,6 +63,7 @@ struct dw8250_platform_data { u8 usr_reg; u32 cpr_value; + unsigned int fifo_size; unsigned int quirks; int (*setup)(struct uart_port *p); }; @@ -657,6 +658,31 @@ static int dw8250_setup(struct uart_port *p) return dw8250_setup_dma(p); } +static int dw8250_sunxi_setup(struct uart_port *p) +{ + struct dw8250_data *data = to_dw8250_data(p->private_data); + struct uart_8250_port *up = up_to_u8250p(p); + int ret; + + p->type = PORT_16550A; + p->flags |= UPF_FIXED_TYPE; + p->fifosize = data->pdata->fifo_size; + + up->capabilities = UART_CAP_FIFO | UART_CAP_NOTEMT | UART_CAP_AFE; + + ret = dw8250_setup_rxtrig(p); + if (ret) + return ret; + + /* Use software RS485 with the Allwinner register layout */ + p->rs485_config = serial8250_em485_config; + p->rs485_supported = serial8250_em485_supported; + up->rs485_start_tx = serial8250_em485_start_tx; + up->rs485_stop_tx = serial8250_em485_stop_tx; + + return 0; +} + static int dw8250_probe(struct platform_device *pdev) { struct uart_8250_port uart = {}, *up = &uart; @@ -880,6 +906,13 @@ static const struct dw8250_platform_data dw8250_dw_apb = { .usr_reg = DW_UART_USR, }; +static const struct dw8250_platform_data dw8250_h616_data = { + .usr_reg = DW_UART_USR, + .fifo_size = 256, + .quirks = DW_UART_QUIRK_SKIP_SET_RATE, + .setup = dw8250_sunxi_setup, +}; + static const struct dw8250_platform_data dw8250_octeon_3860_data = { .usr_reg = OCTEON_UART_USR, .quirks = DW_UART_QUIRK_OCTEON, @@ -931,6 +964,7 @@ static const struct dw8250_platform_data dw8250_tda54 = { static const struct of_device_id dw8250_of_match[] = { { .compatible = "snps,dw-apb-uart", .data = &dw8250_dw_apb }, + { .compatible = "allwinner,sun50i-h616-uart", .data = &dw8250_h616_data }, { .compatible = "cavium,octeon-3860-uart", .data = &dw8250_octeon_3860_data }, { .compatible = "marvell,armada-38x-uart", .data = &dw8250_armada_38x_data }, { .compatible = "renesas,rzn1-uart", .data = &dw8250_renesas_rzn1_data }, From patchwork Tue Nov 10 03:12:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 4005 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 4623F1C760F for ; Tue, 10 Nov 2026 04:17:31 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27452-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27452-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id EA185A4898 for ; Tue, 10 Nov 2026 03:13:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794280405; b=FGWFIdW/jfTSPzRoAz/okb5yN9bGqe46O5DOM9D2/723lFoiUYoLErk6JqZ0ogq2A5Dq E/kWI9Fy4DgO46VUR364IMTt+IvLzn7Mt7mTRNhm9+ZdUc7WCGaMSc0SDgUik4KxRQnSa MpLVNhVlFudDQKbcAZlA2wk2/PlLAIXo85kqdPJqx5ISUKZ/B9EzLfx3KUlVRP5VMq/ZC SLL+46JPC1p6rxwbi8MjGVXwlSMEm9f75TBIALPkOkKO4AagvYFs4v0Fz9hyh6pTv/PVU 0/weM50Zr9wNI+Bck6i6A1sm0Gs21BwKM0a7DWD8ZUs9GeCLpgpG7AnAN6h/0fjKA6Q== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280405; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=ZsGYkHSaF8D1INVVG7IqcJD0MRHplG6cSUzvau3umEk=; b=FpQEaEP81zCs6r0sWjuwkcmKtEhRTK0+Z72pCvVOP+u+O8w4utm7v4d0P3zcNmRS/TJr N0GwNZYaindfz8bQJ6ANlqi4wcPsnf3n7sE/HRO+ztoAT34QwJuhM67+bsQoPRNoQhYsl cqRcu/N2whFb1id8kYsu8MvqYtVkCXLBNsHsWgsLi/DakgQn7D9V5azo1/KtuSE4T23e9 1v5f9d7w4oWq7ZA5yc86h40sg5GxoNm5x6lv3f1YSSfgMSyJu46iDTCNcI59x+KKSMo4T JeTg7aiJio9WKB03M0PcvINXgVjgC6+QviicBh7gTx7J5Xj92np9vtkqFN9xNWOQF2A== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=yOidOEmW; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF35760A5BEA; Tue, 10 Nov 2026 03:13:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=yOidOEmW X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.176 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794280405; b=TAusfMiFskfjyJf/DKgMYgcFBYa9SQw7QiMNzz4Bu02rVRgWLc0uo23e5zmq72ai5WSo VX/vd9NFu23L/hjRZWm1+XVYD797lyIgvbpmSQlJt/sE/vFmYKzkiV5vBCJt/FzE0ZPjL LPJMopJRy07YV7uF9TQx0s9BJtW58/6jUkII1HIzDs22j+7UEErhtfnuH8AXCRuNz/m2l fiX6lrYWUnGvD7bm645hj860jaFxuaObikEfjp3AqozpylgmNoaWor5AdDbGMFt9zcN2f F3cqBfEe3kYP0Gte9iRcyMJooHTCChJHp7pSwQofuW70hCmYzo23sx6jydBa460/TpA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280405; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=ZsGYkHSaF8D1INVVG7IqcJD0MRHplG6cSUzvau3umEk=; b=y6uNNlU2B2vgG2FFaXU41X6M//iLbEGuzSb6iTbNcvwN+NKMPkxoOfFMd+wZxlQ3SyVi 0ujWyQgyW0232vrfXdbfIepDHgBDH0Gu0dfE4KIQjUlA1tiHWf0DGEGjMPncL1GsJPQDr n9VeEQWmX7omGD7Pv2K2fPvawczLy/1R9V/yQ9h6fNXYzSFyvoGE6LizpL2gzdP2Cj1bj DnH9JweBYa2u+PAObmNgItqmlh39Wmvf8f/+nze+QVaXqzFd6hD4O9fs7Tcw9NprvSgZU q+woHSoiEO77AxdnXYOSHiVeBH5Z6u4tFhtU7o8NrWFHd3NF3Id0X/9FR1m88yDpBRA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=yOidOEmW; arc=none smtp.remote-ip=209.85.167.176 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C222960A5BD4 for ; Tue, 10 Nov 2026 03:13:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C222960A5BD4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-5326cdde017so479992b6e.2 for ; Mon, 09 Nov 2026 19:13:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794280404; x=1794885204; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ZsGYkHSaF8D1INVVG7IqcJD0MRHplG6cSUzvau3umEk=; b=yOidOEmWNuXXJl54/ACA4erFzRCFlftOqX6qlq4LsM9AV63UHDlfvwD+VtnV9A5lvk OJZk4wW43gAaur538xETwnPb3tQ6aPHKXQ44p2oKh3fLoSyTRMEuhW2nDj9Ai6WKB9Li eDe6TIDqOrSWOOwelTn+zfNq2KS46w/TIwfRUI946F2KPwjD1A6kfldlpG/dLa5x3q3N /NSt68hB/EVmgITPe2trF7UE1uvoWAloO8fIUAeCFsonstqGFntfw/Zhu5nlfULXvwy9 0QUHoLkFlYwj6h+vfR14CKzakHPyn8LmxWDm1mwiQNMUxycREvyueMBci1+O0heAEdRC Au5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794280404; x=1794885204; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ZsGYkHSaF8D1INVVG7IqcJD0MRHplG6cSUzvau3umEk=; b=QaLPuOYehBBkRviUPgNSLUZ65jIWbvB4MaUwHgysZVwZBrxhI/5KQm8gZ+G6u/bkMk ih90NOAv9dAVKyXpXhHOw47YeBhNekRYTmVOlYkF1OPBh1n9urnqmCVa2T7TeemybdeT 3idMSLT/bkM6i2QXIhOVDAtGdlPaWVdFPCraJmYrfGjHEzPNR6hi1RkN/IsYgb3DT0LS RdSH/aUIBaV2EUICnc2o848uHQjgRgO7u2NNvgzmhoAs8uvtSMs6O25NX8Xe/+pETpzS B+tWCtX6Y7k2iTWPcsVnj1rIjT6YOeCJSN+ACAwK4EXipsUlj0sY4jYMXUcgutyo5MLE RwWQ== X-Forwarded-Encrypted: i=1; AL+hErHJTU5wAUlTMuW+BvO2NHGubaaMQP5mMR1rcZnmexq51/Smk/CopNfETIvNFbLdvZ0q8ivE5zibmvcUWQ==@lists.linux.dev X-Gm-Message-State: APuU4Z8qXC/tzEYmLl9PRQzgUeV68itaLA4x9wEx9NdtNEITYhkgsPQt XE5K6rytkMm+HtFGqTmbNgwr0eeP6ROYGppy3LtnOEwdL1mvG33ddoIb X-Gm-Gg: AYBFou362UhLxLD/UcnryK8mBkjJID+mKq3REDAFGdRpyX9rZr7VoKdLDOP/K2qRKkI FppfEEkXJWRwr3FTxTVJam4Y7/dd0LEJ1LPvs+AdN7FKExv8pJP0rN1ySKLvLCxlU67MadAlvSX OZ5B9Lq1ozmpjEIuBfCO4/Np0VK/MK5DfcflR8aloW0vESp2y7BNb2UtVldxiES3IrtyrjgYYxA 8dyoJdpDyUG/Abs/qa/dVXSFFXOQVd50Acp84GEU+heSAtAkTIL6wkmUkAGdboJDO5nIvtKD1xp drzkwaio0jqcM+da2Ld8FnCyYM8Oi4u7JAxPmyKequjiLXLeVqPQ3l+wpt9fDGrXXtPvC9pAn0e 6tWINVH6b/6ABeXlzFFa5CHlfDUME2nrNqLrqr9fsv+GJBl+7bElInafMJRCSv1XGvxlk2edRQ1 rVqOI34ETF6KixczLCmaqw+CElMboIim6c1/WucwmBUn4rVxtjE8FITMKCiCZL+3NEBXK0XAL3s xus5KZ9pq1DRJmfiL4v4e5XJveUnOGDmL30vYbYBz3QcBCgDTDj1Ensa3wX/VZmezisIyhF3jez prTRw6i3fgrsuCpemMRtFWlzdFtMoAaAXCGTJSb7PDcXWu+JXWfodOr2A9IJwMxCuGEmQcHkl0l dlTWlB/lX3B1mRnDSO3gNaUIQmSA+8jVAJshyPjwJBHLgNkmHAwhbSW5jfXPXuBmBf2YFO8uGQl IKyelL8vbJ8IsZW7+XzPa4sayOhEKPB8k9Yudw9LsifiIKs8qMuPYj X-Received: by 2002:a05:6808:509f:b0:55c:8ee:a9c4 with SMTP id 5614622812f47-5683cd30aacmr1359211b6e.43.1794280403760; Mon, 09 Nov 2026 19:13:23 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 5614622812f47-56905736b92sm1019236b6e.8.2026.11.09.19.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 19:13:23 -0800 (PST) From: James Hilliard Date: Mon, 09 Nov 2026 20:12:58 -0700 Subject: [PATCH v9 09/11] dt-bindings: serial: snps-dw-apb-uart: add Allwinner A523 X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261109-submit-h616-uart-fifo-v1-v9-9-3f03961dae8a@gmail.com> References: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> In-Reply-To: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> To: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, James Hilliard , Krzysztof Kozlowski X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-1.19 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FORGED_SENDER_MAILLIST(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; TAGGED_RCPT(0.00)[dt]; RCVD_COUNT_FIVE(0.00)[6]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com,oss.qualcomm.com]; RCPT_COUNT_TWELVE(0.00)[17]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; TAGGED_FROM(0.00)[bounces-27452-noreply=patchwork.local]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[174.29.1.49:received,100.77.114.92:received,209.85.167.176:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; FREEMAIL_FROM(0.00)[gmail.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FREEMAIL_TO(0.00)[linux.intel.com,linuxfoundation.org,kernel.org,gmail.com,sholland.org]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 4623F1C760F X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX The A523 UART integration has different FIFO depths across its controllers and reports each controller's depth in the FIFO Clock Control register. The receive thresholds follow the standard DesignWare FIFO-relative mapping, while the optional-register layout differs from the generic DesignWare integration. Add a compatible for this integration, also used by A527 and T527, with snps,dw-apb-uart as a fallback. Acked-by: Krzysztof Kozlowski Signed-off-by: James Hilliard --- Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml b/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml index fc1289073241..ea6ce99178e3 100644 --- a/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml +++ b/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml @@ -61,6 +61,7 @@ properties: - items: - enum: - allwinner,sun50i-h616-uart + - allwinner,sun55i-a523-uart - anlogic,dr1v90-uart - brcm,bcm11351-dw-apb-uart - brcm,bcm21664-dw-apb-uart From patchwork Tue Nov 10 03:12:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 4006 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 08A601C760F for ; Tue, 10 Nov 2026 04:17:46 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27453-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27453-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id D90A9E1F55 for ; Tue, 10 Nov 2026 03:13:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794280406; b=eYyxPhIye30PgkKUVv5Sj+ywYaAzsAP1LMCCCw5BxmPVXfqE7r07iGoovLNk+W6UBe0u 5Q48BeGddmiWg8OYJoDmOEWmyPif2+W/1xx6F4UVbRT3H8Y8Yt/ENl4SW1cZQdddsQIQh jMPcUkLTgd9E921jGB9kqwXf3PtO+Psu1/nKnjCXgRRrKnSvhURqW0WQrG1IwFPEdkm5S biRWDtU6d/bRJYqyWih12lFx09hh5yrp5IRMxvqkCK0atEK455UhdyYs7B0qymJEJ+KXt WoolsOOOD2PrV5DnJkLpP7BqUmkHmdSYdsWT895K9vHA0H/YyNsPDBmOKnDdVt7hiCQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280406; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=RD1jkN1QvH2Z5B6Q5iIjFx4HZtCXt5GvWjpjCwZzO7s=; b=3T9QIHmP1ovz9sO2Q6127uQyoJRHw6PXUdNoWkQqVjCqh5BlC94FStroQsqLiPUdwvL2 NtYe1XBA+N8aRW0DVCbxYUZyTBg5Q0iqCcEEjkCo4x4uRwfYC068+RXTBUZCx8kisMzn2 chVRdMThUnu3UrAFRpVFUwm4MEyhP25bUgJ0O0wTxIV8uSCPgO5i3LnDmkpagSQvs17oc 2Er0qXzXmQ2sP2osjmESmIjFoDFu4HDYh9plfYgYjdRBEnNX4IgPc+BQjZYLvr2IzYOwb zXXqUkUipujNoVa5LMlqSyI0Zlbaeo+Cu3Hk9r429n1DjYTpUP+VnNPG251ZapH5Juw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=dA0PPZE3; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B378D60A6F48; Tue, 10 Nov 2026 03:13:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=dA0PPZE3 X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.170 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794280406; b=MlTSYVLhZgXwbWvSGAEKEaQes6AL+3JQ8PfuFbYDNis4oE40gkeqrXua066awMKloMcx lKmQe5NpXy25QLB28pJ0dXtZff0kvbA1DkTaoj2K35MpPx5Msptckwy90s2ptjwdYqokh qlrzhXjNETU92ZALheESOZ70Z1LfWAiEe9CfsI5cK+C2U33j1/lk3ZLY6ZkBxYDaXXW9z ljzmn6O8KHIb6GrbqJra+tuj7MAqEmQUjs9KJF2iDsEfr/MnszSs8tABSOAzs8bjRmt6s VkQKFq6iyJleoKEKgK9nFm2ELgLWJOnQLiji3BvFlpcTXKXObYgi2SpG16jBcVwafMQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280406; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=RD1jkN1QvH2Z5B6Q5iIjFx4HZtCXt5GvWjpjCwZzO7s=; b=2rgSer/PPOpLIxTawZu2rIYHIsLhK30mLManCZddJrGAL07QxnqywlgWG38l5KnVUdUB t8meoHUNY8u2EQcriMAwZ10tA5QJshceN2iwEOtA8UquPD+tybMolztKJERaGIo3zVfZE FIHQ9c1q/5zeIr7/9b9HdB4ijIvUqmpBzDd+8XYI9DIpztjJYPGR1a7QyjzWirHSljJuy EPHNbQU5jN9kFDSQSFaz4uxoz/aft8SnG+bxzdSwTWlJhMok1MEuaAt+iDFlBUo+rozG/ tYIaMneWIsCIf5yrs+VZSDNeyeMCl5J/TWLTu0X0MJl1hlz/PQ3HNwlVFXV8hMOca6w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=dA0PPZE3; arc=none smtp.remote-ip=209.85.167.170 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49D2160A5BFE for ; Tue, 10 Nov 2026 03:13:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 49D2160A5BFE Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-4ab8cb2a6e4so947782b6e.0 for ; Mon, 09 Nov 2026 19:13:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794280405; x=1794885205; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=RD1jkN1QvH2Z5B6Q5iIjFx4HZtCXt5GvWjpjCwZzO7s=; b=dA0PPZE33+mYoBh5Sgd6a9UWlFa0bn57Eqtqk1MMEXZR0kNRT7g0721i9n+4YP6vT3 Q+NSMev6GImReThsii/T7YBsnbGkSReOVSXg59D777u5hNqpBonnbv6ajS2+1d786ItG hTTL2M6f5UaKpsqhmZU6Uu8wY+jSjhn/BH8wJfP200wf3pAslWVdJCxqDbykN9h/6YVF dF+YWm1P5sqfzei82Qfwuz96UKHdtzPt2EoGm+vXWAiJxg7+q2Jp1qJSdQ+lXCdM1c2v zh4loaNFufVdIvfiE1PVvasye/wBXwyc94UTw1FSM+AEPKm4efuUY3I/GidaYLvNrWtQ /bsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794280405; x=1794885205; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=RD1jkN1QvH2Z5B6Q5iIjFx4HZtCXt5GvWjpjCwZzO7s=; b=kz7nucEhWkIM5ajt3Tqwqfr3JjYaduStmB9zfm4fQG7bewScljugrS98w7dMtGGc+N f2hd1hF0HZSXcjno2jjHznQFdoKyS1v9C+iX/BZdVrOcQ1yFBWvRwCgbXaVMxB7S44TQ rpFUFWFvjiQn+BdsgSe02AwFbsQNhJcyW8hCNNz+Mum4Sz1s7A8qd/g+g5ncHV4eoex7 s7pcNxeUvovCUFxPC1JI4KPDM8RTJSqVOjGejqzsrwhHFPoZbTUy64ff1oDxrUt7uOBb aopaT2xsNrLm0KcA4enpjco5/a6bC3o22GLa5Gt39rRa3EbjOjXdNQPLdYbMTvRHDb2R K5Gg== X-Forwarded-Encrypted: i=1; AL+hErH/RV/APB72QwpVFxr3Aoiff4zmo170Hel7kmCDevPozEt/6UJBZ8WLXd3t5qaJ5Y0gh4bb1Yvh5UfeRA==@lists.linux.dev X-Gm-Message-State: APuU4Z9lcgdbOssUfbAv5PMm+QLnzcKjw0geCte/RVuqo+6nBFM5x/2m NSPIkLT8A+qIOgknM8Ilgi/MECR530jFWu8TP1dHuGv/0i+y2qTx+7fG X-Gm-Gg: AYBFou1GBX9M2qpzDLvGXMGmebhinrZMtlXqcwbcYWuUssCfoHqJv33VEz34GsnTvB0 vSzYOZNVPUToXO2Sf1P9tqIeFGHF1p9YFjE8BnINbu0dXcifnAnh17pkjidM5gU5174EJ3UVE5P e8lTgDyX9vKwLt9CnsBbRcvuiWQQ7Pokbh+pB3jFxxVSm6+wewm9mpYQLR8XdkmMXFIACfOM0TZ uZJ8ribFUtg1XPJIH9XXFl0nbcI94hUafrPAdavWKQkewIARYZORq+j7f7IRn2iBAXHQYhlF/Gm kTdQsUxdTt5sw+smpk7CyRB8LNT5+TpzT8Z2GmhopokQmY4SmkOiqBfwW2gXyoQzRJX7GUn8Kgw ktHrG86VlCyjDlymo7y9p/CmSXzjRKOfO5skRPgmNNxcdXq2SMKGkYBkXnPcgP5ejdwQLYZeb7M WmcrfwDhAKAK+Kbgq9tFizBZ60dR+6wlSZMbfgQqGPlUVlGlkUkjOrbCOgUvG9ZEmSgFIMnlLdU YFF09PsY9WtsDT/P5B63wtkIJSbDHWekDnC1mqvXddz+pNfqWZ/Te37m2BpCKR4kMiESv0goJgE E/UdxWhJDpX07YJR4kPdyYzTiPu3xfOYDPMF0MRGwkeiFEJpnu3CisCTPamo18TFsuQ+wwWC1qk OnpmacQsaaZ48rpZCNNYgNJKQamET0AsYtTHJ8f1Xy60TAIdaE5nOayMFRk8wEjbd9OhZPZEQcQ cVNmSVBIdL+JFFQumPJNap3QnWGXmdxoHZ3qLJQ2SNTTu5DSgap72+ X-Received: by 2002:a05:6808:508e:b0:4d6:90f4:48ab with SMTP id 5614622812f47-5683cd1b07bmr1294602b6e.45.1794280405078; Mon, 09 Nov 2026 19:13:25 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 5614622812f47-56905736b92sm1019236b6e.8.2026.11.09.19.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 19:13:24 -0800 (PST) From: James Hilliard Date: Mon, 09 Nov 2026 20:12:59 -0700 Subject: [PATCH v9 10/11] serial: 8250_dw: discover Allwinner A523 FIFO depths through FCC X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261109-submit-h616-uart-fifo-v1-v9-10-3f03961dae8a@gmail.com> References: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> In-Reply-To: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> To: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, James Hilliard X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-1.19 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FORGED_SENDER_MAILLIST(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; TAGGED_RCPT(0.00)[dt]; RCVD_COUNT_FIVE(0.00)[6]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; RCPT_COUNT_TWELVE(0.00)[16]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; TAGGED_FROM(0.00)[bounces-27453-noreply=patchwork.local]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.77.114.92:received,209.85.167.170:received,174.29.1.49:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; FREEMAIL_FROM(0.00)[gmail.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FREEMAIL_TO(0.00)[linux.intel.com,linuxfoundation.org,kernel.org,gmail.com,sholland.org]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 08A601C760F X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX The A523 UART integration, also used by A527 and T527, has 64-byte FIFOs on UART0 and 128-byte FIFOs on UART1 through UART7. Each controller reports its TX/RX FIFO depth in bits 31:8 of the FIFO Clock Control register at offset 0xf0. The field holds a byte count, not a logarithmic encoding. Read this field in the sunxi setup callback when platform data does not provide a fixed FIFO size. A fixed size takes precedence, so H616 retains its 256-byte configuration without accessing FCC. The probe has already enabled the clocks and deasserted reset before invoking the callback. Leave the FIFO clock-control bits untouched. Use the shared DesignWare trigger setup to validate the depth and build the FIFO-relative threshold table. Invalid depths fail probe before registration instead of producing zero or truncated thresholds. The 8250 core derives the transmit load from the discovered depth. Select this setup for the A523 compatible. Like H616, this integration has Allwinner-specific debug-divisor and RS485 registers overlapping the generic DesignWare feature probes. Use the common sunxi PIO setup, BUSY-safe integer divisor programming and software RS485 handling. Keep the APB clock gate enabled during termios updates with SKIP_SET_RATE. Signed-off-by: James Hilliard --- drivers/tty/serial/8250/8250_dw.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index a55f60330a51..257baab5a3ed 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -44,6 +44,10 @@ #define RZN1_UART_xDMACR_8_WORD_BURST (2 << 1) #define RZN1_UART_xDMACR_BLK_SZ(x) ((x) << 3) +/* Allwinner FIFO Clock Control register */ +#define SUNXI_UART_FCC 0xf0 +#define SUNXI_UART_FCC_FIFO_DEPTH GENMASK(31, 8) + /* Quirks */ #define DW_UART_QUIRK_OCTEON BIT(0) #define DW_UART_QUIRK_ARMADA_38X BIT(1) @@ -63,6 +67,7 @@ struct dw8250_platform_data { u8 usr_reg; u32 cpr_value; + /* Fixed FIFO depth; zero selects discovery during setup */ unsigned int fifo_size; unsigned int quirks; int (*setup)(struct uart_port *p); @@ -666,7 +671,15 @@ static int dw8250_sunxi_setup(struct uart_port *p) p->type = PORT_16550A; p->flags |= UPF_FIXED_TYPE; - p->fifosize = data->pdata->fifo_size; + + /* Apply given FIFO size or try to autodetect it */ + if (data->pdata->fifo_size) { + p->fifosize = data->pdata->fifo_size; + } else { + u32 fcc = dw8250_readl_ext(p, SUNXI_UART_FCC); + + p->fifosize = FIELD_GET(SUNXI_UART_FCC_FIFO_DEPTH, fcc); + } up->capabilities = UART_CAP_FIFO | UART_CAP_NOTEMT | UART_CAP_AFE; @@ -913,6 +926,12 @@ static const struct dw8250_platform_data dw8250_h616_data = { .setup = dw8250_sunxi_setup, }; +static const struct dw8250_platform_data dw8250_a523_data = { + .usr_reg = DW_UART_USR, + .quirks = DW_UART_QUIRK_SKIP_SET_RATE, + .setup = dw8250_sunxi_setup, +}; + static const struct dw8250_platform_data dw8250_octeon_3860_data = { .usr_reg = OCTEON_UART_USR, .quirks = DW_UART_QUIRK_OCTEON, @@ -965,6 +984,7 @@ static const struct dw8250_platform_data dw8250_tda54 = { static const struct of_device_id dw8250_of_match[] = { { .compatible = "snps,dw-apb-uart", .data = &dw8250_dw_apb }, { .compatible = "allwinner,sun50i-h616-uart", .data = &dw8250_h616_data }, + { .compatible = "allwinner,sun55i-a523-uart", .data = &dw8250_a523_data }, { .compatible = "cavium,octeon-3860-uart", .data = &dw8250_octeon_3860_data }, { .compatible = "marvell,armada-38x-uart", .data = &dw8250_armada_38x_data }, { .compatible = "renesas,rzn1-uart", .data = &dw8250_renesas_rzn1_data }, From patchwork Tue Nov 10 03:13:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 4007 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id CB13F1C7643 for ; Tue, 10 Nov 2026 04:18:14 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27454-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27454-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 0CD63E2964 for ; Tue, 10 Nov 2026 03:14:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794280408; b=vLmzayJoyEycxz8PN6mF98yX8/LVjr6Uszs7GsYXQoLxCiVZ8q/ly2z4y1MpOFEsDqch 31laHEdcCDvxh/LoAlI6XtDoOUm5ga6NZA/qlpoZYhxfkLjScGoq/j42ytrdgRJjCCwAw eSjQZfT6W1oj63SMfAOXmM56gA9dLrEUZEEcBiC+FqBW6Mtq8SBrw3CSs7FvFjn+4IeB6 MbNIcBZ6kzkQ/g+D6DX7ff7KvKyyLw82JpOqzjWFmxIgnUfr0PAkyFlVACa8gaV0VvXjG KhfBQ19IECzppzBOW5aRGbROLWM1/wzSQMQxJnPgb9ZSivGFjcQTU9jA3x/OryKS6ww== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280408; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=gLp03dCCASGHpzLVyWfgND6QB17hfQHAhLsrbe2Ht9o=; b=L6aoyUyfuXpO+gS26RUt1Vze8q6H3dRE2mvuiaCO1N+H5UykQ6du3EG+bbMXdBdEdxLX 56aIgEpmJWIGIKynh4j+GcGCkuC0qFDwLKoXpkKJMT15jPX7Qxr7KvI246+rwYGG/1f0p WtWCCVdUZk/0/JA+2+1huVmYP9DJoLteRlDNjoG9jeuPEriiYUpTSoNbrKJF+a7lIifx1 s5Chqfj12nKHce8zjU/vBJKY0HXXmSR2SJux5HZ5LK4Bwr78vTSEx0NRt09cqfCQss1OO uU9BQ/8DqsjK6MlKZKOP7R1sH5uZptdr+eeilCi3n3KsTLcVAnwBm6swx43ebzevGTw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=htspax5W; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7228060A2602; Tue, 10 Nov 2026 03:13:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=htspax5W X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794280408; b=aUZ8ysSp8/J3pOrU6PpvaYs0LxibvM5CcTMuklTxEVM44iVke4lpiQRFkMWg7Px46Yyi LCkrsN5seSr+oYipt1lE790fnUlwOFUcLH4sZmv17K0ix4uzWY/Fr9dV4iPfQatV5VBnG +gtBlqO2ejLPO9rOxze40wvydPP6wgRer7SvQ9X0WjKj4EKsNdNy8tk3bITKJGJ6rfCeY pWA/hdCyCuJ/Xtea2yxz5xi0+HnfkfjIUOzEylhIlRpFhGouMv4HcrogfCug5WK+1z4oP HWe++Dd2sGpkVmMETQEKYS30ZHet757lTk9M6wtt+kw/Kosaolal4T/kT/NsVs+dDxg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794280408; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=gLp03dCCASGHpzLVyWfgND6QB17hfQHAhLsrbe2Ht9o=; b=PuToPIqk1xE3YPFCMV3kO62hZbvFRnrZYme729v9ROA6P2N02TPFtcwsDEgyuI4yAEa9 h0qLm2ckHQFmpStEyctcG63XjPfEqfj4RpMvWCucLyu6boFp6MPMatbCV6D53Cnr1iK8L 6eZxOS/4B55sme/M1vmWbYVMbdy4Fkc9NbCSL6XHuIO7oWTlCC77fKSIaqvNUFnSROJpH 4cMdueZt+z/66/aMlNujh+6NXlVwfqA1r6aaqpxlr6teVws2IhCS3T4/iQodHh7rIBvI0 1cleCgRH4Kl7FVks4nMrm/NteeqC6jesL4rjJk9UOInFBjB1cgJbf/UetpvCVJ7B/sA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=htspax5W; arc=none smtp.remote-ip=209.85.167.175 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DA8460A6F51 for ; Tue, 10 Nov 2026 03:13:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4DA8460A6F51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-53dbe9b8d6eso1283638b6e.1 for ; Mon, 09 Nov 2026 19:13:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794280406; x=1794885206; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=gLp03dCCASGHpzLVyWfgND6QB17hfQHAhLsrbe2Ht9o=; b=htspax5WdF2zb1yZ7yogMa/O2LOs402y/EbdNLFsRzLbfmKG9F2u2e05AavufLCaA2 gYxIiR4QqpZ9noMmXUe9oovBsu3aBTqsQVtbc9NGXNvaHB1nGPGNUsoSE5d4p3TPQGcJ qIguNuTqqwfKjNalpLQ38ul1cE49T/6GsoLi6GFjKb4qOmRtwsupYgn6NzdULmgiyfBH VpqpWwpctePGyULNv6+z78Ebo4QVFZv5lwOP4A17i1MRCshXnCSgVfhTDRZFu4KBvoYh +xq/XMPnqnnoy0gwPqHFqSqaO6yuB/RFJrzpmCGy19sCqKh17bRWNklHtwwhwPI/vo30 4FXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794280406; x=1794885206; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=gLp03dCCASGHpzLVyWfgND6QB17hfQHAhLsrbe2Ht9o=; b=kMLAbDuTGk0DqDpQEOEgbvl30BZ2+uX1Z46BrXgFJDSoulGvQKRCDlQ+CDpFA18Rem ujCgffXHWkTGwhgZayGOQEY2QAyiwwcDg6ZEtg2rHUWBlF9OfFq0qzZrXUMlisOKw+1X e2Xm7TcwtL1rqUf6xOPE2ufhfT0csmQOR8bkmAvnPtzG4ZQ3nWiI++6H8Km0opjcANNE 0QSC880ml8h5cE/No0i8cbN3dY0MMB7VEp5q5q/h4AlgopwlX5i8p5Vvg7Z1uXYC/AVO a+fjMZb4WDY47tDAhcKChN459cQ9jjUZcMz71K+QJkjFWe9suWAekgMgjQGJpNhGwzTO Ir6A== X-Forwarded-Encrypted: i=1; AL+hErF5O/RpR91YymUY2pKA0pWT8opOEYGaz9EuAooohJZ64Nunx4DpmXzf9AYhFHf6t+tawCHw4VX/OZqetA==@lists.linux.dev X-Gm-Message-State: APuU4Z/K7JYf93qv612pcjJ4CPz8NNa532BK9YvXal4Oy6oCnI4mBBDY D4wYe2iWwWWmrM7svYDFW8T7ICdwHc3FMI75dUxG8HvRiTGWw6nSjk99 X-Gm-Gg: AYBFou2714zGVGzGxQVlcq/R3VDk5clGpDDxvgw0TqB9Ewl7XD32iOgpZ3jekmupFrQ 9eV2qSbQbXXgQXvKPpaMZSSf0pTiOBPDZBoVN7y9yV6GYWEs5X4iOHX5+VIdFvKgCg5DUf/AHqu 84DiTUT1rlhOEZ4B3SeX2gLKuMrS2t9E/D/vqWnCCVgOMnVX0bqPPwjxMkKrLifNGkoUv5PVJ+i Vxqp3K+cslpRyJzgxhFgo2ZuUq0pWvmqwSA7AzWhycdeaXYwHkfvLL+tANMzcXezbTsJshKMtDE BDhQ2XuaLkQIjiTsknLH0KVo1n3YZy5gDUQ/reY4W8UQBRp0DqbSmSs2jr1TgIF5YZz+oDsah5K 9tuemLOme5JPb/taHOx3ZPfFu0rEhNGj3U+GUhmKRW18LRIB7PKnAwtpHXMdQdn6uTe1ZHgtqhW p3+13i/OW48QPkOpz8hFvr8cPRcboMT+XiSnOFrgsTUviEo1MUVFzJ6GAEWEo5FJuKsRkHSRdum oaP6YJNHkJSvUsVPyDbgZM8R8gbGZHzlZTs/1QsDKHVCyq3PUK7F4VfpWiRehH2Mj+MVSOOYnSP ADeOwow0lDdD/G+swJi6BJ1W3wi83A9ioFrJNSasTpqw/m3C8hJOk0TewnkRA8ZsFUlEw5o0H32 YK7B7MI6TI+ZMG7MUFfzqofmXIaHm/JILG+oS3ryI6T/Pwl/mjmJgZuCLh/9+E3ilg+avrCFpwN maPF9ffsNDryGC46Y2jXy0uIye0puprWtc1bSMbDWQ0KRehla9rj9S X-Received: by 2002:a05:6808:150d:b0:521:561a:8e8c with SMTP id 5614622812f47-568813057e5mr726068b6e.33.1794280406385; Mon, 09 Nov 2026 19:13:26 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 5614622812f47-56905736b92sm1019236b6e.8.2026.11.09.19.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 19:13:25 -0800 (PST) From: James Hilliard Date: Mon, 09 Nov 2026 20:13:00 -0700 Subject: [PATCH v9 11/11] serial: 8250_dw: configure RX trigger thresholds for Octeon X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261109-submit-h616-uart-fifo-v1-v9-11-3f03961dae8a@gmail.com> References: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> In-Reply-To: <20261109-submit-h616-uart-fifo-v1-v9-0-3f03961dae8a@gmail.com> To: Andy Shevchenko , =?utf-8?q?Ilpo_J?= =?utf-8?q?=C3=A4rvinen?= , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, James Hilliard X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.31 / 15.00]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; RCPT_COUNT_TWELVE(0.00)[16]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; FORGED_SENDER_MAILLIST(0.00)[]; TAGGED_RCPT(0.00)[dt]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[209.85.167.175:received,174.29.1.49:received,100.77.114.92:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]; TAGGED_FROM(0.00)[bounces-27454-noreply=patchwork.local]; FREEMAIL_FROM(0.00)[gmail.com]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; FREEMAIL_TO(0.00)[linux.intel.com,linuxfoundation.org,kernel.org,gmail.com,sholland.org]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: CB13F1C7643 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX Octeon uses the DesignWare receive-trigger mapping with a 64-byte FIFO, giving thresholds of 1, 16, 32 and 62 bytes. Its setup bypasses dw8250_setup_port(), so it does not install the common trigger callbacks. PORT_OCTEON also has no static trigger table, so rx_trig_bytes is not exposed. Supply the fixed depth from platform data when firmware has not provided one and initialize the common trigger table before port registration. This makes rx_trig_bytes available while preserving the Octeon port type and register accessors. Select DMA before filling in the default depth, as before when the 8250 core supplied that default during registration. Thus the new trigger setup preserves which ports attach DMA and their existing burst sizes. Signed-off-by: James Hilliard --- drivers/tty/serial/8250/8250_dw.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 257baab5a3ed..31045128dcc6 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -663,6 +663,21 @@ static int dw8250_setup(struct uart_port *p) return dw8250_setup_dma(p); } +static int dw8250_octeon_setup(struct uart_port *p) +{ + struct dw8250_data *data = to_dw8250_data(p->private_data); + int ret; + + /* Preserve DMA selection before supplying the fixed FIFO depth */ + ret = dw8250_setup_dma(p); + if (ret) + return ret; + + p->fifosize = p->fifosize ?: data->pdata->fifo_size; + + return dw8250_setup_rxtrig(p); +} + static int dw8250_sunxi_setup(struct uart_port *p) { struct dw8250_data *data = to_dw8250_data(p->private_data); @@ -934,8 +949,9 @@ static const struct dw8250_platform_data dw8250_a523_data = { static const struct dw8250_platform_data dw8250_octeon_3860_data = { .usr_reg = OCTEON_UART_USR, + .fifo_size = 64, .quirks = DW_UART_QUIRK_OCTEON, - .setup = dw8250_setup_dma, + .setup = dw8250_octeon_setup, }; static const struct dw8250_platform_data dw8250_armada_38x_data = {