Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
* [PATCH] clk: imx8qxp: Defer instead of failing probe
@ 2024-07-01 11:54 Diogo Manuel Pais Silva
  2024-07-01 23:55 ` Peng Fan
  0 siblings, 1 reply; 10+ messages in thread
From: Diogo Manuel Pais Silva @ 2024-07-01 11:54 UTC (permalink / raw)
  To: abelvesa@kernel.org, peng.fan@nxp.com, mturquette@baylibre.com,
	sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com,
	linux-clk@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	EMC: linux-kernel@vger.kernel.org

When of_clk_parent_fill is run before all the parent clocks have been probed then the probe function will return -EINVAL, making it so that the probe isn't attempted again. As fw_devlink is on by default this does not usually happen, but if fw_devlink is disabled then it is very possible that the parent clock will be probed after the lpcg first attempt, and the lpcg clock will not work.

Signed-off-by: Diogo Silva <diogo.pais@ttcontrol.com>
---
 drivers/clk/imx/clk-imx8qxp-lpcg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/imx/clk-imx8qxp-lpcg.c b/drivers/clk/imx/clk-imx8qxp-lpcg.c
index d0ccaa040225..520a05ea0bef 100644
--- a/drivers/clk/imx/clk-imx8qxp-lpcg.c
+++ b/drivers/clk/imx/clk-imx8qxp-lpcg.c
@@ -225,8 +225,8 @@ static int imx_lpcg_parse_clks_from_dt(struct platform_device *pdev,

        ret = of_clk_parent_fill(np, parent_names, count);
        if (ret != count) {
-               dev_err(&pdev->dev, "failed to get clock parent names\n");
-               return count;
+               dev_warn(&pdev->dev, "failed to get all clock parent names\n");
+               return -EPROBE_DEFER;
        }

        ret = of_property_read_string_array(np, "clock-output-names",
--
2.34.1

CONFIDENTIALITY: The contents of this e-mail are confidential and intended only for the above addressee(s). If you are not the intended recipient, or the person responsible for delivering it to the intended recipient, copying or delivering it to anyone else or using it in any unauthorized manner is prohibited and may be unlawful. If you receive this e-mail by mistake, please notify the sender and the systems administrator at straymail@tttech.com immediately.

TTControl - Internal

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-09-05 18:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01 11:54 [PATCH] clk: imx8qxp: Defer instead of failing probe Diogo Manuel Pais Silva
2024-07-01 23:55 ` Peng Fan
2024-07-02  8:10   ` [PATCH v2] " Diogo Manuel Pais Silva
2024-07-02 10:14     ` Peng Fan
2024-08-28  8:31     ` Abel Vesa
2024-09-02 14:18       ` [PATCH v3] " Diogo Manuel Pais Silva
2024-09-04  2:03         ` Peng Fan
2024-09-04  6:47           ` Diogo Manuel Pais Silva
2024-09-04  6:50           ` [PATCH v4] " Diogo Manuel Pais Silva
2024-09-05 18:35             ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox