From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381574; b=i+djp568ZNnlNHONxFGf0HMmT3LTcatys+86HQt8qeWgtcp7DFHIwQwz3rp2wzu7z06N HH3/IpwrSnLq/wq+ZxJZtnVimomvHcsFK/nLGbjXFApM41c3QNikLsVAq+2P3KBezrfUI Hj+Thj2IW7zwBhJP43EZA6sQDklS/WAR+70RQ5yAvVtCYQIcHmmk4pMPbUg8wCuiGQfAa XPY74k4w2nECBvab7s76EDJS8L53LzzzmDEZlCZEt1nN540eBp5JnL7Xho68CMjNFPI8r 8JU9A5BFamNNPr3U81DlbslYYzspHlArrIGodBaKeOX3VPv82znLaJ0vL5Xd680bt7Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381574; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=fty7FWXqPDD9Y2ZogYbYW4I8lJXXEH4Et7bURFZQ6rE=; b=c/9ozgFpVQQjwpHu5Asnz39tTYGwTHxyHOdY5eCoG1dgf3r/eQEIGC+xEXPwWOoxW3WN wR3nX1LvW4uNgFWuiNCTM8RxQ921TTyfXR1PDZ4BVB/Sog8wavcyQ3WyL8u3rdwhEgGWt JazUxPjE6C6SsHCN1+TBqRSJVluUPFeWuig00XE0NKY3Mo6V4eQ2IlJVT9oGFo9JiLk1M pdjhxBRHpnHrsMvhL6HNB4+DwbPgWnh+U8f4uBFiDWAwabdbUIb0O7MiaG4vAKTEy54s4 7Zak5ilDh9nwFP/xYKa0Uu15Qb79AioEfARtDXXOuNmGHGWtEyrcyq/ZbLiOsLLE67A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=aEX1wF3B; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92152606A322; Fri, 4 Dec 2026 10:52:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=aEX1wF3B Received: by smtp.kernel.org (Postfix) with ESMTPSA id 240911F000C2; Fri, 4 Dec 2026 10:52:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796381574; bh=fty7FWXqPDD9Y2ZogYbYW4I8lJXXEH4Et7bURFZQ6rE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=aEX1wF3BSLSp/dZlSqxdD/zZTFN6za8wM96QLsJkQhAbGsXP4UsD58ogfdPdfUCwK A+Ve4K+Zkc1awtbjOt7gD8m7OmxjoMsCmB8gmxZe+6WvBhrdUzSXcftBW76ID3DYA2 o1hyIk5KeXA5z1bcajmFUeLBMBhbinAWPB9CwLW2vfarSBv1Cp9i/oEFn6DlfG4aWx 7L7LE/Aqs+w3nD+sj74UTNaXdxiXYXSlALfEcgd4TPylrDH+HIJh+RJjVbw0/ks1UZ Jmhhah/vi4X5y4u1y4j0Wrgw4WzR0/orylkQIWQYhOgakHq/ej0BYyZmxWYqGGQAGZ bwzo0qqeBTKLA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v10 06/11] serial: 8250_dw: derive RX trigger thresholds from the FIFO depth Reply-To: sashiko-reviews@lists.linux.dev To: "James Hilliard" Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261204-submit-h616-uart-fifo-v1-v10-6-1a9fb4f79635@gmail.com> References: <20261204-submit-h616-uart-fifo-v1-v10-0-1a9fb4f79635@gmail.com> <20261204-submit-h616-uart-fifo-v1-v10-6-1a9fb4f79635@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 10:52:53 +0000 X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] serial: 8250_dw: PM_RUNTIME_ACQUIRE_IF_ENABLED() fails in dw8250_probe() -- commit 145c679556b4e6a2b08dcfe78019d88beee1eeb1 Author: James Hilliard serial: 8250_dw: derive RX trigger thresholds from the FIFO depth This commit derives per-port RX trigger threshold tables from the discovered FIFO depth in 8250_dwlib and installs get_rxtrig/set_rxtrig callbacks for CPR-described FIFOs. > diff --git a/drivers/tty/serial/8250/8250_dwlib.c b/drivers/tty/serial/82= 50/8250_dwlib.c > index 4a06dec6e263b..6cfb7674ac119 100644 > --- a/drivers/tty/serial/8250/8250_dwlib.c > +++ b/drivers/tty/serial/8250/8250_dwlib.c [ ... ] > +static int dw8250_set_rxtrig(struct uart_port *p, u16 bytes) > +{ > + struct dw8250_port_data *pd =3D p->private_data; > + struct uart_8250_port *up =3D up_to_u8250p(p); > + int fcr, ret; > + > + fcr =3D 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 =3D PM_RUNTIME_ACQUIRE_ERR(&pm); > + if (ret) > + return ret; [Severity: Medium] Can PM_RUNTIME_ACQUIRE_IF_ENABLED() fail with -EACCES during initial dw8250_probe()? In dw8250_probe(), pm_runtime_set_active() updates runtime_status to RPM_ACTIVE while disable_depth stays 1 and last_status remains RPM_INVALID. The probe path then registers the port and publishes the rx_trig_bytes sysfs attribute before calling pm_runtime_enable(). CPU0 CPU1 dw8250_probe() pm_runtime_set_active(dev) (disable_depth=3D1, last_status=3DRPM_INVALID) serial8250_register_8250_port() ... (publishes rx_trig_bytes) rx_trig_bytes_store() dw8250_set_rxtrig() PM_RUNTIME_ACQUIRE_IF_ENABLED() rpm_resume() <-- -EACCES pm_runtime_enable(dev) Because PM_RUNTIME_ACQUIRE_IF_ENABLED() does not set RPM_TRANSPARENT, rpm_resume() rejects the call while disable_depth > 0 and last_status is not RPM_ACTIVE: drivers/base/power/runtime.c:rpm_resume() { ... } else if (dev->power.disable_depth > 0) { if (dev->power.runtime_status =3D=3D RPM_ACTIVE && dev->power.last_status =3D=3D RPM_ACTIVE) retval =3D 1; else if (rpmflags & RPM_TRANSPARENT) goto out; else retval =3D -EACCES; } ... } A udev rule or userspace write to rx_trig_bytes reacting to the KOBJ_ADD uevent in that window fails with -EACCES even though the UART is already active and clocked, leaving the trigger threshold unconfigured. Using PM_RUNTIME_ACQUIRE(p->dev, pm) instead passes RPM_TRANSPARENT while still holding a usage reference until runtime PM is enabled. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-submit-h61= 6-uart-fifo-v1-v10-0-1a9fb4f79635@gmail.com?part=3D6