From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9E6F28AB0B for ; Wed, 11 Feb 2026 13:56:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770818219; cv=none; b=HuDdZgz9F3OJwt/CFUsMlIq/TjIjcVI+nRKga0VFBIMEiTNeGdoy8TS8MTLrf9N+Ozrd91DhjwZ5ZVuXJf5nOut/BZykgXssi5ZdE50gA958/JDOLZjvV3au1IpyW9MGgWCpXKFBCVowBMa30nnUc6SdqqV1OwjKf5cb2AK7QXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770818219; c=relaxed/simple; bh=kwCXsSmsQspUTb6S0Awu1BXoA/AH3DcBmJ9paPj8040=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=lIKJG0XC+On/dwUUBXCOnQtXVR3UqzzlnKfOTv82ZlTg+pOn2bIBQMOWBSTx6egq2bYoIz1ACC9X4A2V/LDou0lz5CCpKY7p/jKpA9AMT0nr77QvHCVDwm6FHoCcUXeuqhDxYNr0T78kvQfMjxLT9scGUo4h05HVC2qtwnTvjPg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EOeT4FtT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EOeT4FtT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3E3DC4CEF7; Wed, 11 Feb 2026 13:56:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770818219; bh=kwCXsSmsQspUTb6S0Awu1BXoA/AH3DcBmJ9paPj8040=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=EOeT4FtTAbziFgxd2rSASwUAMF3ePWJYcr1ZD+77fnXvg+b11GG/7/9WkWb7oB8bS y7YW7dKeUD2ToQRviLXX4o2nXdHQ8/Xv7Xgt+27zPRGuku/9N8qYJFCbNK1kofqqaq yYxxmxhoHFHFY3ZG9zU13jAbCilTubKFap53GEH4iE4Yu4dPdUoEwoBIxZFCm7DTta 78jjPi4nK2LgEqS/F3CumlxHGsil9ihFURYgZtJc64KnKzJS3HxLN3+KqFRsdzPaVW SvPW09pMRsTiQsYTWxzHSFBCYasOxW+OmqgGeWN6uyXEQUdWB1py9v6Z8A+vMuaQqe y6I2l3W/AGdAA== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 11 Feb 2026 14:56:56 +0100 Message-Id: Subject: Re: [PATCH v5] driver core: enforce device_lock for driver_match_device() Cc: "Gui-Dong Han" , "Mark Brown" , , , , , "Qiu-ji Chen" , To: "Alexander Stein" From: "Danilo Krummrich" References: <20260113162843.12712-1-hanguidong02@gmail.com> <7ae38e31-ef31-43ad-9106-7c76ea0e8596@sirena.org.uk> <13955113.uLZWGnKmhe@steina-w> In-Reply-To: <13955113.uLZWGnKmhe@steina-w> On Wed Feb 11, 2026 at 11:42 AM CET, Alexander Stein wrote: > Am Dienstag, 20. Januar 2026, 14:22:19 CET schrieb Mark Brown: >> On Wed, Jan 14, 2026 at 12:28:43AM +0800, Gui-Dong Han wrote: > I've also experienced a boot problem on an NXP i.MX8QM based board > (DT currently in process of upstreaming). Bisect also resulted in this > commit. Thanks for reporting (and the backtrace, that helps a lot). This is another case where a platform driver registers another platform dri= ver in probe(). The following diff should fix the issue, I will send out a patc= h soon. diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c index 3ae162625bb1..d89a2f40771e 100644 --- a/drivers/clk/imx/clk-imx8qxp.c +++ b/drivers/clk/imx/clk-imx8qxp.c @@ -346,7 +346,29 @@ static struct platform_driver imx8qxp_clk_driver =3D { }, .probe =3D imx8qxp_clk_probe, }; -module_platform_driver(imx8qxp_clk_driver); + +static int __init imx8qxp_init(void) +{ + int ret; + + ret =3D platform_driver_register(&imx8qxp_clk_driver); + if (ret) + return ret; + + ret =3D imx_clk_scu_module_init(); + if (ret) + platform_driver_unregister(&imx8qxp_clk_driver); + + return ret; +} +module_init(imx8qxp_init); + +static void __exit imx8qxp_exit(void) +{ + imx_clk_scu_module_exit(); + platform_driver_unregister(&imx8qxp_clk_driver); +} +module_exit(imx8qxp_exit); MODULE_AUTHOR("Aisheng Dong "); MODULE_DESCRIPTION("NXP i.MX8QXP clock driver"); diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c index 34c9dc1fb20e..c90d21e05f91 100644 --- a/drivers/clk/imx/clk-scu.c +++ b/drivers/clk/imx/clk-scu.c @@ -191,6 +191,16 @@ static bool imx_scu_clk_is_valid(u32 rsrc_id) return p !=3D NULL; } +int __init imx_clk_scu_module_init(void) +{ + return platform_driver_register(&imx_clk_scu_driver); +} + +void __exit imx_clk_scu_module_exit(void) +{ + return platform_driver_unregister(&imx_clk_scu_driver); +} + int imx_clk_scu_init(struct device_node *np, const struct imx_clk_scu_rsrc_table *data) { @@ -215,7 +225,7 @@ int imx_clk_scu_init(struct device_node *np, rsrc_table =3D data; } - return platform_driver_register(&imx_clk_scu_driver); + return 0; } /* diff --git a/drivers/clk/imx/clk-scu.h b/drivers/clk/imx/clk-scu.h index af7b697f51ca..ca82f2cce897 100644 --- a/drivers/clk/imx/clk-scu.h +++ b/drivers/clk/imx/clk-scu.h @@ -25,6 +25,8 @@ extern const struct imx_clk_scu_rsrc_table imx_clk_scu_rs= rc_imx8dxl; extern const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8qxp; extern const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8qm; +int __init imx_clk_scu_module_init(void); +void __exit imx_clk_scu_module_exit(void); int imx_clk_scu_init(struct device_node *np, const struct imx_clk_scu_rsrc_table *data); struct clk_hw *imx_scu_of_clk_src_get(struct of_phandle_args *clkspec,