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=1796297010; b=zaS/CCzqMIXoiXRXBMMbqk4qWayLvnqHd0MOgMmYwM7zu6cgTakRSPe9U7AZngWlJFkM VHgYaMj4UX7bBIkG5KSJakXsUbEvo73x2eaBrlk6mzuWy/uyG0/tBPK7QkuCGzi56DowR SO1RJV7e8jeAunvPNc4gqloLHm9H+Hm/5Dl3iLvDQNzC7Q1ol4IQs5wXvwE6NK294dPi5 +seFi6kV60XpmBuf50qUC5W8CHhSezG9e84JGZIAVSXnhCzGaP3deMtn/CsG1Iaz9RRCA A1qrYOJ22TVkmiiCiICOLFXT0eBYtukbvgEJnWStgcVSc1QJsopXtGHve5wysdtHPPQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796297010; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=OZ6TGDRoNI8rvXvfxiD5GP2mrUMaegt8k06IKivKqnU=; b=tGsfKQJJkPgXKxP+sebmJ7k+6ypceewFVYual/7rWzq8PHDLX+KN3T7EI9zPSuwSROrh GGpD3pCFojoIZ0SvfBobsVY3C781iyvWSjDLabOM9R72CDoL4iEMru6kXov2VMHwxtV8q 81jI0hQRd8HfzE+h9CvmTlCG6mCg62eZjMdjYT93muaMKoa8rXeEopXAS/By2DU+DdsNH 5FNHCeH1zOARHdkIsFzRRD7YeDrdr6S6oSZonMFztt5mLO/he8+YQ3I94RRjBLobBD3Re euRhgQpg6o90C2gc0PHj6F7bpasGt46+E3lEd7/ZV3t1WxWmDagcg/o4/wocN5fBJHg== 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=KciE7eGR; 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 AF88E606A32C for ; Thu, 3 Dec 2026 11:23:30 +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=KciE7eGR Received: by smtp.kernel.org (Postfix) with ESMTPSA id 227601F00898; Thu, 3 Dec 2026 11:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796297010; bh=OZ6TGDRoNI8rvXvfxiD5GP2mrUMaegt8k06IKivKqnU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=KciE7eGR6TNLQvZHAnHzU8RHcsHJRKGfzIVj8Si29yMxj0rLUCjDa8KbZLln26/Jj ybamW0aK8Cjy1NZ1XxdHFHk0n6suDthg692xD7u9eFVP3qHfyM1nWUP3tCKMTsSDrv 8ybw0mZG5VmUP5oJ+0pmjZZwDQQvZDk37TIx2aK/0TSNv89dyJAqWTl80sxcx7gLom w6v7Hi4rowX+JOM1garJBHdfhW/JJfF6juGJB098vmxfiX1ZqUDIi+Gd2c5N0nt1ZC n5xpAqmShl6Ff7QTRdU1meo6qXkE8dALlWIZT2UGdbM1pQujUGZ0GbJeUTkOCQX7uE aQJxcEgnHvqVQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2] serial: uartlite: Disable the clock after the port is removed Reply-To: sashiko-reviews@lists.linux.dev To: "Arina Kharlamova" Cc: linux-serial@vger.kernel.org In-Reply-To: <20261203-uartlite-remove-clk-v2-1-920d6ba90074@mbzuai.ac.ae> References: <20261203-uartlite-remove-clk-v2-1-920d6ba90074@mbzuai.ac.ae> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 11:23:29 +0000 X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > From: Arina Kharlamova >=20 > ulite_remove() calls clk_disable_unprepare() before ulite_release(). > When the port is open, ulite_startup() holds a second clk_enable(), so > the clock is unprepared while still enabled, and then > uart_remove_one_port() runs ulite_shutdown(), which writes > ULITE_CONTROL and calls clk_disable() on the unprepared clock. For a > console port the clock is gated before the console is unregistered. >=20 > The device can also runtime suspend during the remove. The > pm_runtime_put_sync() that the driver core calls before ->remove() > arms the autosuspend timer, or suspends at once when > autosuspend_delay_ms is 0. ulite_runtime_suspend() then disables the > clock a second time, and after ulite_release() it dereferences the > cleared drvdata. >=20 > Hold a runtime PM reference across ulite_release(), so the device is > resumed and cannot suspend while the port is torn down. Disable the > clock after runtime PM is disabled, and only if the device is not > runtime suspended, then unprepare it. >=20 > Fixes: 14288befeb57 ("tty: serial: uartlite: Add clock adaptation") > Fixes: 5bbe10a6942d ("tty: serial: uartlite: Add runtime pm support") > Signed-off-by: Arina Kharlamova Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-uartlite-r= emove-clk-v2-1-920d6ba90074@mbzuai.ac.ae?part=3D1