linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: ti: fix linker error with !SOC_OMAP4
@ 2017-04-19 21:43 Arnd Bergmann
  2017-04-20 14:57 ` Tero Kristo
  2017-04-22  1:56 ` Stephen Boyd
  0 siblings, 2 replies; 6+ messages in thread
From: Arnd Bergmann @ 2017-04-19 21:43 UTC (permalink / raw)
  To: Tero Kristo, Michael Turquette, Stephen Boyd
  Cc: Arnd Bergmann, Tony Lindgren, Richard Watts, linux-omap,
	linux-clk, linux-kernel

When none of the OMAP4-generation SoCs are enabled, we run into a link
error for am43xx/am43xx:

drivers/clk/ti/dpll.o: In function `of_ti_am3_dpll_x2_setup':
dpll.c:(.init.text+0xd8): undefined reference to `clkhwops_omap4_dpllmx'

This is easily fixed by adding another #ifdef.

While looking at the code, I also spotted another problem with the
assignment of hw_ops variable that is not used again later. I'm
changing this to setting clk_hw->ops instead, which I guess is what
was intended here.

Fixes: 0565fb168d63 ("clk: ti: dpll: move omap3 DPLL functionality to clock driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/clk/ti/dpll.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
index 96d84888c6c5..fcf297fd2233 100644
--- a/drivers/clk/ti/dpll.c
+++ b/drivers/clk/ti/dpll.c
@@ -312,7 +312,6 @@ static void _register_dpll_x2(struct device_node *node,
 	struct clk_hw_omap *clk_hw;
 	const char *name = node->name;
 	const char *parent_name;
-	int ret;
 
 	parent_name = of_clk_get_parent_name(node, 0);
 	if (!parent_name) {
@@ -332,16 +331,21 @@ static void _register_dpll_x2(struct device_node *node,
 	init.parent_names = &parent_name;
 	init.num_parents = 1;
 
+#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
+        defined(CONFIG_SOC_DRA7XX)
 	if (hw_ops == &clkhwops_omap4_dpllmx) {
+		int ret;
+
 		/* Check if register defined, if not, drop hw-ops */
 		ret = of_property_count_elems_of_size(node, "reg", 1);
 		if (ret <= 0) {
-			hw_ops = NULL;
+			clk_hw->ops = NULL;
 		} else if (ti_clk_get_reg_addr(node, 0, &clk_hw->clksel_reg)) {
 			kfree(clk_hw);
 			return;
 		}
 	}
+#endif
 
 	/* register the clock */
 	clk = ti_clk_register(NULL, &clk_hw->hw, name);
-- 
2.9.0

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

* Re: [PATCH] clk: ti: fix linker error with !SOC_OMAP4
  2017-04-19 21:43 [PATCH] clk: ti: fix linker error with !SOC_OMAP4 Arnd Bergmann
@ 2017-04-20 14:57 ` Tero Kristo
  2017-04-20 15:06   ` Arnd Bergmann
  2017-04-22  1:56 ` Stephen Boyd
  1 sibling, 1 reply; 6+ messages in thread
From: Tero Kristo @ 2017-04-20 14:57 UTC (permalink / raw)
  To: Arnd Bergmann, Michael Turquette, Stephen Boyd
  Cc: Tony Lindgren, Richard Watts, linux-omap, linux-clk, linux-kernel

On 20/04/17 00:43, Arnd Bergmann wrote:
> When none of the OMAP4-generation SoCs are enabled, we run into a link
> error for am43xx/am43xx:
>
> drivers/clk/ti/dpll.o: In function `of_ti_am3_dpll_x2_setup':
> dpll.c:(.init.text+0xd8): undefined reference to `clkhwops_omap4_dpllmx'
>
> This is easily fixed by adding another #ifdef.
>
> While looking at the code, I also spotted another problem with the
> assignment of hw_ops variable that is not used again later. I'm
> changing this to setting clk_hw->ops instead, which I guess is what
> was intended here.

Good catch... It seems the corner case is masked in the testing I did 
locally so far.

>
> Fixes: 0565fb168d63 ("clk: ti: dpll: move omap3 DPLL functionality to clock driver")

However, I believe the fixes tag should point to this one in linux-next:

commit 473adbf4e02857a6b78dfb3d9fcf752638bbadb9
Author: Tero Kristo <t-kristo@ti.com>
Date:   Thu Feb 9 11:25:28 2017 +0200

     clk: ti: dpll44xx: fix clksel register initialization


> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Other than that:

Acked-by: Tero Kristo <t-kristo@ti.com>

> ---
>  drivers/clk/ti/dpll.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
> index 96d84888c6c5..fcf297fd2233 100644
> --- a/drivers/clk/ti/dpll.c
> +++ b/drivers/clk/ti/dpll.c
> @@ -312,7 +312,6 @@ static void _register_dpll_x2(struct device_node *node,
>  	struct clk_hw_omap *clk_hw;
>  	const char *name = node->name;
>  	const char *parent_name;
> -	int ret;
>
>  	parent_name = of_clk_get_parent_name(node, 0);
>  	if (!parent_name) {
> @@ -332,16 +331,21 @@ static void _register_dpll_x2(struct device_node *node,
>  	init.parent_names = &parent_name;
>  	init.num_parents = 1;
>
> +#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
> +        defined(CONFIG_SOC_DRA7XX)
>  	if (hw_ops == &clkhwops_omap4_dpllmx) {
> +		int ret;
> +
>  		/* Check if register defined, if not, drop hw-ops */
>  		ret = of_property_count_elems_of_size(node, "reg", 1);
>  		if (ret <= 0) {
> -			hw_ops = NULL;
> +			clk_hw->ops = NULL;
>  		} else if (ti_clk_get_reg_addr(node, 0, &clk_hw->clksel_reg)) {
>  			kfree(clk_hw);
>  			return;
>  		}
>  	}
> +#endif
>
>  	/* register the clock */
>  	clk = ti_clk_register(NULL, &clk_hw->hw, name);
>

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

* Re: [PATCH] clk: ti: fix linker error with !SOC_OMAP4
  2017-04-20 14:57 ` Tero Kristo
@ 2017-04-20 15:06   ` Arnd Bergmann
  2017-04-20 15:13     ` Tero Kristo
  0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2017-04-20 15:06 UTC (permalink / raw)
  To: Tero Kristo
  Cc: Michael Turquette, Stephen Boyd, Tony Lindgren, Richard Watts,
	linux-omap, linux-clk, Linux Kernel Mailing List

On Thu, Apr 20, 2017 at 4:57 PM, Tero Kristo <t-kristo@ti.com> wrote:
> On 20/04/17 00:43, Arnd Bergmann wrote:
>>
>> When none of the OMAP4-generation SoCs are enabled, we run into a link
>> error for am43xx/am43xx:
>>
>> drivers/clk/ti/dpll.o: In function `of_ti_am3_dpll_x2_setup':
>> dpll.c:(.init.text+0xd8): undefined reference to `clkhwops_omap4_dpllmx'
>>
>> This is easily fixed by adding another #ifdef.
>>
>> While looking at the code, I also spotted another problem with the
>> assignment of hw_ops variable that is not used again later. I'm
>> changing this to setting clk_hw->ops instead, which I guess is what
>> was intended here.
>
>
> Good catch... It seems the corner case is masked in the testing I did
> locally so far.
>
>>
>> Fixes: 0565fb168d63 ("clk: ti: dpll: move omap3 DPLL functionality to
>> clock driver")
>
>
> However, I believe the fixes tag should point to this one in linux-next:
>
> commit 473adbf4e02857a6b78dfb3d9fcf752638bbadb9
> Author: Tero Kristo <t-kristo@ti.com>
> Date:   Thu Feb 9 11:25:28 2017 +0200
>
>     clk: ti: dpll44xx: fix clksel register initialization

Ah, right.

> Other than that:
>
> Acked-by: Tero Kristo <t-kristo@ti.com>

Do you want me to resend, or can you forward the patch with the
fixed fixes line?

     Arnd

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

* Re: [PATCH] clk: ti: fix linker error with !SOC_OMAP4
  2017-04-20 15:06   ` Arnd Bergmann
@ 2017-04-20 15:13     ` Tero Kristo
  2017-04-22  1:54       ` Stephen Boyd
  0 siblings, 1 reply; 6+ messages in thread
From: Tero Kristo @ 2017-04-20 15:13 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Michael Turquette, Stephen Boyd, Tony Lindgren, Richard Watts,
	linux-omap, linux-clk, Linux Kernel Mailing List

On 20/04/17 18:06, Arnd Bergmann wrote:
> On Thu, Apr 20, 2017 at 4:57 PM, Tero Kristo <t-kristo@ti.com> wrote:
>> On 20/04/17 00:43, Arnd Bergmann wrote:
>>>
>>> When none of the OMAP4-generation SoCs are enabled, we run into a link
>>> error for am43xx/am43xx:
>>>
>>> drivers/clk/ti/dpll.o: In function `of_ti_am3_dpll_x2_setup':
>>> dpll.c:(.init.text+0xd8): undefined reference to `clkhwops_omap4_dpllmx'
>>>
>>> This is easily fixed by adding another #ifdef.
>>>
>>> While looking at the code, I also spotted another problem with the
>>> assignment of hw_ops variable that is not used again later. I'm
>>> changing this to setting clk_hw->ops instead, which I guess is what
>>> was intended here.
>>
>>
>> Good catch... It seems the corner case is masked in the testing I did
>> locally so far.
>>
>>>
>>> Fixes: 0565fb168d63 ("clk: ti: dpll: move omap3 DPLL functionality to
>>> clock driver")
>>
>>
>> However, I believe the fixes tag should point to this one in linux-next:
>>
>> commit 473adbf4e02857a6b78dfb3d9fcf752638bbadb9
>> Author: Tero Kristo <t-kristo@ti.com>
>> Date:   Thu Feb 9 11:25:28 2017 +0200
>>
>>     clk: ti: dpll44xx: fix clksel register initialization
>
> Ah, right.
>
>> Other than that:
>>
>> Acked-by: Tero Kristo <t-kristo@ti.com>
>
> Do you want me to resend, or can you forward the patch with the
> fixed fixes line?

I guess thats up to Stephen, he typically picks single fixes like these. 
I can also create a pull request with the fixes you provided if Stephen 
prefers that, in that case I can fix the "Fixes:" tag myself.

Stephen any preference?

-Tero

PS: I'm still checking the other two patches you provided, as they are 
more complex than this one.

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

* Re: [PATCH] clk: ti: fix linker error with !SOC_OMAP4
  2017-04-20 15:13     ` Tero Kristo
@ 2017-04-22  1:54       ` Stephen Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2017-04-22  1:54 UTC (permalink / raw)
  To: Tero Kristo
  Cc: Arnd Bergmann, Michael Turquette, Tony Lindgren, Richard Watts,
	linux-omap, linux-clk, Linux Kernel Mailing List

On 04/20, Tero Kristo wrote:
> On 20/04/17 18:06, Arnd Bergmann wrote:
> >On Thu, Apr 20, 2017 at 4:57 PM, Tero Kristo <t-kristo@ti.com> wrote:
> >>On 20/04/17 00:43, Arnd Bergmann wrote:
> >>>
> >>>When none of the OMAP4-generation SoCs are enabled, we run into a link
> >>>error for am43xx/am43xx:
> >>>
> >>>drivers/clk/ti/dpll.o: In function `of_ti_am3_dpll_x2_setup':
> >>>dpll.c:(.init.text+0xd8): undefined reference to `clkhwops_omap4_dpllmx'
> >>>
> >>>This is easily fixed by adding another #ifdef.
> >>>
> >>>While looking at the code, I also spotted another problem with the
> >>>assignment of hw_ops variable that is not used again later. I'm
> >>>changing this to setting clk_hw->ops instead, which I guess is what
> >>>was intended here.
> >>
> >>
> >>Good catch... It seems the corner case is masked in the testing I did
> >>locally so far.
> >>
> >>>
> >>>Fixes: 0565fb168d63 ("clk: ti: dpll: move omap3 DPLL functionality to
> >>>clock driver")
> >>
> >>
> >>However, I believe the fixes tag should point to this one in linux-next:
> >>
> >>commit 473adbf4e02857a6b78dfb3d9fcf752638bbadb9
> >>Author: Tero Kristo <t-kristo@ti.com>
> >>Date:   Thu Feb 9 11:25:28 2017 +0200
> >>
> >>    clk: ti: dpll44xx: fix clksel register initialization
> >
> >Ah, right.
> >
> >>Other than that:
> >>
> >>Acked-by: Tero Kristo <t-kristo@ti.com>
> >
> >Do you want me to resend, or can you forward the patch with the
> >fixed fixes line?
> 
> I guess thats up to Stephen, he typically picks single fixes like
> these. I can also create a pull request with the fixes you provided
> if Stephen prefers that, in that case I can fix the "Fixes:" tag
> myself.
> 
> Stephen any preference?

I'll just apply it right now.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH] clk: ti: fix linker error with !SOC_OMAP4
  2017-04-19 21:43 [PATCH] clk: ti: fix linker error with !SOC_OMAP4 Arnd Bergmann
  2017-04-20 14:57 ` Tero Kristo
@ 2017-04-22  1:56 ` Stephen Boyd
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2017-04-22  1:56 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Tero Kristo, Michael Turquette, Tony Lindgren, Richard Watts,
	linux-omap, linux-clk, linux-kernel

On 04/19, Arnd Bergmann wrote:
> When none of the OMAP4-generation SoCs are enabled, we run into a link
> error for am43xx/am43xx:
> 
> drivers/clk/ti/dpll.o: In function `of_ti_am3_dpll_x2_setup':
> dpll.c:(.init.text+0xd8): undefined reference to `clkhwops_omap4_dpllmx'
> 
> This is easily fixed by adding another #ifdef.
> 
> While looking at the code, I also spotted another problem with the
> assignment of hw_ops variable that is not used again later. I'm
> changing this to setting clk_hw->ops instead, which I guess is what
> was intended here.
> 
> Fixes: 0565fb168d63 ("clk: ti: dpll: move omap3 DPLL functionality to clock driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

end of thread, other threads:[~2017-04-22  1:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-19 21:43 [PATCH] clk: ti: fix linker error with !SOC_OMAP4 Arnd Bergmann
2017-04-20 14:57 ` Tero Kristo
2017-04-20 15:06   ` Arnd Bergmann
2017-04-20 15:13     ` Tero Kristo
2017-04-22  1:54       ` Stephen Boyd
2017-04-22  1:56 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).