From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: linux-kernel@vger.kernel.org
Cc: linux-amarula@amarulasolutions.com,
Mark Brown <broonie@kernel.org>,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Abel Vesa <abelvesa@kernel.org>,
Fabio Estevam <festevam@gmail.com>,
Michael Turquette <mturquette@baylibre.com>,
Peng Fan <peng.fan@nxp.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Sascha Hauer <s.hauer@pengutronix.de>,
Shawn Guo <shawnguo@kernel.org>, Stephen Boyd <sboyd@kernel.org>,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-clk@vger.kernel.org
Subject: [linux-next, 1/1] clk: imx: imx8mm-anatop: probe only on i.MX8MM platforms
Date: Fri, 16 May 2025 15:49:27 +0200 [thread overview]
Message-ID: <20250516134945.14692-1-dario.binacchi@amarulasolutions.com> (raw)
Commit 9c1e388af87c ("clk: imx: add support for i.MX8MM anatop clock
driver") breaks boot on i.MX8M{P,N} platforms.
Here's the log for a board based on the i.MX8MP platform:
[ 1.439320] i.MX clk 1: register failed with -2
[ 1.441014] i.MX clk 2: register failed with -2
[ 1.445610] imx8mm-anatop 30360000.clock-controller: NXP i.MX8MM anatop clock driver probed
[ 1.455068] Unable to handle kernel paging request at virtual address fffffffffffffffe
...
[ 1.634650] Call trace:
[ 1.637102] __clk_get_hw+0x4/0x18 (P)
[ 1.640862] imx8mp_clocks_probe+0xdc/0x2f50
[ 1.645152] platform_probe+0x68/0xc4
[ 1.648827] really_probe+0xbc/0x298
[ 1.652413] __driver_probe_device+0x78/0x12c
In the imx8mp.dtsi device tree, the anatop compatible string is:
compatible = "fsl,imx8mp-anatop", "fsl,imx8mm-anatop";
So, in configurations like arm64 defconfig, where CONFIG_CLK_IMX8MP and
CONFIG_CLK_IMX8MM as well as CONFIG_CLK_IMX8MN are enabled, the driver
for the i.MX8MM anatop is incorrectly loaded.
The patch fixes the regression by ensuring that the i.MX8MM anatop
driver only probes on i.MX8MM platforms.
Fixes: 9c1e388af87c ("clk: imx: add support for i.MX8MM anatop clock driver")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
drivers/clk/imx/clk-imx8mm-anatop.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/clk/imx/clk-imx8mm-anatop.c b/drivers/clk/imx/clk-imx8mm-anatop.c
index 4ac870df6370..90ff11a93fe5 100644
--- a/drivers/clk/imx/clk-imx8mm-anatop.c
+++ b/drivers/clk/imx/clk-imx8mm-anatop.c
@@ -37,6 +37,19 @@ static const char * const clkout_sels[] = {"audio_pll1_out", "audio_pll2_out", "
static struct clk_hw_onecell_data *clk_hw_data;
static struct clk_hw **hws;
+static int is_really_imx8mm(struct device_node *np)
+{
+ const char *compat;
+ struct property *p;
+
+ of_property_for_each_string(np, "compatible", p, compat) {
+ if (strcmp(compat, "fsl,imx8mm-anatop"))
+ return -EFAULT;
+ }
+
+ return 0;
+}
+
static int imx8mm_anatop_clocks_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -44,6 +57,10 @@ static int imx8mm_anatop_clocks_probe(struct platform_device *pdev)
void __iomem *base;
int ret;
+ ret = is_really_imx8mm(np);
+ if (ret)
+ return ret;
+
base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) {
dev_err(dev, "failed to get base address\n");
--
2.43.0
base-commit: 8566fc3b96539e3235909d6bdda198e1282beaed
branch: fix-imx8mm-probing
next reply other threads:[~2025-05-16 13:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 13:49 Dario Binacchi [this message]
2025-05-19 12:05 ` [linux-next, 1/1] clk: imx: imx8mm-anatop: probe only on i.MX8MM platforms Mark Brown
2025-05-19 12:58 ` Peng Fan
2025-05-19 13:07 ` Mark Brown
2025-05-19 14:13 ` Krzysztof Kozlowski
2025-05-19 14:30 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250516134945.14692-1-dario.binacchi@amarulasolutions.com \
--to=dario.binacchi@amarulasolutions.com \
--cc=abelvesa@kernel.org \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-amarula@amarulasolutions.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=peng.fan@nxp.com \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@kernel.org \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox