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=1796153602; b=NfBisjGD72WGTBoKhEimGJUzycfP1Mav7qwk4TRRNU41AMdddIfhjUYSXH3yPWY24EIm aRcJfieDj8mIpnhjwv4lh243LK2pe6RfWbPPv4iz4S3bRV+yK4VWjSrIt2Z6mJH0VSKOY 0Iu2O/wifb3sMcHthr72QpsYtBmK+R6unSzN8Q0nq6f5d+is9ZQXdKDU6f8MOaZyrQqzo j22BBhWlFM18a/toHf/VYDnYFkXSk7bkJWu8420MZ3q/QGCAmeve6bomeulJLFphEnfM0 K0b01cTJk2hOAqNU4O5HfDlWvldnGcwNCGn0k7GKVfdgH5al5llw5MRNeJXqMtMiFbg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796153602; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ASpURxPPjxGGBz6FJmo5vqhsHs16+cI7EEtP1mgc8gI=; b=LfYZuzjNrhIfRibGd8YuIvW1xMu4Y76bb0mj1/M3s1U3xZPNFCNsrXgIVivke1B9gCzj OIA4NhrvcAtkivRgyzz8s9tQAwJCUttUogJmdC1PjIqbJ2601aeEGagKKDMQMWN1NLPj7 4DVndA+WmOOMeH74Azdyuhjbz5jc89VVJNXspanBf3cAZG1CuDwYJXh6eqK3EOVzrRTL4 Dd91dPfmqvbL7y0V9D4of3UPPWTGtHP0mG645UcRb552IoNiZpYlXP7j2bLtj5PkYYA5s c3tzdCVAszd7GUe+RsYyjtVexIKDMIT5OphseGnJB7gZ4WfD9xigGlck4Xeuh3UALAg== 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=Et3T2ZTj; 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 B3613606A320 for ; Tue, 1 Dec 2026 19:33:22 +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=Et3T2ZTj Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80D0A1F000C1; Tue, 1 Dec 2026 19:33:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796153602; bh=ASpURxPPjxGGBz6FJmo5vqhsHs16+cI7EEtP1mgc8gI=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Et3T2ZTjt2z3VfaFac1mtfnkOk4bPPECIdojZaHQA5H9ZFC/iGuWp5Z8JdQK2gmbT Y+ZHMDNmKcu6ON0RPmhG+9W1gS4/PR4Dx7QCJEQZFEOk6KN6wJ85d0yKa5gUhKZr7h RMJ2OS7tgn+p35oTZiPhWq6WyAcs0iA1EpGf/qqdab5/EHLLqSIeJRdydylGIJM+c4 pySyGkBgZwwzXdDdBan7yfR4lI6TPT3eZL8OcTFdKSzzoGMKmppubRSljLqYhwbYkU shXHQ+WlwVdAI+s5p02ENRt9kcYrpT7ERs5VS6PeTnYEQgaGeXD/ck+yHi0n6j2Wl+ 51koklSZrDjeQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] serial: uartlite: Resume the device before disabling the clock on remove Reply-To: sashiko-reviews@lists.linux.dev To: "Arina Kharlamova" Cc: linux-serial@vger.kernel.org In-Reply-To: <20261201-uartlite-remove-clk-v1-1-bdffc49566f6@mbzuai.ac.ae> References: <20261201-uartlite-remove-clk-v1-1-bdffc49566f6@mbzuai.ac.ae> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 19:33:22 +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: - [High] serial: uartlite: clk_disable_unprepare() called before ulite_release() -- commit 61b30e88d1673ed11a94dda9b0b4e0f2531305d8 Author: Arina Kharlamova serial: uartlite: Resume the device before disabling the clock on remove This commit takes a runtime PM reference at the start of ulite_remove() so that the device is resumed before clk_disable_unprepare() is called, and drops the reference after disabling runtime PM. > diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c > index b9a14dc2f2fdf..993569d3432df 100644 > --- a/drivers/tty/serial/uartlite.c > +++ b/drivers/tty/serial/uartlite.c > @@ -893,10 +893,12 @@ static void ulite_remove(struct platform_device *pd= ev) > struct uart_port *port =3D dev_get_drvdata(&pdev->dev); > struct uartlite_data *pdata =3D port->private_data; > =20 > + pm_runtime_get_sync(&pdev->dev); > clk_disable_unprepare(pdata->clk); > ulite_release(&pdev->dev); > pm_runtime_disable(&pdev->dev); > pm_runtime_set_suspended(&pdev->dev); > + pm_runtime_put_noidle(&pdev->dev); > pm_runtime_dont_use_autosuspend(&pdev->dev); > } [Severity: High] Does calling clk_disable_unprepare(pdata->clk) before ulite_release() and pm_runtime_disable() disable and unprepare the clock while the UART port is still active? When an open port is removed, ulite_startup() holds a second clk_enable() reference, so clk_disable_unprepare() unprepares a still-enabled clock and triggers a clk_core_unprepare() warning before ulite_release() -> uart_remove_one_port() -> ulite_shutdown() accesses ULITE_CONTROL and calls clk_disable() on the unprepared clock: drivers/tty/serial/uartlite.c:ulite_shutdown() { ... uart_out32(0, ULITE_CONTROL, port); uart_in32(ULITE_CONTROL, port); /* dummy */ free_irq(port->irq, port); clk_disable(pdata->clk); } When a closed or console port is removed, clk_disable_unprepare() gates off the AXI clock before uart_remove_one_port() unregisters the console and port, so console output during unregistration accesses ULITE registers with the clock disabled. Moving clk_disable_unprepare(pdata->clk) after ulite_release() and pm_runtime_disable() keeps the clock prepared and enabled until port teardown finishes. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201-uartlite-r= emove-clk-v1-1-bdffc49566f6@mbzuai.ac.ae?part=3D1