Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1647360 > unrolled thread

[PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t

Started byArnd Bergmann <arnd@arndb.de>
First post2017-05-22 22:40 +0200
Last post2017-05-23 09:40 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t Arnd Bergmann <arnd@arndb.de> - 2017-05-22 22:40 +0200
    Re: [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t Stephen Boyd <sboyd@codeaurora.org> - 2017-05-23 03:00 +0200
      Re: [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t Chen-Yu Tsai <wens@csie.org> - 2017-05-23 09:20 +0200
        Re: [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t Arnd Bergmann <arnd@arndb.de> - 2017-05-23 10:00 +0200
    Re: [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t Chen-Yu Tsai <wens@csie.org> - 2017-05-23 09:40 +0200

#1647360 — [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t

FromArnd Bergmann <arnd@arndb.de>
Date2017-05-22 22:40 +0200
Subject[PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t
Message-ID<tK2hs-1Tl-23@gated-at.bofh.it>
We get a link error when CCU_MULT is not set with the
newly added driver:

drivers/clk/sunxi-ng/ccu-sun8i-a83t.o:(.data.__compound_literal.1+0x4): undefined reference to `ccu_mult_ops'
drivers/clk/sunxi-ng/ccu-sun8i-a83t.o:(.data.__compound_literal.3+0x4): undefined reference to `ccu_mult_ops'

Fixes: 46b492116666 ("clk: sunxi-ng: Add driver for A83T CCU")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/clk/sunxi-ng/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/sunxi-ng/Kconfig b/drivers/clk/sunxi-ng/Kconfig
index a384c695b388..67acef3d2494 100644
--- a/drivers/clk/sunxi-ng/Kconfig
+++ b/drivers/clk/sunxi-ng/Kconfig
@@ -121,6 +121,7 @@ config SUN8I_A83T_CCU
 	select SUNXI_CCU_DIV
 	select SUNXI_CCU_GATE
 	select SUNXI_CCU_MP
+	select SUNXI_CCU_MULT
 	select SUNXI_CCU_MUX
 	select SUNXI_CCU_NKMP
 	select SUNXI_CCU_NM
-- 
2.9.0

[toc] | [next] | [standalone]


#1647540

FromStephen Boyd <sboyd@codeaurora.org>
Date2017-05-23 03:00 +0200
Message-ID<tK6l3-4mN-1@gated-at.bofh.it>
In reply to#1647360
On 05/22, Arnd Bergmann wrote:
> We get a link error when CCU_MULT is not set with the
> newly added driver:
> 
> drivers/clk/sunxi-ng/ccu-sun8i-a83t.o:(.data.__compound_literal.1+0x4): undefined reference to `ccu_mult_ops'
> drivers/clk/sunxi-ng/ccu-sun8i-a83t.o:(.data.__compound_literal.3+0x4): undefined reference to `ccu_mult_ops'
> 
> Fixes: 46b492116666 ("clk: sunxi-ng: Add driver for A83T CCU")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Is there any way we can automate finding these build errors and
prevent them from creeping into the tree? It may be asking too
much, but it seems like we should be able to find these
particular problems with some script that greps for ccu_*_ops and
checks that any file's Kconfig symbol also has that selected.

Anyway, I'm just tired of seeing these sorts of things in my
inbox.

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

[toc] | [prev] | [next] | [standalone]


#1647710

FromChen-Yu Tsai <wens@csie.org>
Date2017-05-23 09:20 +0200
Message-ID<tKcgN-8mw-7@gated-at.bofh.it>
In reply to#1647540
On Mon, May 22, 2017 at 05:55:53PM -0700, Stephen Boyd wrote:
> On 05/22, Arnd Bergmann wrote:
> > We get a link error when CCU_MULT is not set with the
> > newly added driver:
> > 
> > drivers/clk/sunxi-ng/ccu-sun8i-a83t.o:(.data.__compound_literal.1+0x4): undefined reference to `ccu_mult_ops'
> > drivers/clk/sunxi-ng/ccu-sun8i-a83t.o:(.data.__compound_literal.3+0x4): undefined reference to `ccu_mult_ops'
> > 
> > Fixes: 46b492116666 ("clk: sunxi-ng: Add driver for A83T CCU")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Chen-Yu Tsai <wens@csie.org>

> Is there any way we can automate finding these build errors and
> prevent them from creeping into the tree? It may be asking too
> much, but it seems like we should be able to find these
> particular problems with some script that greps for ccu_*_ops and
> checks that any file's Kconfig symbol also has that selected.
> 
> Anyway, I'm just tired of seeing these sorts of things in my
> inbox.

The (ugly) script below does the trick, though it does give results
for some symbols that are indirectly selected:

SUN5I_CCU uses SUNXI_CCU_GATE but does not select it
SUN5I_CCU uses SUNXI_CCU_MUX but does not select it
SUN5I_CCU uses SUNXI_CCU_NKMP but does not select it
SUN6I_A31_CCU uses SUNXI_CCU_GATE but does not select it
SUN6I_A31_CCU uses SUNXI_CCU_MUX but does not select it
SUN8I_A23_CCU uses SUNXI_CCU_GATE but does not select it
SUN8I_A23_CCU uses SUNXI_CCU_MUX but does not select it
SUN8I_A33_CCU uses SUNXI_CCU_GATE but does not select it
SUN8I_A33_CCU uses SUNXI_CCU_MUX but does not select it
SUN8I_A83T_CCU uses SUNXI_CCU_MULT but does not select it
SUN8I_H3_CCU uses SUNXI_CCU_GATE but does not select it
SUN8I_H3_CCU uses SUNXI_CCU_MUX but does not select it
SUN8I_V3S_CCU uses SUNXI_CCU_GATE but does not select it
SUN8I_V3S_CCU uses SUNXI_CCU_MUX but does not select it
SUN9I_A80_CCU uses SUNXI_CCU_MUX but does not select it

------------------------------------------------------------------------

#!/bin/bash

LANG=C

for i in drivers/clk/sunxi-ng/ccu-*.o; do
	FILE=`basename $i`
	CLKS=`nm -g $i | grep -P -o "ccu_.*(?=_ops)" | tr [a-z] [A-Z]`
	CFG=`grep $FILE drivers/clk/sunxi-ng/Makefile |
		grep -P -o "(?<=CONFIG_)SUN[A-Z0-9_]*"`

	for clk in $CLKS; do
		perl -0777 -ne "/$CFG(.*?)^(?:config|endif)/sm; print \$1" \
			drivers/clk/sunxi-ng/Kconfig | grep -q "SUNXI_$clk" ||
			echo "$CFG uses SUNXI_$clk but does not select it"
	done
done

------------------------------------------------------------------------


Regards
ChenYu

[toc] | [prev] | [next] | [standalone]


#1647766

FromArnd Bergmann <arnd@arndb.de>
Date2017-05-23 10:00 +0200
Message-ID<tKcTx-a4-47@gated-at.bofh.it>
In reply to#1647710
On Tue, May 23, 2017 at 9:19 AM, Chen-Yu Tsai <wens@csie.org> wrote:
> On Mon, May 22, 2017 at 05:55:53PM -0700, Stephen Boyd wrote:
>> On 05/22, Arnd Bergmann wrote:
>> > We get a link error when CCU_MULT is not set with the
>> > newly added driver:
>> >
>> > drivers/clk/sunxi-ng/ccu-sun8i-a83t.o:(.data.__compound_literal.1+0x4): undefined reference to `ccu_mult_ops'
>> > drivers/clk/sunxi-ng/ccu-sun8i-a83t.o:(.data.__compound_literal.3+0x4): undefined reference to `ccu_mult_ops'
>> >
>> > Fixes: 46b492116666 ("clk: sunxi-ng: Add driver for A83T CCU")
>> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Acked-by: Chen-Yu Tsai <wens@csie.org>
>
>> Is there any way we can automate finding these build errors and
>> prevent them from creeping into the tree? It may be asking too
>> much, but it seems like we should be able to find these
>> particular problems with some script that greps for ccu_*_ops and
>> checks that any file's Kconfig symbol also has that selected.
>>
>> Anyway, I'm just tired of seeing these sorts of things in my
>> inbox.

Definitely, I'm also tired of writing the patches ;-)

> The (ugly) script below does the trick, though it does give results
> for some symbols that are indirectly selected:
>
> SUN5I_CCU uses SUNXI_CCU_GATE but does not select it
> SUN5I_CCU uses SUNXI_CCU_MUX but does not select it

I think they are all caught implicitly, otherwise I would have run
into them.

> SUN5I_CCU uses SUNXI_CCU_NKMP but does not select it

I sent a patch for this on Feb 14 and again March 13, but haven't
gotten around to resubmit again.

An alternative would be to remove all the dependencies as 'lib-y'
in the Makefile and remove the individual Kconfig symbols. That
way, we would always build all of them when CONFIG_SUNXI_CCU
is enabled, but the linker would drop the ones that do not get
referenced.

         Arnd

[toc] | [prev] | [next] | [standalone]


#1647736

FromChen-Yu Tsai <wens@csie.org>
Date2017-05-23 09:40 +0200
Message-ID<tKcAa-8tW-15@gated-at.bofh.it>
In reply to#1647360
On Tue, May 23, 2017 at 4:29 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> We get a link error when CCU_MULT is not set with the
> newly added driver:
>
> drivers/clk/sunxi-ng/ccu-sun8i-a83t.o:(.data.__compound_literal.1+0x4): undefined reference to `ccu_mult_ops'
> drivers/clk/sunxi-ng/ccu-sun8i-a83t.o:(.data.__compound_literal.3+0x4): undefined reference to `ccu_mult_ops'
>
> Fixes: 46b492116666 ("clk: sunxi-ng: Add driver for A83T CCU")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied.

ChenYu

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web