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=1796378665; b=Z+4U0Wcz4fgWR8/pPI1FXoqxRylLkQHHexZYWrxPkC0sGM7t0p8vi7ZMJHLIx+Z2iSnT s+w7klCWAsumxYD12GLewSx9fsRd56nqLqo5o83KAa/kA9/VcrSG/fT5pBfbC+T3F3L0a 5qwJpPZvoDM3Ja1xWnwOad+8VPD5ViWSOgAhQ/BNwVhh1G7SkZsjShhTAMpGLIszFdvjn +SJp7xRUaoy7/0G27MSAK5VGvCG/wGzH0p/BCzLydu0/MNRadiVPg4DzueJ++wfFNrMMo mREbqLbMjp5a43aRUYhnZJ1O28IZ23f0BWUcDP5JqPMJ07kke/I/5l8FQ2r76G4dhZg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796378665; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=mVrQkstHureSqVQ6EcWxihxuZ/28kxmpZaeMOK6wwt8=; b=WPtxkqgk+v1oPVZJDJYNvPKdS95D44MLWKHtzFOZ09NVq4+7XDtSu+IV73XVjBYrkqfr wk5Lac4z5RSqRMXIBRz5Ry1AEdmlxFabRCdDkClAy+OkYJ0S9Ec+/vKZDeGqOzK0brXZ4 qhyiJCwB6s2J7Eaj4oART/Vv4YEjhRR6oDX88BJ1+WeODhj9AC3FkuCbHG5w6WFNdIjxQ XMbs6rcF9xdDHgs+52K+w8+waFmSPvFORPKlHp4nBCseLccOADnfDA/5eUHgTtHRHMLoP m/T1awi6LJhWUhSQOXCaUCocMwr5HYZoUtqjp9+7XQQMLBOKgV7RzO6+hT3vZJWNeGA== 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=mD87YWd+; 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 1CB5A606A330 for ; Fri, 4 Dec 2026 10:04:24 +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=mD87YWd+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D7E71F00933; Fri, 4 Dec 2026 10:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796378664; bh=mVrQkstHureSqVQ6EcWxihxuZ/28kxmpZaeMOK6wwt8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=mD87YWd+TC8IqeEkLdbXhNHCIMUt5yVDVajl8J3FlZMyiywCGnOYp/HZVLyUXsR3r QyvmQv5y2e1Fvj5Nh8s/p6p+GvL7ELzFQuYOBS6/DSMF1AeTnYarzIVOtGJBFutE2y 8pB7lQM93aB7ILBLC/KVchOfxEkZMzduOQkRp6dYNe3VkcVaqxojlor8cChVV5WD2T JlGNQvkZ6a3+SW/J10rmWfvrvLA5hts8ssdoZRDyKlK3zKZ1NFZsYDv5iGJReXrn7H 0Kw/fDo075bvP6PdaI/x3EicdMmXBIV5BaohkPj/AnrGNeCyxMQ5VmMjzpdnmNxfQ9 ff/28SI55lscA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2] serial: 8250: clear RX trigger callbacks when removing a port Reply-To: sashiko-reviews@lists.linux.dev To: "James Hilliard" Cc: linux-serial@vger.kernel.org In-Reply-To: <20261204-submit-serial-8250-rxtrig-lifetime-v1-v2-1-86264f63cefa@gmail.com> References: <20261204-submit-serial-8250-rxtrig-lifetime-v1-v2-1-86264f63cefa@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 10:04:24 +0000 X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > serial8250_unregister_port() removes the device supplied by a driver and > normally re-registers the persistent slot as an unknown legacy port. The > slot retains its RX trigger callbacks and sysfs attribute group, so the > replacement rx_trig_bytes attribute can still call the removed driver's > code. Reading or writing this attribute does not require opening the > port. Unloading the driver therefore leaves sysfs able to call into freed > module text. >=20 > Clear both callbacks after uart_remove_one_port() has drained the old > sysfs users and before registering the fallback port. Its RX trigger > attribute then uses the generic handlers, which reject a port without > FIFO capabilities. >=20 > Also copy the callbacks unconditionally during registration. A replacement > port without custom handlers must use the generic implementation instead > of inheriting callbacks from the previous owner of the slot. >=20 > Fixes: 8a6c543cf8b3 ("serial: 8250: allow UART drivers to override rx_tri= g_bytes handling") > Signed-off-by: James Hilliard Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-submit-ser= ial-8250-rxtrig-lifetime-v1-v2-1-86264f63cefa@gmail.com?part=3D1