Message ID | 1387371526-15309-1-git-send-email-jonas.jensen@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi Jonas, On Wed, Dec 18, 2013 at 01:58:44PM +0100, Jonas Jensen wrote: > Thanks for the replies! > > This should tick the boxes on feedback except for one detail > on the fixed rate clock: > > Moving fixed-clock "ref12" from .dtsi to .dts proved problematic > for other clocks, this is why ref12 is still in SoC. > > My assertion is that "fixed-clock" clocks are probed later when > placed in .dts (see diff and boot log below). > of_clk_get() from clk_pll in .dtsi fails, i.e. fixed-clock ref12 > is not added as a provider in time before clk_pll loads. I haven't looked into the details, but is of_clk_get_parent_name() an alternative? That function does purely rely on DT data to obtain a name of a clock which may enable to register your PLL? Then probing oder wouldn't matter anymore. Sören
On Wed, Dec 18, 2013 at 01:58:44PM +0100, Jonas Jensen wrote: > Thanks for the replies! > > This should tick the boxes on feedback except for one detail > on the fixed rate clock: > > Moving fixed-clock "ref12" from .dtsi to .dts proved problematic > for other clocks, this is why ref12 is still in SoC. > > My assertion is that "fixed-clock" clocks are probed later when > placed in .dts (see diff and boot log below). > of_clk_get() from clk_pll in .dtsi fails, i.e. fixed-clock ref12 > is not added as a provider in time before clk_pll loads. Argh, I didn't see this version before I applied v5. So I dropped v5 and replaced with v6. -Olof
diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c index 1ed591a..89dc8ca 100644 --- a/drivers/clk/clk-fixed-rate.c +++ b/drivers/clk/clk-fixed-rate.c @@ -98,8 +98,10 @@ void of_fixed_clk_setup(struct device_node *node) of_property_read_string(node, "clock-output-names", &clk_name); clk = clk_register_fixed_rate(NULL, clk_name, NULL, CLK_IS_ROOT, rate); - if (!IS_ERR(clk)) + if (!IS_ERR(clk)) { + pr_info("%s: of_clk_add_provider node=%p\n", __func__, node); of_clk_add_provider(node, of_clk_src_simple_get, clk); + } } EXPORT_SYMBOL_GPL(of_fixed_clk_setup); CLK_OF_DECLARE(fixed_clk, "fixed-clock", of_fixed_clk_setup); diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 8312736..bd6c0c6 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2192,13 +2192,21 @@ struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec) /* Check if we have such a provider in our array */ mutex_lock(&of_clk_lock); list_for_each_entry(provider, &of_clk_providers, link) { + pr_info("%s: provider->node=%p clkspec->np=%p\n", __func__, provider->node, clkspec->np); if (provider->node == clkspec->np) clk = provider->get(clkspec, provider->data); - if (!IS_ERR(clk)) + if (!IS_ERR(clk)) { break; + } else { + pr_info("%s: provider->get() failed\n", __func__); + } } mutex_unlock(&of_clk_lock); + if (IS_ERR(clk)) { + pr_info("%s: no providers\n", __func__); + } + return clk; } diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index 442a313..57b2fc6 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c @@ -36,8 +36,10 @@ struct clk *of_clk_get(struct device_node *np, int index) rc = of_parse_phandle_with_args(np, "clocks", "#clock-cells", index, &clkspec); - if (rc) + if (rc) { + pr_info("%s: of_parse_phandle_with_args() failed\n", __func__); return ERR_PTR(rc); + } clk = of_clk_get_from_provider(&clkspec); of_node_put(clkspec.np);