diff mbox series

[LINUX,PATCHv5] clk: clk-fixed-factor: Return EPROBE_DEFER to wait for dependent drivers

Message ID 1553947338-12470-1-git-send-email-shubhrajyoti.datta@xilinx.com (mailing list archive)
State Rejected, archived
Headers show
Series [LINUX,PATCHv5] clk: clk-fixed-factor: Return EPROBE_DEFER to wait for dependent drivers | expand

Commit Message

Shubhrajyoti Datta March 30, 2019, 12:02 p.m. UTC
In case the provider clock is not yet probed the fixed factor does not
find the name of the parent clock. This is because the parent clock is
not yet probed and in case of zynqmp the output-names is omitted.

This is a temporary solution however the critical components
like firmware probe should happen early.
Fixes a probe failure.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---
v2:Fix the return value in other cases

 drivers/clk/clk-fixed-factor.c | 2 ++
 1 file changed, 2 insertions(+)

--
2.1.1

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

Comments

Stephen Boyd April 10, 2019, 9:38 p.m. UTC | #1
Quoting Shubhrajyoti Datta (2019-03-30 05:02:18)
> In case the provider clock is not yet probed the fixed factor does not
> find the name of the parent clock. This is because the parent clock is
> not yet probed and in case of zynqmp the output-names is omitted.
> 
> This is a temporary solution however the critical components
> like firmware probe should happen early.
> Fixes a probe failure.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> ---

I'd prefer we move this to use the clk parent rewrite series I sent the
other day. That way the parents can be fetched when the clk is
registered or found later when the parent is registered. Can you try out
that series?

	https://lkml.kernel.org/r/20190404215344.6330-1-sboyd@kernel.org
diff mbox series

Patch

diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index f3ae4ff..36cbb0c 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -171,6 +171,8 @@  static struct clk *_of_fixed_factor_clk_setup(struct device_node *node)

        of_property_read_string(node, "clock-output-names", &clk_name);
        parent_name = of_clk_get_parent_name(node, 0);
+       if (!parent_name)
+               return ERR_PTR(-EPROBE_DEFER);

        if (of_match_node(set_rate_parent_matches, node))
                flags |= CLK_SET_RATE_PARENT;