On Thu, Sep 18, 2025 at 2:51 PM Peng Fan <[email protected]> wrote:
>
> Simplify the clock enable logic by removing the dedicated
> imx_rproc_clk_enable() function and integrate the clock handling directly
> into the probe function to simplify the code.
>
> Add a new IMX_RPROC_NEED_CLKS flag in dcfg to indicate whether clock
> management is required for a given SoC. Update probe logic to conditionally
> enable clocks based on the new flag.
>
<snip>
> - return dev_err_probe(dev, ret, "failed to enable clks\n");
> + /* Remote core is under control of Linux or clock is not managed by
> firmware */
I see that you negate the comment from imx_rproc_clk_enable but with
the negation
OR becomes AND.
So, the comment should be:
/* Handle clocks when remote core is under control of Linux AND the
clocks are not managed by remote side FW */
Also, do we really need this flag?
Shouldn't we just make a decision based on the fact that clk is in the
device tree or not?
> + if (dcfg->flags & IMX_RPROC_NEED_CLKS) {
> + priv->clk = devm_clk_get_enabled(dev, NULL);
> + if (IS_ERR(priv->clk))
> + return dev_err_probe(dev, PTR_ERR(priv->clk), "Failed
> to enable clock\n");