From patchwork Thu Nov 5 20:52:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3905 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 D644B1C53CD for ; Thu, 5 Nov 2026 21:52:18 +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-27289-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-27289-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 F314F60296D for ; Thu, 5 Nov 2026 20:52:16 +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=1793911935; b=pylSWVhrK3SGQMTS6o5lbrrNJa2J/igdXDPpxUXI78Ra+9EsBtnilAxAfmO14uX4+mis Fj+xA190yjXrA65gIrg/z6DLJl+DRsWOqMDIXLwfvfTq6kCPFjhriyKO8t+/5IHlNxtTb pAN6xMAy6wnVmfk2VOjF26gvO6VCKOoQ9gv+ehi39dxBFBSKdpmBqWXc6Vi7x6G7ZqwgC kRruqGaO8enbT8EoYP9ahRuMBb7YVBLl02Lq3zDZaBJdGoKvQJfDwfyDQdMWj7wqNcoRD 8zULQxw9is83t6gwQ1tqUE2FaSv5q50dPeHpubg5A4qW5dT+PmXdz21Ps1jDnNyCu2A== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911935; 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=/lE1h7vRI/sW6l31u0lxhMtA1G4uNToUgbvAzqOb6yc=; b=aSnwNkySRI2D2UZ2aVNLmqf4CwES5h9Hxh0rIgXuofggy7xlVgGJZ+IwDwIBRk7L08Xe epNL/r8/ZbY6EkQTQZeZ6ySjWr5vdPUO3lR0GGZQrXTwO1Tf7KCNCmbQT9ztTBhZQeOs0 YKHh1drCJOiR+EGgIJoGwgfU8fAttxZR5CvKHqgI/SNXvyhUcihSpSHNJurjRTJARcT2I VB7Lp0PgtihtsuWz+HY8cQj1Jfdp45fU8yL23DEY9E2H9qsNiw7DR6cW7jcqT9u28A9U+ FO1LTMi2SuJnnQ+0PdWDGbl7lo5FWwMxmEnvSQD2FlJwrM4sHaC4fPW/9UzKGj0h52g== 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="GQOy/lVX"; 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 A4038606A332; Thu, 5 Nov 2026 20:52:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=GQOy/lVX X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793911935; b=haFKB8aaBPAbIdaas5mjRm5HmJbwiceHjOe4HH5zhnwK/bxPYiRHTH+vtKrRpHf/ACBJ ac5cBsT6uQCYx+6Q5ogoHsxQmX9BOj7SP48gs3JYHVLBptEG+8yXCEK3345TGjJFAxxDh ywHBmll152gt+g6NQoyBEP5lcPc10yMCDLvRIQR1XFTegFP2p2fSkI2NJM/M5ZzQ2w6y7 Dhjyu7NAlwASLbbYvd/X0fwFkejg1ELoQTEdUUMfcf4zK5lQKAqXl9kpn5JWGVZ8M3BIH tVd3VL19zun8Um1HgGjfpW5CRD52A1fScQGN6qhBlHHFW/KMdCiD6JLra9BKPPimsbw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911935; 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=/lE1h7vRI/sW6l31u0lxhMtA1G4uNToUgbvAzqOb6yc=; b=gD2cpB9ToGfadVFba0psrJcD1qRKap9BTzR92CKzMEw0ci9BDaadSMYQ/MkBGY8VFvJn sUEKVGw9eQ2NL/pk7UWEHd1J1eaWu2I1wm7fnzmhKwxmLoUPsi/g21dVhL76RJlDBPG/y mwhrEp3MmUcyuDElfSQYWIYi+2+RpMvJzDjMJr0rQ/8Dh4ELUja9JTV8oxs3c+tYtKHMZ 3aPNZIY80Gz93o+nzn9MSkBRcHdqseGlqVptz41T6rc461x4ZhgSwkANLMMUGmO0cxInM zn5WPrUgrPK/TNlHcEywYHSxjBQTIGvovx3GBgq7vJZYtxaxFrxfpq/lVu9Km+NA96g== 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="GQOy/lVX"; arc=none smtp.remote-ip=209.85.210.45 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (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 3564D606A32E for ; Thu, 5 Nov 2026 20:52:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3564D606A32E 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-f45.google.com with SMTP id 46e09a7af769-8241a56cd70so1559255a34.3 for ; Thu, 05 Nov 2026 12:52:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793911934; x=1794516734; 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=/lE1h7vRI/sW6l31u0lxhMtA1G4uNToUgbvAzqOb6yc=; b=GQOy/lVXX5hRHfSB59/0p0Om4uFVTud0MQ1JthuY8YxG6gWCsZpoyy+MI+DMwu0kam JmzM8nKPJC/SYCdz78mvqSPEG78pwdDHyZviGkVliHbc8X0W6sOJYYn5S0EFWDaIABid whwfG4AZK8Ki115qqbjGXOXRdFmZhQawLO3x90XwtFnghX47ptU3QCrDBQTQtHGLltHm 6gw1HcQ8MQP4PROfqMXyglU0JWm2Z0myo/G6FvdCLS4miOOxCjaWhs3liliutYTIEMCv gr1GpFWBIiA+16Hescqxem2MjCBreXXP9vlUFYNVlo5C8GXRHbUvdcu6h8sBc8bQmSLn 1GjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793911934; x=1794516734; 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=/lE1h7vRI/sW6l31u0lxhMtA1G4uNToUgbvAzqOb6yc=; b=XV8DX4R/6A6Ofj9OwRI4lpIh+PMRXmPJL0LsToA2+Hy8m5K8ilDAl6kvttHIFby5K3 do5y5kL5a/eC/CKIO3mKkW6sYsTqGgUY47pMEBLi3GtXSOvqB/Ba0vdf8lcOfoIjJHsP jb66HlaU4VRtWXqgsogQBjekXLP8SMrL6XeoYPGZg+PIWxexgrvItLDWrCzfxMX2Li3D 2VzNTZ63yVM+++gzx36m/cCQfVXN7hjbJTufA4h89HmQkn9hxw+8sv2NhvN2J4s2re1B 0I9h0tqat+TAru0JFY0xbZd5V5ygBjHCVG0mqL+PUJaJjJQAm31Zvca/rvf7dKv0vctd Byeg== X-Forwarded-Encrypted: i=1; AKwUvBwaVyFkGWl3wPfQqbjatSBpfid87jLpDnsYKBrzZQPbQiNRXkyIzajaw3QYiMYBoaFI5RLzlWcsaIv8BA==@lists.linux.dev X-Gm-Message-State: APuU4Z9XMpxqU4ibHUHDIMFmiqjxceWH9PdP/lld/JSJXERAIsW6giwW oQR6yde+38JQQZjnr5ke5RAUsXUFErfy7wJe5PmE2brFPSdfMsR7BUiI X-Gm-Gg: AYBFou0yyJv8yBg/iqBTyBKy+QCN773dIR1zaqemDAIIrqMy+SgMimhUCxDJE3AITit eDGJODb5ZHmrCubjtkzKV7hzleRhkeW4xkJmcwl23b1aLG5kOTeK4LIdWTl5rXag1LFmwegGYOd JYxNls2UIPktJ2DfXXQpt+7TJRDrLmu19tApui+x1BLmlY4a/cBjXRBcZ5eHBj0kQTYovgavHiY 4z6ev4+A20l+oY0rJO4Brw+kRhxm647XERxf/RHYzxfC3AYFlcwH2KWB3LVcK6d4j+Abj4QKveF i6wX+t7771iPxTb3ZGwrtPnk/6/nqGlSZ8izzVctOdSd7kkhHbvFxHmNMNrC8ZC8bF1fhBDmGzr ZyQ49qOjnobDswhVHy10EmUEV1fl13JlUmBynfH19QDdWcL+iatDw7Fj3m7qgM8vVzVpniQCtxJ myfJTxVNDUBl5maRKlh7J+hpC3z7wLoBk4jURTwEKk2HnzX1CYE7pfxoCENnd6kUjNrlQ66N3er 1j2FgMuzNGeLxO1+/PKul8JJWWN7a1Ilxw4+L1Cjj7PsS21h3uX75uIcAKhdDxMhl1QbIdkUb2g f9nIVplfAG7v33ohEqVjbN8FT2nR9TmEPH4qXGnqLD5fmLArUMPYHJuEqlFet7+JZj5JZXDIf8p TlETPUXCPaZflcD3HD1jMy+kUn+wDmBCGHby8S9UtUEE/76NGv+7gHiTrdWUi1ISXeogF2xcibk s1W/dZlTZBtuYW+qp+7TVbRywvlFtrVLD6tX5W8vREWonUfBzJ4q8c0SGNk65EmCn/zpTCbaeX X-Received: by 2002:a05:6830:2e12:b0:843:cf07:7a99 with SMTP id 46e09a7af769-85f1d14ff4dmr511092a34.31.1793911934069; Thu, 05 Nov 2026 12:52: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 46e09a7af769-85f1dbb298fsm292276a34.6.2026.11.05.12.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 12:52:12 -0800 (PST) From: James Hilliard Date: Thu, 05 Nov 2026 13:52:02 -0700 Subject: [PATCH v8 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: <20261105-submit-h616-uart-fifo-v1-v8-1-14024d2b184b@gmail.com> References: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@gmail.com> In-Reply-To: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@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]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[dt]; FROM_HAS_DN(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[intel.com:email,sto.lore.kernel.org:helo,sto.lore.kernel.org:rdns]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; TAGGED_FROM(0.00)[bounces-27289-noreply=patchwork.local]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; 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,209.85.210.45:received,174.29.1.49: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: D644B1C53CD 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 | 7 +++++-- 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, 13 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 9cbe076463e0..80b2b673b422 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -765,8 +765,11 @@ static int dw8250_probe(struct platform_device *pdev) dw8250_setup_dma_filter(p, data); - if (!data->skip_autocfg) - dw8250_setup_port(p); + if (!data->skip_autocfg) { + 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 Thu Nov 5 20:52:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3906 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 35E0B1C539E for ; Thu, 5 Nov 2026 21:52:38 +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-27290-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-27290-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 D1BE4261BF for ; Thu, 5 Nov 2026 20:52: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=1793911937; b=O0KdH8SV3lraUTwlRQcjjOC/kyljO1+ENJsOjmEz2CY5pMb5KQnCDPFnn9PPrt9ukEbC N4VNrbnNQULXVfSL6gS9rUq6GfhJUyjvz5KHAYdbjNFoI7iH3tgDlxAlcr1vS6IyrkECv sR6suiVqdGoN7h2L3C/D/LsYcX3t1D/n97SihmsUHzkkTmKpHYCR4Ad7k4S+HoT9gjcC2 B1YQTfTimP1hNQJYI7E5hfsHgXq+ojod1JTdWmxJpr1djoZapWXZ18qOM2gZ1Nwy5HEWo t5ZGK/P1UDt7mr5VgAIinRiRV2i/YRGalOUNDKnZfexOi/Uu1+FVkKD9AEnCQnPa7Wg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911937; 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=gFXtfo2QF4UuPe88KiYuo+dmf8LupFBJ/LFbUjyQRiE=; b=wUQu/PoWjdNPbQzNFo3lxg3Y0ygZi/325y/l2MvTqDnyCIbFwhuGzWv4E+V5/a0MBolZ jCDg+SMUW/BKu+LV+nSb/YTZ2ZHNp8QyPVVIWp/jW1dZ3eg3f97759QqGCJMNQWZQwbJX ZzQvv/Gn7kRO7r5djpgPAcYa2QzWHdmYGE3fp85k++QGMNv2EOUeFDdx8/m982nB+IHgt iQ+kPSd5ISOMzKLxYnguimzsvzWUq7pw64xOAgAU1cjyBhrcbhHYdjeHld9iALgU61Qbv thUcc3SB9z+/RR/KrRtxnyPy7TQZUZm3AnsmE28ks8quyeL6qk6PeO7mKs6Qi9CmT0Q== 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=CN9l4OuM; 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 CC0C6606A330; Thu, 5 Nov 2026 20:52:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=CN9l4OuM X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793911937; b=2/X+YMsh3RTq4JeBYuArBF+tMDlbiRyeJzKY6M55KIFVDUV3ZPeHbdJZ7MZ/Bi7szhjx y+rhB29RjT5QiSs+ToAJVnDsuh7GwcIWqtFD2tzC7EDx3RI+k1KixOHgfOPhXkauzyhOp wWdDNDGyZonBJnrgwGZb0o670P0jlIVf+4NKG5p+NUqy2EdszqpnU+K8wPQCudG5b6a0W kI2e/uk0lue0qpqb9X0pm00VBRKeBVj8VnMLol7SJjRbmAxpZmhgU+MFi3jVyFr3nm5+0 shUVe32TmpO5XHNRKpF5JHw9UxGzG/yG+a4X1cSz3Dkygei3S9ZMYFpkbNDauXE17ZQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911937; 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=gFXtfo2QF4UuPe88KiYuo+dmf8LupFBJ/LFbUjyQRiE=; b=aCRYVnZ+jJrbBiOe2YrRQ+hX9WTayOg4+nDZ0WLVhyGQJQHBJa6IycfmxmHr/FDYVtlu xZc7IePr7mTjKYucufYNSaz8oIf/RL03r9PSCbqfXEjIi1Nr1FDcJrf1tKCZXjMrilLI7 orPanJNmCt1WuLg7sFXNKI+Pz+zzk3eL7pLVt9zSCcNR7wTRwX9sqWNG35UAG4wBx0HrU 6d79eHAln24hjiQijLLQ6aovTwGGOd9Emp4WiXx5YbCIuIirazNaTjUtfzvwTwspoqZow Ak9Icf9MDMejXfA4a0HekRUNYKM38YninalBAOM9Js3bHqgY0z24xRn/j52VRMF39BQ== 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=CN9l4OuM; arc=none smtp.remote-ip=209.85.210.51 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (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 60574606A329 for ; Thu, 5 Nov 2026 20:52:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 60574606A329 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-f51.google.com with SMTP id 46e09a7af769-8446af403b5so1397398a34.2 for ; Thu, 05 Nov 2026 12:52:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793911936; x=1794516736; 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=gFXtfo2QF4UuPe88KiYuo+dmf8LupFBJ/LFbUjyQRiE=; b=CN9l4OuMIHb5CWU2AQsOFrMMlhIojvUH0PlrZ/JXedg0QsmDNQIIUszfXxes268/GM yK3j6T9OnmYmt/yPrvnv8xttBR6T2kyiHO/ChtQSz9AVLtmzq9Y1oKxjG5OnzlSXVHQv kY9TWc+ILFVrJN7AEd98iZ2tDHkrv/C9Ld1pPh6JNvhMXhPVThQKvvHNYRKRJBlekHt9 J/Ncqn5NgnHwFaiv/5IMc/83SwCJ7W9skbZSMIoBEHPycoEJv7DQMkCWaFssHhrsz1fd NE4NZrj1PwzpXFZoqevwxvt7u2nMy1epP29E9Qupu56hqZYTkAwDcyHYB4q5QbEuQnI3 ebvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793911936; x=1794516736; 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=gFXtfo2QF4UuPe88KiYuo+dmf8LupFBJ/LFbUjyQRiE=; b=WOb6381EIgMxtW688ErVTGR8gV7IKOIUaHIHoFxAvvhIR/0PiIraY5dh4mNsOpAeAx c6LTGZMwX4bQo4wY9ctXfZwi7jEgzOZ6s1uMlREJV+WTMkcVk3+qZKw1NLySu4xoSTWx cg7ldVhElE+bwT19b9oyUxxKEevaTvIyJ+GYwfArYdeGbJESTXd/Qym0TgZNwwpy+Xpz 75rXyOOPNYHPmnEvxEbLzk6uHvPivqg5DA0GwiO/UZ/3XB6HfQI0lSGcA9WCqQewVyyi bJyxvjxtuFMnM3rZ7PyWIolbcXj6Y7IOrTp08cEQebm2laa40MPVFCS7IXbyWRHW/vPa P+TA== X-Forwarded-Encrypted: i=1; AKwUvBz6mFPE4IKuNWxWk5Z2B6lzZF328w49a0wZi7iJWrOdj9ZMJ35cbSbRGs33gf0wMDaXSTbni4uvAkJJMg==@lists.linux.dev X-Gm-Message-State: APuU4Z9zqPebKKLIujhz+6anRJbT9O1/4mnufW9WLKwFNX6NcIgvKMe7 aWTKpZx2ourgW/5l9wrj8Xn2fkJTCPwtXblST2lyrqdgQEKsnI87bygG X-Gm-Gg: AYBFou2PBGrbQricv/juvYNOaicEDiPx7SK9L9MtXZrjzQPBspgTc7tBLcuqaGbjL8C 9FkweBvarxoc2AaI1TJuh4yk8LUzgvj5tGf4kPYRsJxyIh6gpDkxKqSgTrhr88JbtNei1ODHU/4 R6r16pztXXPhqJJNr+e0t8oYgrsgkFwIsokdU3Z1iwmNF+W1CwiQlw2iEsOIOKRMOGO0bxpJzPN GqODoBO1zyj9ByrMS9OkMmxUd4ShGh+IAOyltUble/SvpV6s39RGTSkrI4SRzLXWFHjWtCzmpC6 IC6ttMLxjn2NwrPx7T8iJXdRENwv/hBWpIosmMhWjPrE0gswL9VWJutq6KoJvM7qeXlxWZZjk91 2k1W1MqD9BzNg3Y8a/I2V8Mtoj5RfdUkOmLDJUZUsul7FBUxIRqIu3E7ctQfrIiIoxrq2gc3Wj+ IlaIlMvbdGQKXWCJkMrR6tkmnsaTpZZv5CqyJTInZ6LfXkbB+i4DL7ISDKmhk0uGDhtFEJSxfnw 0lhucvdGtI9WaGQUgBO/47kanBDpv0uL8K291eM8Q8xDczS1zGLOKUCi77//j3xISHnDgc2mVgD rZ8RkGVWfUPyvheZddwF6QNm0r77xl9mlYirXmufSTZdWAS1aO7zJKvVZz26Q9LontRGGwccRSm Hndv+o6gOpHP90hbYWctBDlJQna+57kLtUxgy/UPzbZIDOlFRLvGTfs0Ds6vGKqHnOOsqDlnycH eD2sHxpDGRRnjLf9IO9s29gmgM2YYI5mK4U4zqlARRT2ONyPS7OW4= X-Received: by 2002:a05:6830:3e03:b0:85e:f25a:7d26 with SMTP id 46e09a7af769-85f1cdfaf90mr603385a34.1.1793911936207; Thu, 05 Nov 2026 12:52: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 46e09a7af769-85f1dbb298fsm292276a34.6.2026.11.05.12.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 12:52:14 -0800 (PST) From: James Hilliard Date: Thu, 05 Nov 2026 13:52:03 -0700 Subject: [PATCH v8 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: <20261105-submit-h616-uart-fifo-v1-v8-2-14024d2b184b@gmail.com> References: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@gmail.com> In-Reply-To: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@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-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 | 49 ++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 80b2b673b422..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,22 +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 (err) - return err; - } + 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); @@ -863,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 Thu Nov 5 20:52:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3914 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id AB2E61C53C4 for ; Thu, 5 Nov 2026 22:03:32 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-27291-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-27291-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 7A756337A0 for ; Thu, 5 Nov 2026 20:52: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=1793911939; b=omhvXaOcrrkrR/h48h9Fhvg6Td8lSGc6jnQb27qZlM/g97TTRdFNDSrGlQP9yw8xhSR3 pAJ9hAtbZKoRv4lqA2VSADYOMXjLqa1Hi95Sze3V2QHSK7sywgGSDNBEoT6gBWM8fFyIp /l9ZzSq0pA6c+7x7afEo5MylJnhiFbI2r4GHXKmVy+3woLLJhB58X//HCIe3zzRxTCrPE p/XfsuhgfgvEi5qHKUoZq5sX90QhG7D/dtW7r/+BnI2YzFFfyEIrcAaPQUl8pd7nQvAEJ WaRmKC0bNdROTUmlwbP9e1XURUMobbOawtb3qyJ0Tsk0IoJ29JFXvqhDs3JmLyrSqew== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911939; 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=BlFtiYktF9byAtAY+5+4Mnvn60V7pnCYV2+Tl1aHRrHruoTGfX0znRA+KL0SA65NEbku b/i7ryjRm/5w/fdF/EMqit/LojGb0Q0l67ylvoGMZHZPWAhIEm1VILPqlSLtHQGL7l5Qd 268OKIwu5zlY9DAcETHeomUJBrxZbPJtS+mW9Q/nGFJoZ9CCBcSQI/9EtQEY49VwVH22F zu7a/VAQ1Rc0rHsqj/+ePU/WQkvd/ayTmMwSyO8yW5SBUfJc3scXt35EbG1ltmArllk5Q XotfSUSGRWtuO0DDUkThlpj3SqgUZHFcy4rVLTT0DZ6hVz0NqT0kPRo1kDLvCfTPaqA== 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=Athtmgj5; 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 C9B2E606A33C; Thu, 5 Nov 2026 20:52:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Athtmgj5 X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793911939; b=yKDPePdWSbn6iZ9/gPNcvsaBd4+Kq9payQZrWCqX5rEQzrqlz1Nkk25I9IVp0uP1bOSu Epi6Ed04+bUyUtkwAIdYJ+JcRRwV4SHbKoyQoZLT6bOD83roFhn4Z9mHxzic3sgkItH6X f6FWOGjasTn2VeU/1HpF3+ZrkTwjm3gSQrrZFdVKvoNZaYw6bkF9KzsQ0aE3+B1Klv9yB GRLzQeuz4Ucsgtve+A1oT0gThy8icRMLYUfuj+FlvGUyfiTx07P+4T0EZ+2oeG0H3z6rk UQ5jLN0N7wWVUcl7KLG+0j4HrIKzwRT0lBvF2F6zudV5ZvZx4JmhK6r/EX7DnIxmSwQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911939; 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=Hi16eM1FgG49WIJjuZcSHhsZtuM86+TzyZlydyV/pgWvW8YcEIO+jINFb8Iy2V1LrUr+ +URh3Vi6GRhyGwj2spOwdO0iVaSz8mcAMkcBWnOXQPL85diYqUk8iMpCzT7kc7s7boMlv EPldCGNk19nv5HKYTGBFZe108PkQXZEFCGcHoeyG+KBc44OHBvbQFFaycIgb8hknwFvQR 8t5Ojr4+uw0oHFFU3zaBtrs9veltwJ+eYc+COkZ10eFXkkR52E54dc+eVcF3ZMts2N1mT UwFvgblrSBKWMSGC0CCEryc0rtgkIessDlMLr5iO3Wd9LbjIZZhFpraQcHwmMsnn66Q== 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=Athtmgj5; arc=none smtp.remote-ip=209.85.210.52 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (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 62DF9606A32C for ; Thu, 5 Nov 2026 20:52:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 62DF9606A32C 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-f52.google.com with SMTP id 46e09a7af769-8451a619da7so6660a34.1 for ; Thu, 05 Nov 2026 12:52:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793911938; x=1794516738; 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=Athtmgj5rRmHYJXIqK23x8OoeQFws8kiXV30Q5Ek6ihJksF6zQV+sakLV5FPNO0lmk s4ffg5j+lZbI40FfqWbUE2IYeqW+EaUz14OZq7zg6bQS/WwqVEfljeclV6dYGWeAzAX6 7e6IP9yX5fHSi8GBuL17uhOI4jIp5QHU0YmABIW4u79eeN3+9h95QbG4WYu3IZMKkofj Gp8xzcK1S1VRLHh3Svx0SaEGDSH5nuWmC7uqxNyX8U+qvU7Nnlg7hF3dOCROomj0Vup4 NU+s4Kgc+Ow2PyFbwrH8QuDiKTP3DFaTVdEUI1oNNKXROsQdL9hz5v/0LYnwy90GkIMb ZOgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793911938; x=1794516738; 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=2JPm7LTlrvbx5wPhY/7m+TyO1KGzY91bmhC6LPAw1+nvu7twHoqc5zbpdUl1LrHQCZ koaKj2tuUr1MYO4RPP5IxLdIIu98QG5Bihdi/E53Bh7cURilVsfORET6f6R4YHy09Unn gxNt12nMXOdHCXTQVW06TJu2A+DqfCBG22nvnL5AKlhtXp/8oKmhwaMKogk5Qx6x+88c rNCAcmmEkVDemHwDH9RHB+RnWrCWjViGBTcy4JljkzuUqbjVov4uGrIw6VT0TFzK7/Ma p6jXLhFln1bdILorCFlBUsErbry5P6DfvHJsGEVPhIttnXeBxY/BvqUcoQP89V4bGWVr 05rg== X-Forwarded-Encrypted: i=1; AKwUvByHSiUtDsG1pmxDEnqqeTFxbS99Fod/sP2dpoaQzxykBYdpJrsnBYK0nVEevx2vYWwhRy1W6ZzeRk44kg==@lists.linux.dev X-Gm-Message-State: APuU4Z87EW5MLwaibrxIAr5mV82cLuL2HogKKGMyTkKv1t+eyAyFV47z FTjzLv1BUqr8wKClnnrwQzm+zLvFvPlWdiq1FN8SF9EJ0cxfWo16UEXc X-Gm-Gg: AYBFou0PXJtrsB9lXjISxHGeZYzV4J8KuLR2hM61TCf8Y11PUqGdFfUe/n4BtSlr4n2 iWpLlvwgb52ci2+Dnju2D5Nj/cKZMelFuVbdoRSawzJUmQ7QygJNRHQ1AhdXVEJDu/sWnVi6GgE m/27TXMAOznpr6ua9x6TmzUj6hsQKzQPmbta9bvp5PWouDbiCx3amAR0qMf4zSXCw0U4faAYbhX s4y7Pagud0XjWc9Peg0iI4h78i4gbNaYvgGjBYVsBA2u4V7Kt4TeLEFidj3sXeYfWWjn6ZPnFlf KC3xBuUEdGwMkUnWpApPzMd4AV4qt/JPRRXTKadTIyWlDvGChykxr/QMKkaMhr8gtel9TQ/uwpA vTJPdQg59SnZKqWUcATes4my1g2O/ryTcSA+2249w4jup5l+h7jtr6XezFqV7yVznw6zq5z06vZ 5wVkHZcIAcAUEjwtmadPfi+sD6e1g5tRDTp530VX/xoBGGDcTA4E5JBt8NEZqHK/dsLujc+rTLA EzzjTWlXEsNYpIrsEHN3CqbvIgYufhenOQSD8U9U8mDgiuHNBHVePr6GxsVD+kVevCVUP+EyJ01 Az/x3qZFJh0YoCR3GG7vg14yuU9Ubv7yNeg8hgh+nHgX/ApD0OCg8nzCBoWZPw/WqYRzPgDX6KM AUFWbl+jge9wG1hfto+HQWrIqePhcCn+B0fOWai7/lowhcmToWlNQ33olrx/ggdNpbW6U/Qje5v Zaa+iNp866frfEJFKUxwgMIbxbST7fOdYu/mKSYJhBpKyWhzey80jsLZxpF+OnaYeviEb5bPHH X-Received: by 2002:a05:6830:2317:b0:85d:6045:52c6 with SMTP id 46e09a7af769-85f1d086f53mr580936a34.24.1793911938304; Thu, 05 Nov 2026 12:52:18 -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 46e09a7af769-85f1dbb298fsm292276a34.6.2026.11.05.12.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 12:52:16 -0800 (PST) From: James Hilliard Date: Thu, 05 Nov 2026 13:52:04 -0700 Subject: [PATCH v8 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: <20261105-submit-h616-uart-fifo-v1-v8-3-14024d2b184b@gmail.com> References: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@gmail.com> In-Reply-To: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@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-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 Thu Nov 5 20:52:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3907 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 B43581C53D1 for ; Thu, 5 Nov 2026 21:53:11 +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-27292-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-27292-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 4800027647 for ; Thu, 5 Nov 2026 20:52:25 +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=1793911941; b=hz2iqTu3chRLZNn3Ek2DtjmZG6u8BGwO5OErmpiDRxca2xdeYxX3KmKD/LXQcshXvijb kDJlB/CRK9gspbV/mQWH35hW5MwrKFrqxJJeWProd0RVczpINT4kidE93WQr3jJVeH+Vy cDpO0D7P3FqEVQJrAoEh7/RVMubAItH6+midi/ycsoHf03m8I9D6QU0ZdyjEUlJVVxzy2 1EZHA1N5veCwqbJXHL848IvzJpW5mG/Nrzi5DVLbHNO4ayPdpGgWD20dOzCTq6p381KLw iOE60z0iQAPhxRm7hc727p3nwsao4qiCZyDro28XPVBJR2XeqKg0ui19H5CXw8M8W+A== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911941; 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=M6+G+eMa0Ps9xdpFVxzIXjqnMtwI47n4hNHGsNkk4bZm08lqsoTORCNxEWmKHdTLTqCY Y7jBNpjSNwneya4B+HEATn6GI9f7h+n8IZIwjTWoifBgiJgDjcLwbV31wW0OGbBBGhqVz G2CF9FBXbz1U/X7vzOEPewRp1jMjqsqitlkC5Ubp2E9OP2Demfco1ciK8iUK4hcRnLJYY qHpJ66RopzOaDkbIiIojtyEQ7QP2eWQeDS1Y43NpjzDnKKtOaHQbehaTMwvv6G3q6Wfjz tTnJ5ZWVwohbEalF7D3Oy7nIp1bQoGGojC+/75IH+X0w00YU3YXmynDaBDRg7oDBxZw== 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=St8I3Q3B; 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 BFBA3606A326; Thu, 5 Nov 2026 20:52:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=St8I3Q3B 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=1793911941; b=f+GaUBYfacMumvr8p6QlbyziAJwoCOg3PBH9v/aPHNQGkcw0P2RjmsRMv5ASjOKZuf6F fHGKCV9Up1Cy62UCoafFXu9HPOYSNRdMXqQwk3YtpeMIWVcqN6TgljJlmZXxgNlndqf+d BBiMnYP3Pdw/KidsXvGn8e3GqqzszleZzQDNkzYwJMo719AIURBUQqPgl5MQrmdlHPPTW j7Gab2JJHfCqZJfz2mLGSH36qI/ZLR3hoWd/RF2Ck2GtBloi+IZhm9oBLZrFqu09XCp8D 5JeqUk2PbVGsvhp2SxHUbTU5lzVOL2i9g41iCxM2LLgpnUaXiKVUAjzozUq1zgTocNg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911941; 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=CARtOp0Opstt4OecdxjWfwdLJqdBja2CTCVPODv23geX0W+scMm3qTOKix25KfvvyUqA Bgnp4I0BX+2t+EBUNuKLOYQjiejQCmne5E0Sh4TpQmqVzA0lF1g2rtRYSMh3hWHjhVGcY w1xWVjHB9NJvvxEi+VnpO1szRuBcW9rjn4iKXy213cBd52RnkbfeaUvxEnj2Ub3PRLDS1 t8iueSLGqDN++ILhptHTQN4o2GYtcQOKJr0CHT1wfuGI/R8wRrBVl+bUBmreKco7c+Y+/ KI1LbCiXvU/TbuTCgCAOgv5lL9yENiBH4/hOGSf1jdAFNt3RJAgmn10B9unvq7kLsDg== 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=St8I3Q3B; 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 544F6606D811 for ; Thu, 5 Nov 2026 20:52:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 544F6606D811 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-8490a7d6696so1479797a34.3 for ; Thu, 05 Nov 2026 12:52:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793911940; x=1794516740; 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=St8I3Q3BZ52aAOYmrtQlH1Qz6yNG4MdW6zJaxJPS5FXvFclLbyZIu8O482lzhNZlKQ m7P+Lo8/9F8w/2S4zCKih8FQUiY3eN3K43KAl0LuUqsPOjZUif7xJlqvFV+0gGp+QFJK eHm1TFA+jOneWhepGCXMm5tWcOgbZKfzCrrPV11QUsMjKVnWjel43vT6P041xqQsKBEF SUQZMIbzFxumPOufHSrihgV0/Tlc+/Pz955m8xeWt0h1R+8mzk1poPpp+04zJ2BKOdvs Z2IzzU0KMAolGtJqQszJVhyvMaOyQUlpXgZrulFOCbbq71HBQa+kh215SeAGRRJ+Z8MF OT+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793911940; x=1794516740; 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=nG5GhZZW441jBQPhXZxZZ7GjT2MhO0eVl4ti+F/ztgVGje2qZr+hQLoEfeAs0Je1bV /xEYO9+mIyyeFrUzZpUzl6Uf6MMQ3EtNOx2SGkwEFynSmijFEP8MYTj4Uu7oDFzb7clJ bbNFn+jeld02zgIeExMpFDp9o075hQ5E+2IzLxtW8i9mX6dhBJ9sJsuIoGWNw/U30Q4H NyghFp+kPjbETOLF66vimcBi2DqbDtvwe3gA5rv5Vluujjh3ekrHnZ2NZJI9p6Fqy/LX T3rWKdMSsVIFgzkA0f5LHsbiUSX5boaK9bzUj9rOZwJ/+EKKpNNDSV3oNCJm+LdIieA4 r3nw== X-Forwarded-Encrypted: i=1; AKwUvBzqQWYmn6d/jP1GIwhpPgHWs0tuHroeSOHaRjjv9uFEUSY1OUjpo8aCepD6Xwn2+3RPuRPOOMVYA0Ln1Q==@lists.linux.dev X-Gm-Message-State: APuU4Z8ZXsbrx4prY1ffC4b2P6Xk8TVgWhmyYu7Adi4PrwSX5IW7waOp GYxCAsrl3NAaU/Fzycs/q6ksUy6QMSJv+j9WGK7DSHu6FeNcKjlwX83s X-Gm-Gg: AYBFou1BOjbF647nDos5KdwMl2mvlPRUK2SC1FxgAh5ArqRSx+Cf/ogv+/iMA1PsXfO I6QMwuK4aXBVlbqmlVc30uJ+dqB5dcSSPuifvZ3pFJGrssB2S3jFKhI5Kq9YdItXCKBr6joCh0e X9+eezcTeZJxuYERq+pfeyXZYJhQdTSGSueObBbJL4XUfARGhbqFaAG/Rj6oqCQeacKub2xPCgd xbZgFle23iWTEZPYAx3ejAk4IIvAhL6LVLG/A7NqZ8Knz/HMz7POJzn4KKamnj4A+Zc3OA5pya/ K7263CZaaPnpO3UmDOzohpY0ZV4fCBLUZhlnm/EXr73huYUFurO+rby0XqS87I9dyze8MIBel4j 45VGOc4BqFy+ed2GGHQF6UVsI9ciqn+1ZoqpxLs2SCUO/uJbYR7BwLxA4h4Bisfz7tUGAsSzdBk D97wa3dReMpciUUqFi8nU862NFNCNs/XG5uvl9PJZODQdjBCLKcHEKzl2vtZO8fQOAsuvw38SsM BrrqqpyrBj2LWTDe69nfIh/dgWj4Z6pGqx8ehCAknk+ikBxGlS01s3bBocc+4qC/N2j9A5AVkT5 V2esht/3DgtaznKS8DRc70nwzxUqnrk+e5VYvO00TJHL8SdLRnKkRxmpySae6NUOhwZ/BEln/wX G9LVu21luO/fCpnVvdlX0o+YK5V8CicM3kzjnz00T7VQRE9/rJrUWo/n0H/EHdqOdv5VOS3NjuJ EmEy3z7OLLkhSn31PJ6wx7xYT4u9qFlMTl/Gubjhrxt/oyZ9eu+Ts= X-Received: by 2002:a05:6830:310e:b0:821:d65d:37c1 with SMTP id 46e09a7af769-85f1d102bf6mr708163a34.25.1793911940392; Thu, 05 Nov 2026 12:52: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 46e09a7af769-85f1dbb298fsm292276a34.6.2026.11.05.12.52.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 12:52:19 -0800 (PST) From: James Hilliard Date: Thu, 05 Nov 2026 13:52:05 -0700 Subject: [PATCH v8 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: <20261105-submit-h616-uart-fifo-v1-v8-4-14024d2b184b@gmail.com> References: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@gmail.com> In-Reply-To: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@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]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[dt]; FROM_HAS_DN(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:helo,tor.lore.kernel.org:rdns,intel.com:email]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; TAGGED_FROM(0.00)[bounces-27292-noreply=patchwork.local]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; TO_DN_SOME(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[209.85.210.50:received,174.29.1.49:received,100.77.114.92:received]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, 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.105.105.114:from] X-Rspamd-Queue-Id: B43581C53D1 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 Thu Nov 5 20:52:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3912 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 6B50D1C53C2 for ; Thu, 5 Nov 2026 22:00:05 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-27293-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-27293-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 0B35734561 for ; Thu, 5 Nov 2026 20:52:29 +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=1793911944; b=EN7ppePG6qqnTpNXtxUo9HkI/xXSA2Dg1wMo4v1gFF3imo1qJfbT+S2MEdad7MBJK/gD aRNA/vyrtvJuk5nAlL3Ao3f5tJ78IZEmTRjtJJh4er6bRton4ijwoqTF/0FX371aqmQDA E5V7dqE1CEfHhqkNq+wngDqupkg78J6c6YplvpBWoB8cv+/fq4tem6uK9zflsmuKutvSp YCD5PVSfa2HR7MVMyZ5VKFUE42me3DFDDq7oy+BqOVO1HlXYRkbJMyksqDpgljzp85wWz DbxaLCMpp4+j+UNTLr4mYTDKg2ehVB19+rRc+sOyHZxTOp6BWIFVTVAmLryvTwVfTrg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911944; 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=Blzru+CMry9ZD6A2X0Y2bds44q354U9sfIP1InjOcmzkq5l+aXRhnS3PU5X7Ur4kshwU WyNmpcRhgxfoVUJ2BNoL79QJO5BHmuq+c+nfUghrrqXgubF61kg2a8buJHSL1v/sW9G3H xA4hjBB7aMowU6x2feRCwLR2Kki8wiZLGh8MInqV1FkPq/hgfTz/kaZU833HjbXNWWBqM frkfy1PSDeZjfVHeBpFJA0z5qyUb4HDOzhQh0mI3+7VcjGWoGs9bmcK2burer8iZBb/nM vHUutdBCD+CIFgihsB1PBdp0jwhMHFeb2G/XyguS/g+r3CVIS2R9GpcWudAt2XT+1bA== 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=E2KEt628; 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 0B5F6606D808; Thu, 5 Nov 2026 20:52:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=E2KEt628 X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.161.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793911943; b=qjGLqOloBstyI20yqUUJq5fWsBuHK+vvjj8l5Z4ph0myoN7ZOI4/6lr5xxW19nWNlYYb bKmG6+6R8s/1cZZp9c5woKv1sA+wkGVVGBI7W+liLUgUWUqCWQiadl8zzGjiyEdu8m2wi LwYE3PpDq55aiz1wFexK+xm3jKqrrjlQ8dSsYvPD7YX+qBbGG6pYeqvGVSdRDhz315MA1 KSC2iH6FA4AUS0f3IuAXfHnydKlF2uOjggxUP34kqbYTBFP12elxTjXekCjTB3Ud2itcZ 4+GvzcXFhbTDAxBhyta4OeA/E92zgzSWRkmYs7mSGtscZJfWSv5GbcvSFUhK7DKusMw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911943; 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=5oqNNC+zrn1VaXwq/YaTh5v6sm7I590UQvP2HuAS4Ijn2ac8sD4iRbI9uaG8GOkFUMLs 9f+UNPrVO68aKhB61uhwGHvPBrhquU9JzNnYdvmIxBAhTVrXTT0e/RK07yDxCBxrD4SVP WVV6Q3raBDT+59+XbXvjM8Wj1eZI7MCGHKLkWEAdYT+w8mDARhnKMCqru6UIGV2l5b05k ygL6wzY7pLaqrM7RghEsigXXVA6XbXXhch3xKcMY+8C/c/0B3S7e31WQEwvcC1cxXwb6/ YTpLUgdYFVdmeyZaD4+JIyKTS4XckM2MplcfX7gtWSM30KtBE3uL0SHNmMf/8hCNRIw== 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=E2KEt628; arc=none smtp.remote-ip=209.85.161.51 Received: from mail-oo1-f51.google.com (mail-oo1-f51.google.com [209.85.161.51]) (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 9A5FB606A33F for ; Thu, 5 Nov 2026 20:52:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9A5FB606A33F 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-f51.google.com with SMTP id 006d021491bc7-6de1fd5f572so1976eaf.3 for ; Thu, 05 Nov 2026 12:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793911942; x=1794516742; 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=E2KEt628VzffzCznmRA3Y7aYXkVqQ/M+0l+ExpGya31ULtaq4InO+QpOir3tTEvCaG h0ZTp6TNzAc7yjPCjALe7qJ+CqcqGgGaAotKuuxX8/T2rFG1g8UGedSsli6mWU6v0ZZq w9IMhWsR+CWNRWdNC4xbvlDU60pMRAh9kxq9oDLJuGf2+UOc+kdhSRNRlbJHa1r36rkz ZDTJIlgXJu4enkpyWIBVdoV729TLf202ljNa3V+jdvXPqoN5mItAZ3BZ+S15ZYuRR0FV Asq2XUAUPM65EfUZyt6yaWJ+rwY58fQwTsdw0LejiuYmq7FzGET6W0vBCw1OrOsZjr+z +0gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793911942; x=1794516742; 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=GmKj12qACxzXUJsl4f0lWok8mLBXeXG2Sb3r+3Qabl37WNGga2kyBhp9F87ZSsznxP wEIcUdYgGKG4Dlm30ubCQAa9g9k6T5mTqj3kqJ1pxzbgZeA32xalqKxR6lPyOZ0UJt8t 9JVkzQxAFv0KEmuH60HP7jsF5aznxhGVBpWCnxpNqOgf1U1/oCROHXfYzOKKs15+1Hqj Fn8Bnkfn4mklFwHYPjjYJ6B4+3/6mhZsyQWNhuywco1D+O1T1qwGtVYbJaj0kv/5DsnG jhMJ4xg+IEAR8yE6nlcldU9PtznLl+j6uGgXWL+NHKiFnRJfGnBjSOb9BJL9mim+T0WQ DN4g== X-Forwarded-Encrypted: i=1; AKwUvByHWqjvKIDHOZHQ+pT5PL/6HFXm0pqVamnbZUIce7CNUv431qZQq/qCMLT2aU6qkOUOa8OqQDUUTa2Smg==@lists.linux.dev X-Gm-Message-State: APuU4Z+Ak6UrU9RlA1lUkjfQncdileFbG2ZQHCD0Q6F/z3cqEhC9o+Yo JZ70LOc3IatOnuAwpkYAgv7gQEk/UwltW2hUsP+vYsToFd20hJLQUuE+ X-Gm-Gg: AYBFou2PUhSFDHsIWxPHbeqx7G0WxkQQUemS3ECg7aj7LLbvue7C0w9AS76Wb5qAH8h 18fEVk5BaxBdhLjDLuYJdUVpzBck8s+As2QkR9NsSs81IoZ28IqgDunLy/YmB98Pv0MQmQWbECD 2/nEiq/AWQMmut4PadYymIjgpOXynGyiTpG/aF2rWQuML5AcN5uCQeUKEADPSh7fcVRtW/TNo7/ DiwHQ9WssETeG8n+R5r2DkLom9o5Yg+lrZ3LsN4XyYnvngAxyPWUV9EElgnBItoQoqZYpVxJmFy 2O/ruMl7F1lVB/lW9PU5UHPRV4OLWg+ia/L2iANs540ydM1isBjIndqj/VvjGy+IAL0ZEQSzVj7 7qmobFyMdj+WHPfjA2F+Aft0bhHq93M7t/cUWU5fuiEj4ZnBBk4mqyZVxg+Y2KtNjsck6/TltRC qnQBdoUpaH9o1rWuK7Ey70/ZrtdXoubbPhJfk0gzNLqja74JMNbqibF1EuzhPQSGDucNba/vEq4 DSZ9iT5BcS3kEGfuSHeKU24pAYKM2K4tR6bbp+MyjWp4JYnQOBCZrdrm4yw5H4iOhUuz7cqTZit DUsTBfx0/R5XbTBKfmU4yA4e7854N4hc15nm0dvSJwGc692p1jeXYj2j42DDmRoBSGHJdM/wsZO tPVm8KJzeyHbNRikfhT/fdj3i8uMOGKL5ZHe76lqJq9mZqLX8koybnP3TaOhI6O+yroufKR+5UR V8aPQtVF3Bzsyv/GHLa8f+O3DuYVeVjXFxLD3mr1mAQamd1O/L15k= X-Received: by 2002:a05:6820:1354:b0:6f9:59ee:cf9a with SMTP id 006d021491bc7-716e73d88b9mr513073eaf.7.1793911942466; Thu, 05 Nov 2026 12:52: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 46e09a7af769-85f1dbb298fsm292276a34.6.2026.11.05.12.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 12:52:21 -0800 (PST) From: James Hilliard Date: Thu, 05 Nov 2026 13:52:06 -0700 Subject: [PATCH v8 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: <20261105-submit-h616-uart-fifo-v1-v8-5-14024d2b184b@gmail.com> References: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@gmail.com> In-Reply-To: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@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-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 Thu Nov 5 20:52:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3909 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 7BDBF1C539E for ; Thu, 5 Nov 2026 21:53:43 +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-27294-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-27294-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 C195427FDF for ; Thu, 5 Nov 2026 20:52:32 +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=1793911946; b=VezJ/BkPsooyKInuix7SBYNBSz7DPq3NgTguayMdaN4TUYNdvD4jq1pzVmJPppB7Mw05 +Vo3/kXvx8XfAPWkFhT3UI/1SL91Q3F3aafONhGHEakFz78h7YcNrWvOlFo8AOiVnqY8Z 4YO4qhBDPRcFkHzU2i3UOIxeFMAUPuDqqCTGVfwcRPFYd+4r87qCDv8GqcJd/EPRYdwC1 naQsNgqwRellesxEWS9VCJP9YzJz4b4U9vjQXWnF8FspUfmVp4uv86Kdbc6qfqo5g6GlY yKeaJ5MqpmIzZVh1dSZVw7ip3NWDKSJvOkRYQcDRQoqCoUIFTN52NZJMxsye60CLMiw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911946; 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=yx/SQHSaECwO3aUrTwOJ89YfEk3M9Oew8ijNhTPXOi0=; b=KfbuVYejS8pF3eygxnPwaSZ6WBGD6aOiIMkCNqemBVtOQ/i7f8IbW7iP9Nrkq9MSEs1J AATC6gxkXIEYL8hJ4bW6ot49V/YzlFVO1yyYn/LKx7mQakfTeoPpEObFkwnl2J6Oo/wcF rNB+Px+nVhMRUvNrqSQX3DcWCFBJ1SNOsHUJcwUenMLEg9bFXzo5wFk12+w1z5VoAfB+9 pCDejeCZQPgFG8DNB4rgpQg2BlF4VFst/xjiS0YLfR/a7jMM2783PUgC1EK1YdnYO9O4o RBkhOpUM7C02YvcBhiVGXJk3afxzicxt/jUzB4NMw2PHnCP5MEzjmVbukkIBrFTRBzA== 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=yfPTRMv+; 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 E13BD606A339; Thu, 5 Nov 2026 20:52:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=yfPTRMv+ X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.53 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793911945; b=ihlj9UpvleijGuk07sMKKAH41aIBM6FJrUDbo8TjR5Uxkx0IHc56S9NqftihK/GffD4p gQ3cFSrS6Lpz5Qizg4EFsbDguqlHF9RIFxb/NsCnah39Z+S9bHVBKIKN+CUKPTPeVonEF Tmwf/EjhWc2+MX891B0UK163UqnyGBf7f67XNtL+ZJAUV+iLOXL8USbGyk68u/U0Vf23j soBQ59lEONphXUzEtFoLuiJZmzW4HnXLRZ911lw5Lc4yNf6vXqBGZh5LcgfKw/bphcwXQ RJLzoV6NkiaysA3MGASMbOEXObLh3qdrk2Nu7gChlyp9jHQFLy0wAPBBq/5WSFCllzw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911945; 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=yx/SQHSaECwO3aUrTwOJ89YfEk3M9Oew8ijNhTPXOi0=; b=HKfyam/m00rvjXSr9A2iytpyzgrKFJPQ5/CBTXyW2QzdRad1A1okJFyR9EjE1N0iIoQT KXk6OAhqrVU4NHW/RkjJQhHks0hV06iWqr0yMI2zHqx972b9xGF6mLzeO8klvhFQgTnS8 jdSJtuoU+7MTd2fTMzkO6I5k1hdGtwr70kYk6jDZD7/+yc1U+zSvNLsmCuUBeWtObp7ud hwdMkh4ab+Ej014NtDnSOXWHk2Qc5DgU8p9Ls3q/x9z40uvHMxRXyGJlXrLHl80B9m4AT tm4ZBT1gpRx0fN0M7DVue6kZZv8XVfjma9UwuITOj3BRkI9sgEpzm/k3StkdbM5A91w== 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=yfPTRMv+; arc=none smtp.remote-ip=209.85.210.53 Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (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 73877606D803 for ; Thu, 5 Nov 2026 20:52:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 73877606D803 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-f53.google.com with SMTP id 46e09a7af769-8256106635eso10842a34.0 for ; Thu, 05 Nov 2026 12:52:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793911944; x=1794516744; 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=yx/SQHSaECwO3aUrTwOJ89YfEk3M9Oew8ijNhTPXOi0=; b=yfPTRMv+/XViRw9rL1uNvPoRMGeAeeWjWNEFqKb0QHuY1qr1fhEoGuKbJXFz0iKxfI CHJuiWKTBD56fWSlrLIKPY9hYo5Egx8ri8R8j0vMCNa64zQjOQiTBmaulCghs1OKkmp+ T2rzli/E7cGGtZtd2iOP4E1rvkMBh5W75rN8mamXw+8oV5a4ZBS7jUBrSEIo4dPz9KvD QVr5XZTsAuH0BP1seEX8aDAOvrC7A1beMeYQMDJq35ztyQZ2Wns7B9C3hrcHUJ6ZHH9m 9nu5fh1maWN3v8o1mp11lMoIJIE7cLE3+xXeMgIh2qdIjyWgCYqG0mh7mufuyzsX/bJf gOqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793911944; x=1794516744; 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=yx/SQHSaECwO3aUrTwOJ89YfEk3M9Oew8ijNhTPXOi0=; b=qqBAHNMdzxI/7Gf5Lj8lWP+cHPlP2uU6qDl0Ib2Odx+BL0Tt/CPIx6vqX2GoQdag2r 1KKF263Ceo2/ZmF8mMht5gVFytME6GnNChT7igf6coEV+xU+9/69mfun/FfmkjT2e2sG yq083teN0iZzV0Ov0erj2E8+twWzFFGuk6zFyidLmRwkEWsHBu9f/0/T7FSvQsROQL5N 3+VSZ8QThcPWBk+kVpelj79j6RqdRJBocbFZ3kudNwvdhd4b02qKOqLlQpr+2xXa5JwU cbImvoGx2mOlUm+H/ycV2/6pUP4XHec+z6vpF39TEXhOcoCV7y6oSzkacZmkrrQg65M5 v0kA== X-Forwarded-Encrypted: i=1; AKwUvBy+/CdPjpqbO6SUgT8mCkKYJ6LRSPI4BJUY8fJshuftcgyExPNf1A9e8SX29WJEzc95TudxjY+6eJ3hnQ==@lists.linux.dev X-Gm-Message-State: APuU4Z/eCDb9FleAzOtKG0Cny/PHezMvW5Skzp4A6I8IvQAph53eyrDq JhGld+DO8WIQvqOaHTnIA6UvLRGoU/BS62sKsGzx5mQLvqr41ZzgGL+P X-Gm-Gg: AYBFou2Djq7F/6fD0YtIIEn3sHzezhj+fP9b7Uk8GJ+I1mBYHwBZ1fD/1LxiTvWcAKf gzQ/IhgfTEFvLzzhuQt1API2YXmeiwHBC1O9TL4iZaQ1XEMKj1NsqGghA4aWc2KH6Aj7KiNTz4n WzX3HlLxttw4p/UyhtL9SZSTwHm5yMXC00+S2B5c0w0m1PRq46z2K1LSsRiARJDnxbLj5ZzuSDQ 8LjGRMn9tBS43ax5H7n3NmDOo7rrDxSqsJC6MGCGjKMwrn+NiQsE2Qyc1pgT4aPLo8rtMdk0l4d Dna+KW079UX3vyWRn8pOZfl8lRIZdz63BSyv2VRFPZBMn9waCrLpHBVA4olOZtSLTIXYm4mVGcV Tbwr3ps6nIJnqne1dsVkzIBpevmXP8vXyQCmMNDnqIPQ9JKZsM2lvC8X5jCJ23vyRT9GgT5Y3Bj k2jPFjxt5wu+CqgLFBfK8BW1MTj0ebrUxjzR43ddtfyKRdexmX9WFtDZsbj4tZ1R9XZiifGm6CD ahJcgyoV7i48qHP+nbcxXYlEEFrYILLxiLYmiJGaBdGHY/mLZlDPF1rVugBToj8kHwouP0/IMHX 4GEwuSE1DhUGOIsExzcmSfjOtwH6tjQgDA4YTslaxVmkM/MiazEicUDN2Po9v864wSTjqx7FV/K JAIvLNaapObziCc1fgMZwLbz8mePrGi6crcrU+UtWVnF+fuQgLZ2ee4eJu/vwSaPRH7dKsHSbEz m29h76csL1y+nXjPcWDtmy47An7o4AN6zUVLVrbVgxNkc0wdcKFAE= X-Received: by 2002:a05:6830:2315:b0:81b:bfb5:26cb with SMTP id 46e09a7af769-85f1cd702f9mr700233a34.3.1793911944568; Thu, 05 Nov 2026 12:52:24 -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 46e09a7af769-85f1dbb298fsm292276a34.6.2026.11.05.12.52.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 12:52:23 -0800 (PST) From: James Hilliard Date: Thu, 05 Nov 2026 13:52:07 -0700 Subject: [PATCH v8 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: <20261105-submit-h616-uart-fifo-v1-v8-6-14024d2b184b@gmail.com> References: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@gmail.com> In-Reply-To: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@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)[]; TAGGED_FROM(0.00)[bounces-27294-noreply=patchwork.local]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; RCPT_COUNT_TWELVE(0.00)[16]; TAGGED_RCPT(0.00)[dt]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:helo,tor.lore.kernel.org:rdns]; FORGED_SENDER_MAILLIST(0.00)[]; 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,209.85.210.53:received,174.29.1.49:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; 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: 7BDBF1C539E 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 | 88 ++++++++++++++++++++++++++++++++++++ drivers/tty/serial/8250/8250_dwlib.h | 2 + 2 files changed, 90 insertions(+) diff --git a/drivers/tty/serial/8250/8250_dwlib.c b/drivers/tty/serial/8250/8250_dwlib.c index 4a06dec6e263..004817cc8f28 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,86 @@ 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); + + up->fcr &= ~UART_FCR_TRIGGER_MASK; + up->fcr |= 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 +342,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 Thu Nov 5 20:52:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3908 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 A41A71C539E for ; Thu, 5 Nov 2026 21:53:11 +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-27295-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-27295-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 7F41960294A for ; Thu, 5 Nov 2026 20:52:46 +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=1793911948; b=xVi5grwZxo5a6CCPvEP1HCdbfB/a4S5NAGylPHnTM2m38k7wJEopDmz10lDVcuerzaej VbiYvDL/tHeorDZVOYhL3syvJn8BmTWyvvztSXfRh6wxjWpkKdNKTv9VRBpa4LbXWMeUq S2ougXvzSwJvwj+avn/TjPMWzpZUmabK+1Mjmd/1lpohxZAkwvwEevSlPVuvHM6PaeCY5 uZtIo5geYt5miwJop8M3mC0aF6Q8t9w5OnFKjiXfT+gTPoT9xcYQWOXaGj4R+ME/y7xXP F+y44ymQ/QcYQ6t+3XJxecsz1KQdbTbiq3aEXKQyzbjsPyXdOE0d12noEdXzZPWMcHA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911948; 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=ZqH6KlXZg157HMlR3cQWtS8BUufzM1BHrVYLm9cQllj4jRXO3TPTx9XM81CBSc7PSmXP /NnL03+pQTE9dHY6HnyBlXUdm2SkzqvS86A8QrVmE2A8LCSK2sx0w7QlUzMsX/eeAWOxk 4JotmQHLjez2NxDBfLSqs1NI68rt2PX2fMahQgfEt15pKg04ziFgDn0mRBtaxP7T/hErp YRFOzjkn/RDvpbt2ewt2JyQzCVk7+9WVqsWFVM6Y5BBtsWlZ1RTghyi/83iGd5eru8dSx GJKE94LmvOpfkRqvAT1Da90YTAQZr4mqLKg2ED9FlLaWE7X/geCm4JD8g1b7Xv1PwNQ== 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=pCxRosQq; 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 EDDFF606D832; Thu, 5 Nov 2026 20:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=pCxRosQq X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793911947; b=fOmdvHXAeXrEjiH63VKllUUTRM7XqEd0bq/5V7qWzSAqoXRrGYhQX1lUryYXrfnfrJ3t QHlVc8+DhlW0L6F3a4PFvu/WhyvUqBaPS3jFIBVIz7xjfgFiRXwbyiBNLdsZZq9pzYHYB V8DUkrcje1tCsxoHLD/JuwHf6SSU8pnBZWGaaczOXu87cc7CqIcbuwDEw6IZNKVU+1oAV xT9riA6pKnaX5uGKxo8VM2TokVKP9+Gc+LcbvkcaNgnOlQmH/YFHAG3rDxyim7NmV2WwD FL7QyoYk4gWHVvLfj+9Tih3LN9JEISZSuO/MwMoQjJ9bjfuYJFKp2guNGKg03YI91DQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911947; 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=1CgUfzQ4KmhvhSzl+FS0R9Lex+t2YA++403VUnJiwtpOZ4p3LzOm2ub56ZdrjHZhxzua kkhIJ62MksrOpK/SFBbGAMMXfc/hwoPEqIhF+iMJ/gf7w8C1rP4e0aJ1IO8xAlJNUtuo/ RO02LThzBdt4LtTaKvm2Go24ldmI4FBH0XMkNe36TGsFkHcPol15zQezavG3HtlsRhVUg 3gTv/W8liA2HxsZwXQOyNxRNtoiwSIF81ESOxhA+JL7nvCVUr3a1yo/H1tXiLXlYiACGc /N4Zim2eMs2sJcdkRAj7q2v/FNEHGVNcVeHzv0wh5tVIBBMh/Eu0+F2iZzYA60rB1MQ== 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=pCxRosQq; arc=none smtp.remote-ip=209.85.210.52 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (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 89E66606EE80 for ; Thu, 5 Nov 2026 20:52:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 89E66606EE80 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-f52.google.com with SMTP id 46e09a7af769-84e513877a3so1087383a34.0 for ; Thu, 05 Nov 2026 12:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793911946; x=1794516746; 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=pCxRosQqW4q4XDnP3VWeU1rB8laRpeM9I/vOqsmwAyFQbGnY5mpiPC8H2zvkSuDv0x YI2bTOIjjNv7hY5iyuTIgOkPryABH11NX+R7/NMtvjscPgeg4hIB8bV9O+Xag21FfD26 4mCThxJfrDAzk9YPfzGlmIdOnPda541ztbbLePkcrq0PFmYRugVgV9xRiXw2i49/Ffkc iJRdB8WlR7Bvq+l4ivhVTX8RrXqbQVAs84bNNWoaC/hEHtgyrmwOeAy7PeqxWryXhILy Kjx1qci03+wCFXs6hk5ZAJDleQTv/xzSiNfeT05tLySs5Y8ZaUT96b+1LrnN3QtYQGkm jVng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793911946; x=1794516746; 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=Xk+fgv8rYTTSZlYv4a1ahXV3cL71IImv5+7GmYqA1mctVQMi4fPKcaW+F/r42Cd11q c7CFDc2uof+r8FyHgcrwzmoT+k/nHNCJevUG/lYaWvSpjilV/9tGUZNPm/nwoxZDG3Wb 6Y6cFTxU3wb0W94tKqhoSFzPJzf5dH/DC34tUzp6/HkGbRWc1YLPPudJQYnwIp5P8N8B 7FUmld8wvHlaPcu0EnTngURIfW52yTpjr0lY2zAuFAPLssXDzMCepxLocEKrduvDrih+ oIcTfXeKite1BFPkhZcxYztMUxnM3P0c3FF+tm18EpDsOR+h0kZ1c0MdVBlWl72dK9Pq blfw== X-Forwarded-Encrypted: i=1; AKwUvBx4As92iU7PX3c/wCy/9hWfHRoIIqpLdooGXxBdl/BCZyMl5lVuM8YgLaOXCIiadmUZyLyQ9j/QJpheZw==@lists.linux.dev X-Gm-Message-State: APuU4Z+a6xkRKTAsF+pY2iW5GJWF1bN9JkKStkra+FzwY2g9yXRI5XOZ QtOLq0TLutltcLgNbavtr2LyfKnSeQkAIgCfME5b5UuFno+NF137jyuI X-Gm-Gg: AYBFou20paCsOEOvanicd81fdsAyCWbBX8p0NdI7WlXmfZ5UyIxsvnEld52zDotO+9d PHifC2r7zVQ3D4hiGCqLirOfNwAiDfGbXimFtuWWSbHxQXeBkqtvFZY3Pqs+rTybbuVAtyXOehv nQGc2Xk+CSE+B6w1Uxxrl89LPI1eTXtC2n34FJrc7L8Nh1mrA6Q3JFi2KF2uvoI6enOb+9qOjsG B6yfMgJ/1aZwL8tQLHO7zbSWrQeidL7+bJ2V3eMVbKoZzbRKf83aocNrmEEmI50OaPU3yBFSB6C vk0W8BYWiHH+mXZUqMX2FLaojBCpYT7RrFiS16VmwvgVtbdMIVWZOBsJoBICknCJyBLPtq4J/di wWrfpAAzA5MY0+xIG3uryu8aBCyW5wnU3OLsguG0pDwtRtFi9PCLmwziwUvzmTPX6CD2JxyGQup kuwgHVvLoC+6UmdOQoCXiOjCaeFprvshAcAB4g8BvBUQXOKtNC5U7PE+NhBw/pHFo8AGFyxFENu iHF39u1g47+GVMAc7RZ5UkPjdt30m2F1lb96/FFIE4k39hjHQz8uYH5tLA5Ew5v9IetjWaBmJtn 0pyOqC6UgvoNsaVXko+j65fZT3bxJAyI/FMjjIOZUB7rLeYDSfR7nBOaKWswhYJfOkTW3Wbrov3 1ZQ5xEOXZsaSNAUpg6seklcJfvfYCsKC7yxsaukEmRcFXDX4dy3QQlClI9cICJ/0AJUE9yP3Mas Nasw6bIerd5JqYUzRmzATcYX9hrb9loTivDRRityaDh5/viLUin601PADKZbWFMFMmohcHhZIg X-Received: by 2002:a05:6830:2b0e:b0:81b:9104:5ad0 with SMTP id 46e09a7af769-85f052a28b0mr2500096a34.0.1793911946474; Thu, 05 Nov 2026 12:52: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 46e09a7af769-85f1dbb298fsm292276a34.6.2026.11.05.12.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 12:52:25 -0800 (PST) From: James Hilliard Date: Thu, 05 Nov 2026 13:52:08 -0700 Subject: [PATCH v8 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: <20261105-submit-h616-uart-fifo-v1-v8-7-14024d2b184b@gmail.com> References: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@gmail.com> In-Reply-To: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@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.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]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[dt]; FROM_HAS_DN(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWELVE(0.00)[17]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com,oss.qualcomm.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[sto.lore.kernel.org:helo,sto.lore.kernel.org:rdns,qualcomm.com:email]; 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-27295-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,209.85.210.52:received,174.29.1.49: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: A41A71C539E 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 Thu Nov 5 20:52:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3911 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 8F80D1C53CD for ; Thu, 5 Nov 2026 21:55:48 +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-27296-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-27296-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 30D8E2ADA6 for ; Thu, 5 Nov 2026 20:52:57 +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=1793911960; b=h6qc5dpUg/DoODz/Z/eC4m8d0aKW1NX2jMYmsyak4C5m6xMx7dtexm/EN3FNQUpe1uyJ gC3k6td/d0B6bOcXR+nH/LglbUeyuydET/Nu4909EyoO4CnUET9SVoCl/MxBA8nHIx+xx HdJPJNcfOfmlq8KGmVbP2BPost0WK5AEKTPmpcPbdeerSQpqnFmgnkIVCJBw1W8OmQG/Q caw1+eK0ju89obCrpIb0EVvd30KmkQuT0poMSEN0qo3JnH4BfNctH2UBCt43viVjIxa5M sqse4it8iXpaJqEn9eoZ+F+7Hm/+GomMxWDGRTdo57YE2tzE2HhBKDQGFH9a7kVFzbA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911960; 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=ag1RY21B4ohynFlfWU2p2DgnanE2Wo1ckl/pYngei9EV5p9BXlhIHX+uY3wPBiG5GFVJ 9lAsxg2hhPTXjkC/4A0pT4yEaI5rugHKDhulkZfL9Tjdk6hT89wVOLnlbLRoLqWz14+jp Scj/+hM1LsHGiKlbfhkOE66Kj77lNa6jz2xEuDusx1qjQNOjT2GZm7ElGIn5n+BnbCOah dZsnXGz1MAP0wCiSKpBaJM2gky2+sLKioJtAzpOH3zpe+FNHQiNSfZ5qcWz3YygHi7jTK K8GiD/QMZkalSeVDTfZOjgBEd/XAo3f4yBCcGhRPKehs52GSvMTdfVvMpC4dIzdFKKg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 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 BD23A606EE9C; Thu, 5 Nov 2026 20:52:30 +0000 (UTC) X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793911950; b=wbT25Jt6sdEfoRFUo53b7fXVhFfqT9kXzyXI3/6/Cj1cxBD79NQDbHAcs/ewY1wBVLx2 A9PrgV71snWE0I34dbKUIvY7cZz+MF+Ju/Q+kflxqEKmt+DnY18gcNQ9/9lA1+5mXvMdE vI59un6pQ8UDtPnhz1vS5TaEgx4So2Y5VoMctlPVeAisSiQGJ3T0/1jqTE1gQWSj8Kjn8 PSdEjr0oVGtUl0Em64ncxsSU2nOomlJGoMHx+4QKXQb7QB/zwbt0xccnKKERwwLh01Hp2 uo05nqByYg1CFS9017qcMfhdr7Ifu4FkJt08XrfBDpOyHYq176eb6dXSpHykcLoUacQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911950; 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=M8VF8SutY1CWkx0/poL8Pty7JN4EZ0mFfmUBMjuVWZlJ9fIl8bPebxT6ChxVSe8ZSF5a mcNmnSTFyzUVYUW+BUFn4h4LbM7KMLfEJDTnP0Hcmq/f5fHKmaFhrXbchd8q56Va0/GA7 jPQgZ/e2V8lLzQRv5iC9j9+zMuGED316yNEh1jegjR1WGGDfoU3YmcYFDDMeZxM+Qz77L bYyiftwSd/iPtUY0wVacMVwK0Y+Y+qvVciLykuUKgDdZT+PSrQqyvtrZewv6twET+zHUs yFy+Y8eXdBC0gXtvy1RS1XMm1SFpp/2EcHBE/AVV5ZOULtuaMr36o4C8BWu0Pso8LdA== 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=c8c6Piz8; arc=none smtp.remote-ip=209.85.210.46 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (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 9A007606A330 for ; Thu, 5 Nov 2026 20:52:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9A007606A330 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-f46.google.com with SMTP id 46e09a7af769-843b6f8e2c7so5127a34.1 for ; Thu, 05 Nov 2026 12:52:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793911948; x=1794516748; 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=c8c6Piz8lVpDnHoKqzGSNGx6CpIkw9dCw9CblsEZhkEsMmO0Oy+XIHPJULYcsJmkyN YUiJea4vN8oUq/qkf66lNmujAe/bh8zwoGztvdW2jTm0JXYryzd8ms/8ondvn3jiOeoB truoh/3ZkGYNqVolk7dxWXF3prp+hB3GnxU2/UUFN/F64pYuRJc/gra8jC4+4CeugYn/ zi8yVT+304tyhT8gepH1MCS2rcoshBN1vwdZAu41urR5m5MMvm26xyK7/xanozwbXt19 T4W2iVMlIgpE3X2UMlSI8JSMvuuABbGUmxrvhIKP73SxMR4TbqvScXrKm2Vf3clfLety TWvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793911948; x=1794516748; 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=iUmOAPpUJ5eEnpTKnYxvyolya8ZOewZ7FtgSIDd2ppV/SAgXjrgg11DUqv+EC0UIzz hXsa6WeSVlUF/iU+FEjITGo/hqntX8gzc3P+Qja4IkdTuxqGRuLJtgiwiJZgJ/1MdgPa CYbLP/6kvPrxk4Qd1BK2WqcoEkN+Ck3snKfhothsmSQKYx03+ETMQXqBR2Q3QBnHAvMI asoz/04onRk9XewNsPUvH2055Lw5aytZji0bHATfPM9a8hlstgnP9ZFnwvTmYg8pq4hz ccjuNHxh5nm+bZQaEq3n2IkZ2LzQn+weGHuWyt2/obwjSxajv084/w9QH5szAsl8RQ5t w9ug== X-Forwarded-Encrypted: i=1; AKwUvBw0R69WCSrFS7QW8ZHECwbJ+aRRLncgxQbb3JZg/bqRZjFP37qGPPcBnR6no2nKLN0DnmTcaEl05kvJOQ==@lists.linux.dev X-Gm-Message-State: APuU4Z/66cGEEYajvh1scsrAWcSlWuYeVak6a7ywUrWNfCvjgL4M0r/T CG9mCWJYKcz3qWmCT6k/0hLOEnlrYkCzcfGDj4uqzj4ms183umx1hBlGr/7wXg== X-Gm-Gg: AYBFou2xIE70gKozlGnNbZH+taQIN0gy9Jx+urNt3xzeOBzXwqBv1ke5vJjdBJ+DVCu /OmS4+qvSgWySZlviGLhXMQWDdHwfWNHyjqmJI3usCUDcCKdB0h/5QHy61rFrndAWAGsoVc6Be5 +MZysN7UgqUQyRk47JRDzL7KOwrgjYcSDa0K/V5Da6FJCVMhoBmTKhkA4c9NLtEaUv+a7tHY4QC U1K+lcrcH0YWSaNLdacXCv1f0+QzYlT4c1Dj4i7Xn1fqG6Zws+NhaSPMwNfD1gaYoPHUgl+e9HS WDErqkuIKHgGiJkE/FN1ifR7Gv/ZtUJXDgwdYTyAGjhEkiqgsJ/KRD6+JJnXc2t2iFxfWl0ucrm tK+ShJIpZ4Z3RFe/9W3yzFydZGC9nXk7ig44AoNPBIwcT+INuGb8WaI9zkpSbLinSS9eh49B7oC O1hngglcXP98svvuXqOO29mz45AhZ3gkJPwzQf2ABoHofDKYZacoKriM1ipFT8A1mFIN3wiAaEX aR8w0b3NSFCZtgmnJEYrrAOWCFrWv3aarpTA0FaWasSaN1kcsUFsDB+84TDs8Qrm+pU1ySIk5KN f7M/yB1YcuTVQR1oFTYBUahBz83hEB5zLMguLuKKkEep0aalfp6imXjf1VM8RQbf3zkPV/gg1+R Eh+fuij4Z7qL3K3UbGcgqbzfKE7Sw9KYwYpfEk2rAdrHuqcdc038agOCue6UtXBURF7Sr+98rvH JwmCyt2MPawDmM3VBVQoVQc657ehf5bBp5j5IJyEWLMG9TDCeUa9c= X-Received: by 2002:a05:6830:82ee:b0:830:43b8:72db with SMTP id 46e09a7af769-85f1d0fdec6mr511917a34.24.1793911948501; Thu, 05 Nov 2026 12:52:28 -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 46e09a7af769-85f1dbb298fsm292276a34.6.2026.11.05.12.52.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 12:52:27 -0800 (PST) From: James Hilliard Date: Thu, 05 Nov 2026 13:52:09 -0700 Subject: [PATCH v8 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: <20261105-submit-h616-uart-fifo-v1-v8-8-14024d2b184b@gmail.com> References: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@gmail.com> In-Reply-To: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@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)[]; TAGGED_FROM(0.00)[bounces-27296-noreply=patchwork.local]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; RCPT_COUNT_TWELVE(0.00)[16]; TAGGED_RCPT(0.00)[dt]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:helo,tor.lore.kernel.org:rdns,intel.com:email]; FORGED_SENDER_MAILLIST(0.00)[]; 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)[209.85.210.46:received,174.29.1.49:received,100.77.114.92:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; 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: 8F80D1C53CD 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 Thu Nov 5 20:52:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3910 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 B0EF91C539E for ; Thu, 5 Nov 2026 21:54:49 +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-27297-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-27297-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 18E6429C10 for ; Thu, 5 Nov 2026 20:52:46 +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=1793911952; b=ZcWiZW6PE3b6rfgAKWa8FMVgPSaeD/EZSCgP07zKj+ola08Ot3G8Z/K22j0GuAeduIzY 8B4EudwSJI/AvIddfjA/FIVeZ7v2SitFF7lqLnVShYZQhM9Z9e77zCKS9PbBvmZFmKB9D vDSONpc1fS/hMjZkQ96B9LygGMQehNqoEWk1qFH34Uhyqp4IOCvGQXjrftMNHs7s3awfY 1bBqtuoIXGDvc3WUUrPS0rD9GHYOQhXSj7hyP+vZ+WRIlmq/GfWg/OGG9zXkGUnp7tonz 7wKWmIFfYxLXU8AZfJnkO/9wAy5qOqJZNqa4jn2SZlnqVnWatZxVCGkuByJhrd74Atg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911952; 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=vwBTN3MDwmjs2Dz7TljvWRD5iXPXchv7BWoHJeGp+BV4YSMH4KCxMfxLDrM/HwVnXvnj naWYSpHns2Hbp6pSqJJ8OrFhgGiBXLdzpIy+U+/OTl7ANkpw6q8iV+acQC7tFDNZh3Atg fXyAeFvKoYlFGou1Cw06n0ulAbT2a28F+mcoDhSQHjC3rnIyhX2vSpH/O9GTMM7igM/9p mMAGm5Kk75LQh4stfA7/xrlo4n5cVIzTTVVxNG/ujthfjzn+qa1dhh63bicWy5kBl3vNi BfiXM36ksoaaonC1M3E1+DvCYXn48rtDfvBnants2MWdaiEFKqR/hnmb1kQeynSMggQ== 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="OlZzi/da"; 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 99C44606EE91; Thu, 5 Nov 2026 20:52:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=OlZzi/da X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793911952; b=0MbD2NoI7Alz4RaAr3vG6oXQuRB1A259UUlqtOcb7vs9Abx3hFkKgkaIQyXDfydL4jis +yBkEfaqzJBl34C+4aRiyv4zTQwher1ZEyH3T8twSGCwpTRI3PLvQ2tSCAV6Ub+DC+o1/ vF71KfsR+0iTGg8xDu+gnDWIF3OqX33LxVk3j52wsfhVENFROY3JWeAfT6g+xTNgae4In qvu9iRHpwTAd5t1TF/wRrjTNKB7t8b2U9Q05wLH/BPfKEerRNFRRxkJmFjGKvYlyaNBuR Aq3ykIddOz94bioN/rUbKpCq0MbJXG2OTApBQsO5o0/MeOLUtuNIfH1QN5zGOtyTf7Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911952; 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=Jn1R+jK2Mqh7oYf2OHoIjLF2groYIVemE0xGncKye7OrvyBhL4fgGYjNA505Sjupa/04 On19VLyxZkr/IAvLw8Gvx6u3IzzUCQoKASBeXzIpjWISF05LEOK7wbEqAx0GQY8r38fYI q98EHZpUQh24RxPkk42KuPXDx5G40nzVaV4wthSp6Ajs4sneiaJMhdG5f4lq2f5Lsw5u7 VQzFQwCORDq6trsnze0rG4xZiibn5xCiYjAWHlE4IB7Au8NNign/k+BTT7VaDABT+kY89 Xf74zvaOKtkRYBRYxkUEtpl32H0OzCjA8fZyiYEPDzq1d8Q64yn7yIgdahiS3nY08ow== 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="OlZzi/da"; arc=none smtp.remote-ip=209.85.210.47 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (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 AC687606D827 for ; Thu, 5 Nov 2026 20:52:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AC687606D827 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-f47.google.com with SMTP id 46e09a7af769-833e671ee9fso16980a34.0 for ; Thu, 05 Nov 2026 12:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793911951; x=1794516751; 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=OlZzi/daWhysLhGd4+L17/0cgXaRd+9TTadefL0L7+Oyf+XxGIcC5HXgaZthth7mYT dyhgssu3ReA5cCoUTwxCqXfZGe2B9caDzAe4wvrJhAWuR0EMl4TZtvSdBl9iGLYFPxtk GxocE8ZYJvRPaKC1xoO3wfDu7iFPM/s2HzZxG2qsr3UI2f7ye05ZSbw2ccvCuFseGRRM +g0FEhy4nVZ6ZPdxOdoW1jKtT0A9SI0ItlOeNodeluHrkWzCOIjOU5HlYsUzyG4hF2d9 xXVm3+wcZ8EJSsbetTKIgEhOzTYraAFtt3d1IClYVdSPwCoDaIXSP7U/7HnDsQBvKAWg ta7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793911951; x=1794516751; 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=DzibuaCyLmlPsre//4kSQ+dAKYchFG4pZRdmpga5yPSjn4B+L17ia75tE7Fon3Vaq7 JI1iifJCgeM3+P5/4TTt9W2Sim6L2y3uyCQNf1AzIUr5oUv8gtQDAI/6cpS05sLZ1Pyk +O1wsy//oIr1ZIbsyJi1aYM776Iw8tBpej4kueGWXq8Z+GHspZva7I9fCoYEYdMyEFuP x1Jzq4ejcswFJ1jwzImQgBFVtNyFC+AVihaeKxP3lYOSHJtxO4j5ta/d/WZ6e3PCly/l 3KW9WCbGT3pjFrdClAC3cO2SaU7g5dpJegmPf+Pt481r01UWujEF0hSAia43ILTUm97V mqOg== X-Forwarded-Encrypted: i=1; AKwUvBwNgEq1tvUzCv7U1G08jW09+YkSQUlgElAoqL3CTkGuce7RWLKmq0w9/+rmQj1X+b4rltKsqf4NYTaROg==@lists.linux.dev X-Gm-Message-State: APuU4Z/PEkl16wZZQleHOCwDEFBut5egVgGaK/JtqNCtiEil0Oksycj9 iGdc5Z7rMgmF34yII9q+4lJlyPzFVJ9IcE1haD26k7CIKEvWq+Q8AuT9 X-Gm-Gg: AYBFou2E/OGhFOpe7b/6JF1yFRj+QNl4DWu8IwvXmygxaG9BTbI84vUfzMI2lehJLC4 Rp++4mq1vSwFkYoZscaB+V9MzGKAOgNKLbk+EV5hWJu4b1FqHFD4v6PQ9RL5yUbpQqEwtjtblrJ Yk1lTb/CvZlmsKZhZfb3Eh7HazOoobuF6/hNOTf6YyZ/RbKz7k2QXzp9RBbYUWa6iqj10GKswUh IVbK9KM0p58GKb8AbtkTcLP4xmnUKakKae13tT9BlB6a9BxDiJZQM8CNHPTc2Eb5bbkGcHvp64T 20dapiNgM/84lOAPWlTsjlHfQ/z0VkhqLpYKE0+6TYIbmEXtpx+9xIqNtopynzi1AqJ7SzZaIuk CdIFPayGXV33EOvrcCI5rwo1Y3WJ61vQNvxi/nR3u9zT2N2czXvvHNrTkqGUvm1Z6jxkmWXC1kH ESkrUa02IjiHhF5uRaolXOhXQtrICa4++xviHLfU+BO9ekKCb9C8r0B8R+8jvxfijuk/4x2dr8g F+30htmixRvMdnwZn/3FGvCDdYPADHrY8bqGnM+0DM/q0M/pSO4YjPgD4k8xCzgUzi7jnfoopZS lv6CKqL/m2Ggyq8nb+QU2yDsLekoelhyrooJyB/VBTCkn/fwvfDyHM1o8uVGeJ7FtJd1JPWrdZT i6fxCASuxBFOSNnsJxUFmAiIVBcPXhWcy0vETnLIUlm5qvzgJ9QLmXgCQphMoJA+9BKc/MRN8vE r29zaoRNLg7Wb6lbAq30BaK8SX/YrP9uWsgWB5CfmckPgC4VBenS8= X-Received: by 2002:a05:6830:4c03:b0:81d:54f9:d6a3 with SMTP id 46e09a7af769-85f1ce073bfmr525242a34.4.1793911950589; Thu, 05 Nov 2026 12:52:30 -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 46e09a7af769-85f1dbb298fsm292276a34.6.2026.11.05.12.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 12:52:29 -0800 (PST) From: James Hilliard Date: Thu, 05 Nov 2026 13:52:10 -0700 Subject: [PATCH v8 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: <20261105-submit-h616-uart-fifo-v1-v8-9-14024d2b184b@gmail.com> References: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@gmail.com> In-Reply-To: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@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-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 Thu Nov 5 20:52:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3915 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id C4CCA1C53C4 for ; Thu, 5 Nov 2026 22:05:28 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-27298-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-27298-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id C14D235C7E for ; Thu, 5 Nov 2026 20:52:46 +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=1793911954; b=2xnERUyMq3AUFPH4vW9Lw0y9bdojBhAsAnLiv8dRKDzy9pDTn1Z116CyaheE4GfZlVH8 buzSUWU1MlPZoz5klmawvOlxE8E7J1HdSAGp9QnoQn12R3BVyTpnwa7Bdr07le7ajQbnM f9+4d/W70SJPTgnKCNiZyUvb+f1ZzFyrKBjnq9qmEZb2kTBsHxafGrdIfMmbuSPudZJMx HhVZJDAg+Ne/OQ2nZnlUZ3vgj6hVttulpNjUNJwV5axkVdXFD1FE1GT7ktAjITr6h0Moa fTc98mqP3RM5guQGIKEeJjovxjmVaIWeaeIEUdRt8885MX4YHH/ocVVQzR9CViLTNcA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911954; 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=ZKvKgxau2uWzi4jdxzFocYT4nC9zZCMbXHUDan07PSoRukl4I2mXC8GN2UpomOJr5Sxu B4hktqcxy0zUVinExLd06oNQZPptw/62Zj4FOglN8nvXHwK2mkvfxVD+vV2FZPIenOS6B nRlzVICAlUdZSjfhdevlN1h7Pdfut1E536v7Zgt+WCx3RLnTJGP4KSqclBsOjTw4W1gRb 2pOqQPbt60/6dAyLT3LQmTeI7d3siBVWizmat9GllFvjfOlIcZ+qjLAOxx0Q+Cukb24s6 3FTudfKAsbQd3Ri7k7Q4mJ4SzO9NeWOjMdW2ky+7/K9hUla9jOwM3Y1exaFjtGnv7aA== 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=h7Cpfqv7; 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 01A85606D80F; Thu, 5 Nov 2026 20:52:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=h7Cpfqv7 X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793911953; b=GWtxwYO0RdEmWPA2Pa08HOUAGkVu3YsUeucdxq80S5zWifVqjNqJNcjbp15Qabu+/r0O BFoxBYsiXqqIJABApevb0ytWCR9uJ43nRfUc3GcCjCwoUJSVikGJ9ymtvUg5eGW5WayyA xjDMGBt+5f+aVax+oX7KtjzOPaeKkaDwCrZ6k0TWQG/8C976HFIIXgabznD5Nyijivckb 7syzAR6HsDZc0CLAKC23ObOF7km0voisiwV8AD3pJ/7ZrEO4Rc+Xlfx4eAWzRTmIgsxlI T09lcB6L7Rk9JrFMxWlye2idTeLTYHBidaJGWfVn0b/lsW3l+mlggCHjDGoVfHTW4SQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911953; 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=koPubr5x6mrbdLY/lH7V9bxAwp3sMdAoCL4iR4o17x7k/5eC8yGGzkQAyc5HRoc3yBNr H26eC7SZwGUw8vbX8+0bFctEBp1GIeErpLeMnDeWxARK4A/uA5OC9p8SOxMmby5YsThQM uAGril3wISJPaOy2Jfk5HrfaHJODYv4HrFctJv0sFdUAO6NsBI75qIya6xcmHLMkMl8xa KpRpJnefTRhQRyLXGfvTF8POL3kIIsd/wHdJk/FTQQDm4G5/sVZvTcWKupUBO1YtHdNYn RjQrS3SHtzbMr3ndezicKG6andTYBqJAcazV3Xu9OIb8VUG0QnQsZuxU5j/wl4Zxzzg== 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=h7Cpfqv7; arc=none smtp.remote-ip=209.85.210.45 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (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 85A84606A326 for ; Thu, 5 Nov 2026 20:52:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 85A84606A326 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-f45.google.com with SMTP id 46e09a7af769-823e4047037so3779a34.2 for ; Thu, 05 Nov 2026 12:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793911952; x=1794516752; 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=h7Cpfqv7uUgGv4sWeIPWzNJ59KoxZOoDP8EJpsgwDAkcczmpM1unJ11QvZxrynxlhI RSK0VjExbz/YF9VIlklao5Qd9D9F9LhBsZmbqpjJbij3hX34TbkuJLWl7rKclhapeDY0 bk+70whUMslpuc1VwdiyDNGf+Zr0oYOAECoI4wRgAydl7NPKWdyJFJ5pT/3m5gSC+uME wWoo0AgDlS04885xswV2oPRLmJ0INhseH7bhDdNHii9+EIJfMIijHHP24bL2ooLrfVal C563OjZTo/SJySsBzSpnxLU1BlvwhwFpjji0TmMc/nawfzcDRSmnhyBkms3fTfy3HXmN cnSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793911952; x=1794516752; 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=wXEIQHA1fQxGws/ZNUARby5XAyAftZsBv4h1QLAbJuJ76YpBHmsB8wIr8yWCUBbLAI G20KC+VLooBpA7OngRy/HHLqXnzYxhuagLwakwWuqHHUBDy31m0CbS2A5iw+6BoqzSfx Rrg8xCMPbrVKvpDxcC0CDKPuwunTamwsrlcrO4TjrqUl2Zve3wx6Edvn9uXoIhRvQZFM p5Ecm0yKCErNNadLfU9w+gT7bSu+lw0BAFqZ+JVfR49ZMg0VD/e4Y2+ew6jOMXr63nFo q66y44YhQdEg5WfC5YdzCBMZ21T9P5ugdGOshGyPfI8+dq8HrHs6i/R9XlFihAVEBAuv Cm+A== X-Forwarded-Encrypted: i=1; AKwUvBxxXbCKlN0XOCYhZ2RmZsG2Ccfi7s1oBj/7StuzFpD/IDS4gUc85cst8q4x2HLsyojfnaFtgSG017JdPw==@lists.linux.dev X-Gm-Message-State: APuU4Z++oRHNso0m3jyODhJ6+wYrufSIDmmnsLXLrQpbpH14YHB/Xv7M CkAdUGMLYUmtZtPQ9A5Vlu8TFW8nXtIp/fakayhbxLiLrcbKxXJ/4uDBiDdK8g== X-Gm-Gg: AYBFou0dAv30fbEfANCXBB0MAOQWLiZjLYNv00hcpD7XoSdC6l7j94d7RYVfQiISS7w FEZT3Of/GocP66N8x8SNx8QFF6rEtrAsxfbw98+DFfKiVSrHzFdVnBZZiy4QSpkNZDIyL3/a4b7 db3bFdaBLWZRuwKSrF9C3M+Ur6yHDhZn0USZnUabVcbCyB/mmW/31FfGI0IMCtf5NeIRevCn+IK coU7kYSeAjTP2VUBUptDAWu1LGsXOyjrQZxM7TAC1ZbD4q4hFrj59ENniyy6JaLlW69Efg5WTpH PNLyT6blvuX8rXX1s7kq2ib7SP0BEko4IlPVkTHCcoR0eMHAQG2WRRKjP1M6LEh4kHCRr+y+t0U 6FRlDVeyIk52cQo4t5RqMRdykYYWlDJzYCJL2+vNyxJ+UZ9FuTxsAfUR26UktOIYXwrJoIH1kh7 Z/QfKEH6N5B/CJD4DMqFHiywCz6BuvBi92VHa5tXJtlDZedwElSxCqC+KIF/ePibr6GAZeNOHdc Sv2lN84aIRr3AIPvn9atosp6MNvzMs3IKoTouX3OjFM2U0ssk8DilzEjnIqTTGXvb3lq1Mz4KcH +CVg3hiOuRQqOdauNjq5/+qVwW3xaDpCwbp2kDnmedFNg8akFU1gjYC6Mz2u4WON0RmAvU2PJs0 90JlXDl/HmDDwIC8T+Ghnp+41t/YZ9CjjtRe8B0PMkI5STywzDWqkyEq9ge9rIIEDoem3IQyhnc SvaZOCJI66rlze/rl5C3J8NKXKKLWMaaXFv6OtbpRXk3FF0erm2to= X-Received: by 2002:a05:6830:43a2:b0:821:8e71:1bb5 with SMTP id 46e09a7af769-85f1cfe1eddmr529135a34.14.1793911952656; Thu, 05 Nov 2026 12:52:32 -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 46e09a7af769-85f1dbb298fsm292276a34.6.2026.11.05.12.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 12:52:31 -0800 (PST) From: James Hilliard Date: Thu, 05 Nov 2026 13:52:11 -0700 Subject: [PATCH v8 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: <20261105-submit-h616-uart-fifo-v1-v8-10-14024d2b184b@gmail.com> References: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@gmail.com> In-Reply-To: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@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.234.253.10:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[dt]; FROM_HAS_DN(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[sea.lore.kernel.org:helo,sea.lore.kernel.org:rdns]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; TAGGED_FROM(0.00)[bounces-27298-noreply=patchwork.local]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10]; TO_DN_SOME(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[174.29.1.49:received,100.77.114.92:received]; ASN(0.00)[asn:63949, ipnet:172.234.224.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.234.253.10:from] X-Rspamd-Queue-Id: C4CCA1C53C4 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 Thu Nov 5 20:52:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3913 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id B21501C53C2 for ; Thu, 5 Nov 2026 22:01:03 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-27299-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-27299-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id F23993621F for ; Thu, 5 Nov 2026 20:52:49 +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=1793911956; b=dR4srxaott0zBNrzMIK9GMmYwcxi0p2XjrDzUuUS/noWuD4Hto1qru5UBNoIZr6SywiW +/Ty0SFT/rKcbD2kC9njPsxULe0/tV4KWyu8wxVLWDdyoRjXlyyUEjNLMbaVFC9esF4wl 22h2Ms6+USHghvqsnqLii0z9AoaXjaatQ8iEJznJNoe4U0QCn0eFG9Nx/8Ppansvxd0+L 30zXDHDDDXehgGTx402CmgXWDvfNMZOB81cmqWMPJciVZ9ScVfHJNkv3q+jPt0GvXIgng YfKS+dB3zJ14fpArLAhdjRhZcV3UnHAac9W+3kPUuCdStq5tEZ3Bs78i+OKOXHqxEjg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911956; 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=zJnZphIVCy59VJxaklCZGCCR0Ay23WyJU3zYTGxWzqeXB72z14i4YrpqzJI/FL/raByO aIbV8fGZ32t0KZ0TJPeTePIojd4cNjNx6kHkdBrTGWOltml3b/cr2lUQBUsXTglKAy9LD G9vauYAgeP/zKYNqVOAHTXMCqohWyeKkZQ7aepXGK6RP1jwmDItd7XzN6A0hy+aJmT/jR 6VMqAJtausbAqJ+LCpvrXlu3VIRTlHi2/l8ToqtkxMpAAR0q9BpV+sy9XNh3mBYOFciw2 vYaAh7XDxjZJMNBQbkIQ3gb+fClNfzGRwHRPDWCam4p+6SuRAOWx6DJYoAbVp1qbbtw== 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=w3Fhe+ax; 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 16650606D83A; Thu, 5 Nov 2026 20:52:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=w3Fhe+ax X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.161.54 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793911956; b=K2hBbzB3ZEZWwoXNgylSbKp4AHtI8y/8lPQQKaumUbhHkgySId1Xb4FPuCmNuLqg+Jbj lFIq5Fli9M40MjcOQlQ/BTanuZdWu6KyMHnaLgR5iDTivMaFloJvcfyoh8DXHkZLdrnwF +63FsIEVHQ/3PBFux6Irii/Avbw82dW9ee2km3BFaA4eWESDWI93bqOIuWBw8LHsgjkUo v7jTNW5nwCG+FCOTfYZaxCo+e2tfjd4/RlN+G5p1GcMZjhWtDC4aBHtQruPFlylheZkCQ enlrPs0MGWhDjh3jGooD4s0Qsj6IGYuY8f31xefYH/EO6bLe1D0xHKIybFOzgnDHpEg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793911956; 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=VZSKkANVVK0Sx2aFTjWuwEeUlinPStelNHQAjwL6vQwGj6hYPhLYv5L4FtU4Ih4SvmHV L/MssV6YEoh4qW2+lrNvrmr/hJaz8hrSBW2syL8+vpK3KV0Z52f1nPmUgm0u37VEVj24R OGoitym050xEnk41g8mZE6B2fSuRQelK0lPb75gaLSk+YcRtFJCIeim457zyaEb8XtSAJ qLVB9HVx//4cOZ1DIcmCQl0puZbDd+i7YJe6I/VKBOYY3FmlD+fPy9ZwpgJln+oJwTrFt 72F/w5zG20/6zEvFr5fM4oOi0uIFU/mGSp7+CIRnqD4SAj4L0Gb4a6RJQUUvRhGbHVA== 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=w3Fhe+ax; arc=none smtp.remote-ip=209.85.161.54 Received: from mail-oo1-f54.google.com (mail-oo1-f54.google.com [209.85.161.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 9B939606D82E for ; Thu, 5 Nov 2026 20:52:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9B939606D82E 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-f54.google.com with SMTP id 006d021491bc7-6f8a519e215so1204968eaf.1 for ; Thu, 05 Nov 2026 12:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793911955; x=1794516755; 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=w3Fhe+axEAg+NwI/dmVtRxkFEwUS4G8dvloyarJvZDzrVMFMtTrJo6pY1KS+4hn15C GjOM7qs1ZPNLveffSkouqUtULcz9PGyoFh9/2RwAaJQKPYj/0dhqiVniXxfeMjS5ps7K JgAjw33UzbYsifCSBkRlMoTAIcL6enZqk+QLILtIgI8M4sTbQ/mqujwIr7jBpBo15fKZ Qhv9BannhFB00NPCkK9M2v0ChHkeM+2xd7Uda6TGKJyHX5B2kwDqJiLEdmDZykBLSFua cD9zVls2r0lHlq7mkMY2+F7y4zXbKIBV5zVTdkl+uSHpNiStup6kk5Td8DqHLA7I0Y8e Tywg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793911955; x=1794516755; 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=SCpvS/z3VS67Z6UdK4IKxjEjn4kvjMnufsUcwPNKdu6eGYG9CjZSJ2DscoGRqQ8ukh j8wvCJ+ILALV3xo7ivejtq0fo2GFQdDvx/EUxmhBUL2FE1QQrw4PLPWa6H17ONyA6P5g djxdcW7oMYzVY1UVWaCJu4gwkwzzLPlUXPoRglsoQicd7XHmtH2WD2P25WoIi8c7fIV/ oMWu9pa5Xd46S3m7zDUGKmZn8GkCT5Ra3Io5FetVLC5WdvWvvEm3NQzcb5apEMt6QSbx iZFEz1U22VLSC1UuZSpQX8elqY7csvqDQkmDrC76RjjmKA1QMvcv1FJRQ6i8Z9thINeS +h1g== X-Forwarded-Encrypted: i=1; AKwUvByTtJYSS90Dh4z0b0CBnfu4LftEmTAV138tdjKPWLDZ0sgA/F5Iz7XOFMJxBV3+DHnKiDVVXsOOFXdFeg==@lists.linux.dev X-Gm-Message-State: APuU4Z8sNq64iprH9IZJL1qLyJPRgmgd7BAQER+XBCfVUW3fu3ZVWa80 0v2qQnFbdkdsyKW8QLKXFphULTqnTLApoCilapt/nlAHAgv+/5PdUL1s X-Gm-Gg: AYBFou3CGbwFN8+7lAVnFUaleR1eVynKa460XwRtmUtQLwHbxnntu100UzshTpz/hXY lnnoAgY2afw/3cLGYgoIHHa9tQJw/Ib9fVNYeZVmNhOwkT/3rzcFxEZBbE85R2F3gW86RmwjXi8 embv/Ibdgv/cC0fUKxE/CentSqhyyMnNnnUOFTiWkj7WRjjKshr06iqb/jDAzvRnuYOWBXh9pyc 1BK8350L55YNTpGi2wabMN1YG7jkKaK3n/pEhvNMlvN8lTNVKYwhBfw5CdpactZy+PKJJnmUvVm Gm8iDXmUfbIkRT0I9uKLPILXcnuOyul1y2g5aY7Yph6wiq2R1LLJNxFYGTyjnEIkkFLLiZ2agH7 vIAlP5Ok/jwAAj7dcpPBDpm6ZYeo8H7JvUYOaDX2H0q2+k8vj0NU51qEvDaq9X4T6//fqJjEH+W EjrlHVByKP+Ta/oh8DJg6WM2/2PYZ7NnSSGit//M8cA5gLn2vmOs4Bo6Vg8HoY8l/aNdbkd74A5 liHoZl3+ZZeCylp4Yaw3tMoT1BzbbCFowAgkb42++vxDGdsPv6ysfEA5QLv+T+DrwUjcT8aGU4k BpCjr7yg3yG/jFQSSwwWklTK2zaIGBAwZpm5ufu/nfBhgksIw7GUS/0n95DdMVixIY9usjWHNjU wCtXy9rFQ/8f88NOmebivzYq8gFpT4KfIMKgfbgUGyFRi8rKbfSp8baJZH3SKdVGh53/PeJb6V6 EK1vqysNxUe+lmcG1Q2+CsS1esNWtpSPblm2DC2fo974F0KqH3mGtSPYexBjoiFveC8I+VJDwm X-Received: by 2002:a05:6820:995:b0:6dd:c600:ec2e with SMTP id 006d021491bc7-716d20ba2a8mr2263018eaf.19.1793911954642; Thu, 05 Nov 2026 12:52:34 -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 46e09a7af769-85f1dbb298fsm292276a34.6.2026.11.05.12.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 12:52:33 -0800 (PST) From: James Hilliard Date: Thu, 05 Nov 2026 13:52:12 -0700 Subject: [PATCH v8 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: <20261105-submit-h616-uart-fifo-v1-v8-11-14024d2b184b@gmail.com> References: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@gmail.com> In-Reply-To: <20261105-submit-h616-uart-fifo-v1-v8-0-14024d2b184b@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.234.253.10: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)[]; TAGGED_FROM(0.00)[bounces-27299-noreply=patchwork.local]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; RCPT_COUNT_TWELVE(0.00)[16]; TAGGED_RCPT(0.00)[dt]; FREEMAIL_CC(0.00)[vger.kernel.org,lists.infradead.org,lists.linux.dev,gmail.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[sea.lore.kernel.org:helo,sea.lore.kernel.org:rdns]; FORGED_SENDER_MAILLIST(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, 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)[174.29.1.49:received,209.85.161.54:received,100.77.114.92:received]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.234.253.10:from]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10]; 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: B21501C53C2 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 = {