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


Groups > linux.kernel > #1654880 > unrolled thread

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

Started byStephen Boyd <sboyd@codeaurora.org>
First post2017-06-01 09:20 +0200
Last post2017-06-07 10:20 +0200
Articles 10 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t Stephen Boyd <sboyd@codeaurora.org> - 2017-06-01 09:20 +0200
    Re: [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t Arnd Bergmann <arnd@arndb.de> - 2017-06-01 11:10 +0200
      Re: [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-06-02 14:20 +0200
        [PATCH] clk: sunxi-ng: Move all clock types to a library Stephen Boyd <sboyd@codeaurora.org> - 2017-06-03 00:40 +0200
          Re: [PATCH] clk: sunxi-ng: Move all clock types to a library Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-06-05 16:50 +0200
            Re: [PATCH] clk: sunxi-ng: Move all clock types to a library Arnd Bergmann <arnd@arndb.de> - 2017-06-06 12:10 +0200
              Re: [PATCH] clk: sunxi-ng: Move all clock types to a library Stephen Boyd <sboyd@codeaurora.org> - 2017-06-07 00:10 +0200
              Re: [PATCH] clk: sunxi-ng: Move all clock types to a library Chen-Yu Tsai <wens@csie.org> - 2017-06-07 07:50 +0200
                Re: [PATCH] clk: sunxi-ng: Move all clock types to a library Arnd Bergmann <arnd@arndb.de> - 2017-06-07 09:40 +0200
                  Re: [PATCH] clk: sunxi-ng: Move all clock types to a library Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-06-07 10:20 +0200

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

FromStephen Boyd <sboyd@codeaurora.org>
Date2017-06-01 09:20 +0200
SubjectRe: [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t
Message-ID<tNsyK-7UU-13@gated-at.bofh.it>
On 05/23, Arnd Bergmann wrote:
> 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.

In this case you're right, and we should change them to lib-y in
the Makefile and then let the linker figure this all out. No more
dependency patches. I think we only need to do this sort of
Kconfig stuff when we want to make a library .ko file that each
SoC specific driver depends on for common code.

It would be cool if the build system could figure that all out
for us, and let us have something like modlib-y that makes it a
library (archive) if all objects depending on it are builtin and
we have CONFIG_MODULES=n, or makes it into an object file if
something is builtin that depends on it, or makes it into a
module if everything that depends on it is a module.

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

[toc] | [next] | [standalone]


#1654950

FromArnd Bergmann <arnd@arndb.de>
Date2017-06-01 11:10 +0200
Message-ID<tNuhc-Bs-29@gated-at.bofh.it>
In reply to#1654880
On Thu, Jun 1, 2017 at 9:17 AM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> On 05/23, Arnd Bergmann wrote:
>> On Tue, May 23, 2017 at 9:19 AM, Chen-Yu Tsai <wens@csie.org> wrote:
>> 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.
>
> In this case you're right, and we should change them to lib-y in
> the Makefile and then let the linker figure this all out. No more
> dependency patches. I think we only need to do this sort of
> Kconfig stuff when we want to make a library .ko file that each
> SoC specific driver depends on for common code.
>
> It would be cool if the build system could figure that all out
> for us, and let us have something like modlib-y that makes it a
> library (archive) if all objects depending on it are builtin and
> we have CONFIG_MODULES=n, or makes it into an object file if
> something is builtin that depends on it, or makes it into a
> module if everything that depends on it is a module.

In this case, there are no loadable modules, the sunxi clk drivers
can only be built-in, which should simplify the problem a lot.

       Arnd

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


#1656170

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2017-06-02 14:20 +0200
Message-ID<tNTIC-Vj-17@gated-at.bofh.it>
In reply to#1654950

[Multipart message — attachments visible in raw view] — view raw

On Thu, Jun 01, 2017 at 11:07:46AM +0200, Arnd Bergmann wrote:
> On Thu, Jun 1, 2017 at 9:17 AM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> > On 05/23, Arnd Bergmann wrote:
> >> On Tue, May 23, 2017 at 9:19 AM, Chen-Yu Tsai <wens@csie.org> wrote:
> >> 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.
> >
> > In this case you're right, and we should change them to lib-y in
> > the Makefile and then let the linker figure this all out. No more
> > dependency patches. I think we only need to do this sort of
> > Kconfig stuff when we want to make a library .ko file that each
> > SoC specific driver depends on for common code.
> >
> > It would be cool if the build system could figure that all out
> > for us, and let us have something like modlib-y that makes it a
> > library (archive) if all objects depending on it are builtin and
> > we have CONFIG_MODULES=n, or makes it into an object file if
> > something is builtin that depends on it, or makes it into a
> > module if everything that depends on it is a module.
> 
> In this case, there are no loadable modules, the sunxi clk drivers
> can only be built-in, which should simplify the problem a lot.

Using the linker to drop the useless stuff seems like a good idea. Do
you want to send a patch for it?

Maxim

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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


#1656612 — [PATCH] clk: sunxi-ng: Move all clock types to a library

FromStephen Boyd <sboyd@codeaurora.org>
Date2017-06-03 00:40 +0200
Subject[PATCH] clk: sunxi-ng: Move all clock types to a library
Message-ID<tO3oC-78v-15@gated-at.bofh.it>
In reply to#1656170
We've run into kconfig missing dependency errors in the sunxi-ng
code a couple times now. Each time the fix is to find the missing
select statement and add it to the Kconfig entry for a particular
SoC driver. Given that all this code is builtin (non-modular) we
don't need to do this complicated dependency tracking in Kconfig.
Instead we can move all the "library"ish code to be compiled as
lib-y instead of obj-y, let the linker throw away unused code in
the resulting vmlinux, and drop all the Kconfig stuff we use to
track clock types.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

Based on linux-next-20170602.

 drivers/clk/sunxi-ng/Kconfig  | 117 ------------------------------------------
 drivers/clk/sunxi-ng/Makefile |  26 +++++-----
 2 files changed, 13 insertions(+), 130 deletions(-)

diff --git a/drivers/clk/sunxi-ng/Kconfig b/drivers/clk/sunxi-ng/Kconfig
index 67acef3d2494..dd15f9f9e1ef 100644
--- a/drivers/clk/sunxi-ng/Kconfig
+++ b/drivers/clk/sunxi-ng/Kconfig
@@ -6,149 +6,42 @@ config SUNXI_CCU
 
 if SUNXI_CCU
 
-# Base clock types
-
-config SUNXI_CCU_DIV
-	bool
-	select SUNXI_CCU_MUX
-
-config SUNXI_CCU_FRAC
-	bool
-
-config SUNXI_CCU_GATE
-	def_bool y
-
-config SUNXI_CCU_MUX
-	bool
-
-config SUNXI_CCU_MULT
-	bool
-	select SUNXI_CCU_MUX
-
-config SUNXI_CCU_PHASE
-	bool
-
-# Multi-factor clocks
-
-config SUNXI_CCU_NK
-	bool
-	select SUNXI_CCU_GATE
-
-config SUNXI_CCU_NKM
-	bool
-	select SUNXI_CCU_GATE
-
-config SUNXI_CCU_NKMP
-	bool
-	select SUNXI_CCU_GATE
-
-config SUNXI_CCU_NM
-	bool
-	select SUNXI_CCU_FRAC
-	select SUNXI_CCU_GATE
-
-config SUNXI_CCU_MP
-	bool
-	select SUNXI_CCU_GATE
-	select SUNXI_CCU_MUX
-
-# SoC Drivers
-
 config SUN50I_A64_CCU
 	bool "Support for the Allwinner A64 CCU"
-	select SUNXI_CCU_DIV
-	select SUNXI_CCU_NK
-	select SUNXI_CCU_NKM
-	select SUNXI_CCU_NKMP
-	select SUNXI_CCU_NM
-	select SUNXI_CCU_MP
-	select SUNXI_CCU_PHASE
 	default ARM64 && ARCH_SUNXI
 	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST
 
 config SUN5I_CCU
 	bool "Support for the Allwinner sun5i family CCM"
-	select SUNXI_CCU_DIV
-	select SUNXI_CCU_MULT
-	select SUNXI_CCU_NK
-	select SUNXI_CCU_NKM
-	select SUNXI_CCU_NM
-	select SUNXI_CCU_MP
-	select SUNXI_CCU_PHASE
 	default MACH_SUN5I
 	depends on MACH_SUN5I || COMPILE_TEST
 
 config SUN6I_A31_CCU
 	bool "Support for the Allwinner A31/A31s CCU"
-	select SUNXI_CCU_DIV
-	select SUNXI_CCU_NK
-	select SUNXI_CCU_NKM
-	select SUNXI_CCU_NKMP
-	select SUNXI_CCU_NM
-	select SUNXI_CCU_MP
-	select SUNXI_CCU_PHASE
 	default MACH_SUN6I
 	depends on MACH_SUN6I || COMPILE_TEST
 
 config SUN8I_A23_CCU
 	bool "Support for the Allwinner A23 CCU"
-	select SUNXI_CCU_DIV
-	select SUNXI_CCU_MULT
-	select SUNXI_CCU_NK
-	select SUNXI_CCU_NKM
-	select SUNXI_CCU_NKMP
-	select SUNXI_CCU_NM
-	select SUNXI_CCU_MP
-	select SUNXI_CCU_PHASE
 	default MACH_SUN8I
 	depends on MACH_SUN8I || COMPILE_TEST
 
 config SUN8I_A33_CCU
 	bool "Support for the Allwinner A33 CCU"
-	select SUNXI_CCU_DIV
-	select SUNXI_CCU_MULT
-	select SUNXI_CCU_NK
-	select SUNXI_CCU_NKM
-	select SUNXI_CCU_NKMP
-	select SUNXI_CCU_NM
-	select SUNXI_CCU_MP
-	select SUNXI_CCU_PHASE
 	default MACH_SUN8I
 	depends on MACH_SUN8I || COMPILE_TEST
 
 config SUN8I_A83T_CCU
 	bool "Support for the Allwinner 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
-	select SUNXI_CCU_PHASE
 	default MACH_SUN8I
 
 config SUN8I_H3_CCU
 	bool "Support for the Allwinner H3 CCU"
-	select SUNXI_CCU_DIV
-	select SUNXI_CCU_NK
-	select SUNXI_CCU_NKM
-	select SUNXI_CCU_NKMP
-	select SUNXI_CCU_NM
-	select SUNXI_CCU_MP
-	select SUNXI_CCU_PHASE
 	default MACH_SUN8I || (ARM64 && ARCH_SUNXI)
 	depends on MACH_SUN8I || (ARM64 && ARCH_SUNXI) || COMPILE_TEST
 
 config SUN8I_V3S_CCU
 	bool "Support for the Allwinner V3s CCU"
-	select SUNXI_CCU_DIV
-	select SUNXI_CCU_NK
-	select SUNXI_CCU_NKM
-	select SUNXI_CCU_NKMP
-	select SUNXI_CCU_NM
-	select SUNXI_CCU_MP
-	select SUNXI_CCU_PHASE
 	default MACH_SUN8I
 	depends on MACH_SUN8I || COMPILE_TEST
 
@@ -159,21 +52,11 @@ config SUN8I_DE2_CCU
 
 config SUN9I_A80_CCU
 	bool "Support for the Allwinner A80 CCU"
-	select SUNXI_CCU_DIV
-	select SUNXI_CCU_MULT
-	select SUNXI_CCU_GATE
-	select SUNXI_CCU_NKMP
-	select SUNXI_CCU_NM
-	select SUNXI_CCU_MP
-	select SUNXI_CCU_PHASE
 	default MACH_SUN9I
 	depends on MACH_SUN9I || COMPILE_TEST
 
 config SUN8I_R_CCU
 	bool "Support for Allwinner SoCs' PRCM CCUs"
-	select SUNXI_CCU_DIV
-	select SUNXI_CCU_GATE
-	select SUNXI_CCU_MP
 	default MACH_SUN8I || (ARCH_SUNXI && ARM64)
 
 endif
diff --git a/drivers/clk/sunxi-ng/Makefile b/drivers/clk/sunxi-ng/Makefile
index 0185c6ffadcb..cbc8cb4f70e3 100644
--- a/drivers/clk/sunxi-ng/Makefile
+++ b/drivers/clk/sunxi-ng/Makefile
@@ -1,21 +1,21 @@
 # Common objects
-obj-$(CONFIG_SUNXI_CCU)		+= ccu_common.o
-obj-$(CONFIG_SUNXI_CCU)		+= ccu_reset.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_common.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_reset.o
 
 # Base clock types
-obj-$(CONFIG_SUNXI_CCU_DIV)	+= ccu_div.o
-obj-$(CONFIG_SUNXI_CCU_FRAC)	+= ccu_frac.o
-obj-$(CONFIG_SUNXI_CCU_GATE)	+= ccu_gate.o
-obj-$(CONFIG_SUNXI_CCU_MUX)	+= ccu_mux.o
-obj-$(CONFIG_SUNXI_CCU_MULT)	+= ccu_mult.o
-obj-$(CONFIG_SUNXI_CCU_PHASE)	+= ccu_phase.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_div.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_frac.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_gate.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_mux.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_mult.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_phase.o
 
 # Multi-factor clocks
-obj-$(CONFIG_SUNXI_CCU_NK)	+= ccu_nk.o
-obj-$(CONFIG_SUNXI_CCU_NKM)	+= ccu_nkm.o
-obj-$(CONFIG_SUNXI_CCU_NKMP)	+= ccu_nkmp.o
-obj-$(CONFIG_SUNXI_CCU_NM)	+= ccu_nm.o
-obj-$(CONFIG_SUNXI_CCU_MP)	+= ccu_mp.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_nk.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_nkm.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_nkmp.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_nm.o
+lib-$(CONFIG_SUNXI_CCU)		+= ccu_mp.o
 
 # SoC support
 obj-$(CONFIG_SUN50I_A64_CCU)	+= ccu-sun50i-a64.o
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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


#1657644 — Re: [PATCH] clk: sunxi-ng: Move all clock types to a library

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2017-06-05 16:50 +0200
SubjectRe: [PATCH] clk: sunxi-ng: Move all clock types to a library
Message-ID<tP1uq-499-21@gated-at.bofh.it>
In reply to#1656612

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Sat, Jun 03, 2017 at 12:22:32PM +0800, kbuild test robot wrote:
> Hi Stephen,
> 
> [auto build test ERROR on sunxi/sunxi/for-next]
> [also build test ERROR on next-20170602]
> [cannot apply to clk/clk-next v4.12-rc3]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Stephen-Boyd/clk-sunxi-ng-Move-all-clock-types-to-a-library/20170603-090538
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi/for-next
> config: arm-sunxi_defconfig (attached as .config)
> compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
> reproduce:
>         wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=arm 
> 
> All errors (new ones prefixed by >>):
> 
>    drivers/built-in.o: In function `sun8i_a83t_ccu_probe':
> >> sunxi_sid.c:(.text+0x2dc74): undefined reference to `sunxi_ccu_probe'
>    drivers/built-in.o: In function `sun9i_a80_ccu_probe':
>    sunxi_sid.c:(.text+0x2dd14): undefined reference to `sunxi_ccu_probe'
>    drivers/built-in.o: In function `sun9i_a80_de_clk_probe':
>    sunxi_sid.c:(.text+0x2de20): undefined reference to `sunxi_ccu_probe'
>    drivers/built-in.o: In function `sun9i_a80_usb_clk_probe':
>    sunxi_sid.c:(.text+0x2df34): undefined reference to `sunxi_ccu_probe'
>    drivers/built-in.o: In function `sun5i_ccu_init':
> >> sunxi_sid.c:(.init.text+0x3f9c): undefined reference to `sunxi_ccu_probe'
>    drivers/built-in.o:sunxi_sid.c:(.init.text+0x4070): more undefined references to `sunxi_ccu_probe' follow
>    drivers/built-in.o: In function `sun6i_a31_ccu_setup':
> >> sunxi_sid.c:(.init.text+0x4084): undefined reference to `ccu_mux_notifier_register'
>    drivers/built-in.o: In function `sun8i_a23_ccu_setup':
>    sunxi_sid.c:(.init.text+0x411c): undefined reference to `sunxi_ccu_probe'
>    drivers/built-in.o: In function `sun8i_a33_ccu_setup':
>    sunxi_sid.c:(.init.text+0x41b8): undefined reference to `sunxi_ccu_probe'
> >> sunxi_sid.c:(.init.text+0x41c0): undefined reference to `ccu_pll_notifier_register'
>    sunxi_sid.c:(.init.text+0x41d0): undefined reference to `ccu_mux_notifier_register'
>    drivers/built-in.o: In function `sunxi_h3_h5_ccu_init':
>    sunxi_sid.c:(.init.text+0x425c): undefined reference to `sunxi_ccu_probe'
>    sunxi_sid.c:(.init.text+0x4270): undefined reference to `ccu_mux_notifier_register'
>    drivers/built-in.o: In function `sun8i_v3s_ccu_setup':
>    sunxi_sid.c:(.init.text+0x4308): undefined reference to `sunxi_ccu_probe'
>    drivers/built-in.o: In function `sunxi_r_ccu_init':
>    sunxi_sid.c:(.init.text+0x4368): undefined reference to `sunxi_ccu_probe'
>    drivers/built-in.o: In function `.LANCHOR0':
> >> sunxi_sid.c:(.data+0x157c4): undefined reference to `ccu_gate_ops'
> >> sunxi_sid.c:(.data+0x15840): undefined reference to `ccu_mp_ops'
> >> sunxi_sid.c:(.data+0x158a4): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x15908): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x15940): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1597c): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x159b8): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x15a20): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x15a84): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x15aec): undefined reference to `ccu_div_ops'
> >> sunxi_sid.c:(.data+0x15b40): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x15ba4): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x15c08): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x15c40): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x15c7c): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x15cb8): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x15cf4): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x15d30): undefined reference to `ccu_gate_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x15d6c): more undefined references to `ccu_gate_ops' follow
>    drivers/built-in.o: In function `.LANCHOR0':
>    sunxi_sid.c:(.data+0x15e4c): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x15e84): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x15ec0): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x15efc): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x15f78): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x15fcc): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x16020): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x16098): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x16110): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x16188): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x16200): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x16278): undefined reference to `ccu_mp_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x162f0): more undefined references to `ccu_mp_ops' follow
>    drivers/built-in.o: In function `.LANCHOR0':
>    sunxi_sid.c:(.data+0x16508): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x16544): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x16580): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x165bc): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x165f8): undefined reference to `ccu_gate_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x16634): more undefined references to `ccu_gate_ops' follow
>    drivers/built-in.o: In function `.LANCHOR0':
>    sunxi_sid.c:(.data+0x16ee4): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x16f48): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x16fd8): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1703c): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x17094): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x170cc): undefined reference to `ccu_gate_ops'
> >> sunxi_sid.c:(.data+0x1713c): undefined reference to `ccu_mult_ops'
> >> sunxi_sid.c:(.data+0x17190): undefined reference to `ccu_nk_ops'
>    sunxi_sid.c:(.data+0x171f8): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x17260): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x172b4): undefined reference to `ccu_nk_ops'
> >> sunxi_sid.c:(.data+0x17328): undefined reference to `ccu_nkmp_ops'
>    sunxi_sid.c:(.data+0x17398): undefined reference to `ccu_mult_ops'
> >> sunxi_sid.c:(.data+0x17404): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x17478): undefined reference to `ccu_nkmp_ops'
>    drivers/built-in.o: In function `.LANCHOR1':
>    sunxi_sid.c:(.data+0x17d40): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x17db8): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x17e30): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x17e94): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x17ef8): undefined reference to `ccu_div_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x17f5c): more undefined references to `ccu_div_ops' follow
>    drivers/built-in.o: In function `.LANCHOR1':
>    sunxi_sid.c:(.data+0x18358): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x183d0): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x18408): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x18444): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x184ac): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x184e4): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x18520): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1855c): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x185c4): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1862c): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x18690): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x186f4): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x18758): undefined reference to `ccu_div_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x187bc): more undefined references to `ccu_div_ops' follow
>    drivers/built-in.o: In function `.LANCHOR1':
>    sunxi_sid.c:(.data+0x18810): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x18864): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x188c8): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1892c): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x18990): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x189f4): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x18a58): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x18a90): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x18acc): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x18b08): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x18b44): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x18b80): undefined reference to `ccu_gate_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x18bbc): more undefined references to `ccu_gate_ops' follow
>    drivers/built-in.o: In function `.LANCHOR1':
>    sunxi_sid.c:(.data+0x18d8c): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x18df0): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x18e68): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x18ea0): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x18edc): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x18f18): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x18f54): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x18f90): undefined reference to `ccu_gate_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x18fcc): more undefined references to `ccu_gate_ops' follow
>    drivers/built-in.o: In function `.LANCHOR1':
>    sunxi_sid.c:(.data+0x19024): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x19078): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x190cc): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x19144): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x191bc): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x19234): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x192ac): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x19324): undefined reference to `ccu_mp_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x1939c): more undefined references to `ccu_mp_ops' follow
>    drivers/built-in.o: In function `.LANCHOR1':
> >> sunxi_sid.c:(.data+0x193d4): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x19410): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x1948c): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x194c4): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x19500): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x1957c): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x195b4): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x195f0): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x1966c): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x196a4): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x196e0): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x1975c): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x197d4): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x1984c): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x19884): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x198c0): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x198fc): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x19938): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x19974): undefined reference to `ccu_gate_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x199b0): more undefined references to `ccu_gate_ops' follow
>    drivers/built-in.o: In function `.LANCHOR1':
>    sunxi_sid.c:(.data+0x1a56c): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x1a5d0): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1a660): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1a6c4): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1a764): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x1a7cc): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x1a838): undefined reference to `ccu_nm_ops'
> >> sunxi_sid.c:(.data+0x1a8b0): undefined reference to `ccu_nkm_ops'
>    sunxi_sid.c:(.data+0x1a918): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x1a984): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x1a9d8): undefined reference to `ccu_nk_ops'
>    sunxi_sid.c:(.data+0x1aa50): undefined reference to `ccu_nkm_ops'
>    sunxi_sid.c:(.data+0x1aabc): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x1ab28): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x1ab94): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x1abac): undefined reference to `ccu_nkm_ops'
>    sunxi_sid.c:(.data+0x1b154): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1b1b8): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1b220): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1b284): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1b2e8): undefined reference to `ccu_div_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x1b34c): more undefined references to `ccu_div_ops' follow
>    drivers/built-in.o: In function `.LANCHOR1':
>    sunxi_sid.c:(.data+0x1b384): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1b3c0): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1b428): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1b490): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1b4f4): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1b558): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1b5ac): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x1b610): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1b674): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1b6ac): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1b6e8): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1b724): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1b760): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1b79c): undefined reference to `ccu_gate_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x1b7d8): more undefined references to `ccu_gate_ops' follow
>    drivers/built-in.o: In function `.LANCHOR1':
>    sunxi_sid.c:(.data+0x1b920): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x1b974): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x1b9ec): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x1ba64): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x1ba9c): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x1bad8): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x1bb54): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x1bb8c): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x1bbc8): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x1bc44): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x1bc7c): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x1bcb8): undefined reference to `ccu_phase_ops'
>    sunxi_sid.c:(.data+0x1bd34): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x1bdac): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x1bde4): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1be20): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1be5c): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1be98): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1bed4): undefined reference to `ccu_gate_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x1bf10): more undefined references to `ccu_gate_ops' follow
>    drivers/built-in.o: In function `.LANCHOR1':
>    sunxi_sid.c:(.data+0x1c61c): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x1c680): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1c710): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1c774): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1c7cc): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x1c834): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x1c8a0): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x1c918): undefined reference to `ccu_nkm_ops'
>    sunxi_sid.c:(.data+0x1c984): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x1c9d8): undefined reference to `ccu_nk_ops'
>    sunxi_sid.c:(.data+0x1ca50): undefined reference to `ccu_nkm_ops'
>    sunxi_sid.c:(.data+0x1cabc): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x1cb28): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x1cb94): undefined reference to `ccu_nm_ops'
>    sunxi_sid.c:(.data+0x1cc08): undefined reference to `ccu_nkmp_ops'
>    sunxi_sid.c:(.data+0x1d25c): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1d2c0): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1d328): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1d38c): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1d3f0): undefined reference to `ccu_div_ops'
>    drivers/built-in.o:sunxi_sid.c:(.data+0x1d454): more undefined references to `ccu_div_ops' follow
>    drivers/built-in.o: In function `.LANCHOR1':
>    sunxi_sid.c:(.data+0x1d48c): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1d4c8): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1d504): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1d56c): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1d5d4): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1d638): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1d69c): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1d6f0): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x1d754): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1d7b8): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1d7f0): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1d82c): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1d868): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1d8a4): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1d8e0): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1d938): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x1d99c): undefined reference to `ccu_div_ops'
>    sunxi_sid.c:(.data+0x1d9d8): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1da14): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1da50): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1da8c): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1dac8): undefined reference to `ccu_gate_ops'
>    sunxi_sid.c:(.data+0x1db20): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x1db74): undefined reference to `ccu_mux_ops'
>    sunxi_sid.c:(.data+0x1dbec): undefined reference to `ccu_mp_ops'
>    sunxi_sid.c:(.data+0x1dc64): undefined reference to `ccu_mp_ops'

It seems like even though the lib.a file is compiled properly, it is
never linked in. It looks like we would be supposed to add
drivers/clk/sunxi-ng/ to libs-y, but that doesn't seem to work for
Makefiles in drivers/*

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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


#1658574 — Re: [PATCH] clk: sunxi-ng: Move all clock types to a library

FromArnd Bergmann <arnd@arndb.de>
Date2017-06-06 12:10 +0200
SubjectRe: [PATCH] clk: sunxi-ng: Move all clock types to a library
Message-ID<tPjB0-7ik-21@gated-at.bofh.it>
In reply to#1657644
On Mon, Jun 5, 2017 at 4:45 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Sat, Jun 03, 2017 at 12:22:32PM +0800, kbuild test robot wrote:
>> Hi Stephen,
>>
>> [auto build test ERROR on sunxi/sunxi/for-next]
>> [also build test ERROR on next-20170602]
>> [cannot apply to clk/clk-next v4.12-rc3]
>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>>
>>    sunxi_sid.c:(.data+0x1da8c): undefined reference to `ccu_gate_ops'
>>    sunxi_sid.c:(.data+0x1dac8): undefined reference to `ccu_gate_ops'
>>    sunxi_sid.c:(.data+0x1db20): undefined reference to `ccu_mux_ops'
>>    sunxi_sid.c:(.data+0x1db74): undefined reference to `ccu_mux_ops'
>>    sunxi_sid.c:(.data+0x1dbec): undefined reference to `ccu_mp_ops'
>>    sunxi_sid.c:(.data+0x1dc64): undefined reference to `ccu_mp_ops'
>
> It seems like even though the lib.a file is compiled properly, it is
> never linked in. It looks like we would be supposed to add
> drivers/clk/sunxi-ng/ to libs-y, but that doesn't seem to work for
> Makefiles in drivers/*

Ah, too bad. I see that only one directory under drivers/ uses something
with lib.a, in drivers/firmware/efi/libstub/Makefile, but that seems to
rely on being special-cased as well.

However, this patch seems to fix it:

diff --git a/drivers/clk/sunxi-ng/Makefile b/drivers/clk/sunxi-ng/Makefile
index cbc8cb4f70e3..321d3da7cc6a 100644
--- a/drivers/clk/sunxi-ng/Makefile
+++ b/drivers/clk/sunxi-ng/Makefile
@@ -18,16 +18,16 @@ lib-$(CONFIG_SUNXI_CCU) += ccu_nm.o
 lib-$(CONFIG_SUNXI_CCU) += ccu_mp.o

 # SoC support
-obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o
-obj-$(CONFIG_SUN5I_CCU) += ccu-sun5i.o
-obj-$(CONFIG_SUN6I_A31_CCU) += ccu-sun6i-a31.o
-obj-$(CONFIG_SUN8I_A23_CCU) += ccu-sun8i-a23.o
-obj-$(CONFIG_SUN8I_A33_CCU) += ccu-sun8i-a33.o
-obj-$(CONFIG_SUN8I_A83T_CCU) += ccu-sun8i-a83t.o
-obj-$(CONFIG_SUN8I_H3_CCU) += ccu-sun8i-h3.o
-obj-$(CONFIG_SUN8I_V3S_CCU) += ccu-sun8i-v3s.o
-obj-$(CONFIG_SUN8I_DE2_CCU) += ccu-sun8i-de2.o
-obj-$(CONFIG_SUN8I_R_CCU) += ccu-sun8i-r.o
-obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80.o
-obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-de.o
-obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-usb.o
+obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o lib.a
+obj-$(CONFIG_SUN5I_CCU) += ccu-sun5i.o lib.a
+obj-$(CONFIG_SUN6I_A31_CCU) += ccu-sun6i-a31.o lib.a
+obj-$(CONFIG_SUN8I_A23_CCU) += ccu-sun8i-a23.o lib.a
+obj-$(CONFIG_SUN8I_A33_CCU) += ccu-sun8i-a33.o lib.a
+obj-$(CONFIG_SUN8I_A83T_CCU) += ccu-sun8i-a83t.o lib.a
+obj-$(CONFIG_SUN8I_H3_CCU) += ccu-sun8i-h3.o lib.a
+obj-$(CONFIG_SUN8I_V3S_CCU) += ccu-sun8i-v3s.o lib.a
+obj-$(CONFIG_SUN8I_DE2_CCU) += ccu-sun8i-de2.o lib.a
+obj-$(CONFIG_SUN8I_R_CCU) += ccu-sun8i-r.o lib.a
+obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80.o lib.a
+obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-de.o lib.a
+obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-usb.o lib.a

It's not documented behavior, but I think it's still good enough,
and improves the current version, unless there is another bug
after we add this to your patch.

        Arnd

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


#1659250 — Re: [PATCH] clk: sunxi-ng: Move all clock types to a library

FromStephen Boyd <sboyd@codeaurora.org>
Date2017-06-07 00:10 +0200
SubjectRe: [PATCH] clk: sunxi-ng: Move all clock types to a library
Message-ID<tPuPM-6gH-3@gated-at.bofh.it>
In reply to#1658574
On 06/06, Arnd Bergmann wrote:
> On Mon, Jun 5, 2017 at 4:45 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > Hi,
> >
> > On Sat, Jun 03, 2017 at 12:22:32PM +0800, kbuild test robot wrote:
> >> Hi Stephen,
> >>
> >> [auto build test ERROR on sunxi/sunxi/for-next]
> >> [also build test ERROR on next-20170602]
> >> [cannot apply to clk/clk-next v4.12-rc3]
> >> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> >>
> >>    sunxi_sid.c:(.data+0x1da8c): undefined reference to `ccu_gate_ops'
> >>    sunxi_sid.c:(.data+0x1dac8): undefined reference to `ccu_gate_ops'
> >>    sunxi_sid.c:(.data+0x1db20): undefined reference to `ccu_mux_ops'
> >>    sunxi_sid.c:(.data+0x1db74): undefined reference to `ccu_mux_ops'
> >>    sunxi_sid.c:(.data+0x1dbec): undefined reference to `ccu_mp_ops'
> >>    sunxi_sid.c:(.data+0x1dc64): undefined reference to `ccu_mp_ops'
> >
> > It seems like even though the lib.a file is compiled properly, it is
> > never linked in. It looks like we would be supposed to add
> > drivers/clk/sunxi-ng/ to libs-y, but that doesn't seem to work for
> > Makefiles in drivers/*
> 
> Ah, too bad. I see that only one directory under drivers/ uses something
> with lib.a, in drivers/firmware/efi/libstub/Makefile, but that seems to
> rely on being special-cased as well.
> 
> However, this patch seems to fix it:
> 
> diff --git a/drivers/clk/sunxi-ng/Makefile b/drivers/clk/sunxi-ng/Makefile
> index cbc8cb4f70e3..321d3da7cc6a 100644
> --- a/drivers/clk/sunxi-ng/Makefile
> +++ b/drivers/clk/sunxi-ng/Makefile
> @@ -18,16 +18,16 @@ lib-$(CONFIG_SUNXI_CCU) += ccu_nm.o
>  lib-$(CONFIG_SUNXI_CCU) += ccu_mp.o
> 
>  # SoC support
> -obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o
> -obj-$(CONFIG_SUN5I_CCU) += ccu-sun5i.o
> -obj-$(CONFIG_SUN6I_A31_CCU) += ccu-sun6i-a31.o
> -obj-$(CONFIG_SUN8I_A23_CCU) += ccu-sun8i-a23.o
> -obj-$(CONFIG_SUN8I_A33_CCU) += ccu-sun8i-a33.o
> -obj-$(CONFIG_SUN8I_A83T_CCU) += ccu-sun8i-a83t.o
> -obj-$(CONFIG_SUN8I_H3_CCU) += ccu-sun8i-h3.o
> -obj-$(CONFIG_SUN8I_V3S_CCU) += ccu-sun8i-v3s.o
> -obj-$(CONFIG_SUN8I_DE2_CCU) += ccu-sun8i-de2.o
> -obj-$(CONFIG_SUN8I_R_CCU) += ccu-sun8i-r.o
> -obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80.o
> -obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-de.o
> -obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-usb.o
> +obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o lib.a
> +obj-$(CONFIG_SUN5I_CCU) += ccu-sun5i.o lib.a
> +obj-$(CONFIG_SUN6I_A31_CCU) += ccu-sun6i-a31.o lib.a
> +obj-$(CONFIG_SUN8I_A23_CCU) += ccu-sun8i-a23.o lib.a
> +obj-$(CONFIG_SUN8I_A33_CCU) += ccu-sun8i-a33.o lib.a
> +obj-$(CONFIG_SUN8I_A83T_CCU) += ccu-sun8i-a83t.o lib.a
> +obj-$(CONFIG_SUN8I_H3_CCU) += ccu-sun8i-h3.o lib.a
> +obj-$(CONFIG_SUN8I_V3S_CCU) += ccu-sun8i-v3s.o lib.a
> +obj-$(CONFIG_SUN8I_DE2_CCU) += ccu-sun8i-de2.o lib.a
> +obj-$(CONFIG_SUN8I_R_CCU) += ccu-sun8i-r.o lib.a
> +obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80.o lib.a
> +obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-de.o lib.a
> +obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-usb.o lib.a
> 
> It's not documented behavior, but I think it's still good enough,
> and improves the current version, unless there is another bug
> after we add this to your patch.

We should add a comment above this so we know what the lib.a is
all about. As you say, it's not documented.

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

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


#1659381 — Re: [PATCH] clk: sunxi-ng: Move all clock types to a library

FromChen-Yu Tsai <wens@csie.org>
Date2017-06-07 07:50 +0200
SubjectRe: [PATCH] clk: sunxi-ng: Move all clock types to a library
Message-ID<tPC0V-2oJ-3@gated-at.bofh.it>
In reply to#1658574
On Tue, Jun 6, 2017 at 6:04 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Mon, Jun 5, 2017 at 4:45 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
>> Hi,
>>
>> On Sat, Jun 03, 2017 at 12:22:32PM +0800, kbuild test robot wrote:
>>> Hi Stephen,
>>>
>>> [auto build test ERROR on sunxi/sunxi/for-next]
>>> [also build test ERROR on next-20170602]
>>> [cannot apply to clk/clk-next v4.12-rc3]
>>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>>>
>>>    sunxi_sid.c:(.data+0x1da8c): undefined reference to `ccu_gate_ops'
>>>    sunxi_sid.c:(.data+0x1dac8): undefined reference to `ccu_gate_ops'
>>>    sunxi_sid.c:(.data+0x1db20): undefined reference to `ccu_mux_ops'
>>>    sunxi_sid.c:(.data+0x1db74): undefined reference to `ccu_mux_ops'
>>>    sunxi_sid.c:(.data+0x1dbec): undefined reference to `ccu_mp_ops'
>>>    sunxi_sid.c:(.data+0x1dc64): undefined reference to `ccu_mp_ops'
>>
>> It seems like even though the lib.a file is compiled properly, it is
>> never linked in. It looks like we would be supposed to add
>> drivers/clk/sunxi-ng/ to libs-y, but that doesn't seem to work for
>> Makefiles in drivers/*
>
> Ah, too bad. I see that only one directory under drivers/ uses something
> with lib.a, in drivers/firmware/efi/libstub/Makefile, but that seems to
> rely on being special-cased as well.
>
> However, this patch seems to fix it:
>
> diff --git a/drivers/clk/sunxi-ng/Makefile b/drivers/clk/sunxi-ng/Makefile
> index cbc8cb4f70e3..321d3da7cc6a 100644
> --- a/drivers/clk/sunxi-ng/Makefile
> +++ b/drivers/clk/sunxi-ng/Makefile
> @@ -18,16 +18,16 @@ lib-$(CONFIG_SUNXI_CCU) += ccu_nm.o
>  lib-$(CONFIG_SUNXI_CCU) += ccu_mp.o
>
>  # SoC support
> -obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o
> -obj-$(CONFIG_SUN5I_CCU) += ccu-sun5i.o
> -obj-$(CONFIG_SUN6I_A31_CCU) += ccu-sun6i-a31.o
> -obj-$(CONFIG_SUN8I_A23_CCU) += ccu-sun8i-a23.o
> -obj-$(CONFIG_SUN8I_A33_CCU) += ccu-sun8i-a33.o
> -obj-$(CONFIG_SUN8I_A83T_CCU) += ccu-sun8i-a83t.o
> -obj-$(CONFIG_SUN8I_H3_CCU) += ccu-sun8i-h3.o
> -obj-$(CONFIG_SUN8I_V3S_CCU) += ccu-sun8i-v3s.o
> -obj-$(CONFIG_SUN8I_DE2_CCU) += ccu-sun8i-de2.o
> -obj-$(CONFIG_SUN8I_R_CCU) += ccu-sun8i-r.o
> -obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80.o
> -obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-de.o
> -obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-usb.o
> +obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o lib.a
> +obj-$(CONFIG_SUN5I_CCU) += ccu-sun5i.o lib.a
> +obj-$(CONFIG_SUN6I_A31_CCU) += ccu-sun6i-a31.o lib.a
> +obj-$(CONFIG_SUN8I_A23_CCU) += ccu-sun8i-a23.o lib.a
> +obj-$(CONFIG_SUN8I_A33_CCU) += ccu-sun8i-a33.o lib.a
> +obj-$(CONFIG_SUN8I_A83T_CCU) += ccu-sun8i-a83t.o lib.a
> +obj-$(CONFIG_SUN8I_H3_CCU) += ccu-sun8i-h3.o lib.a
> +obj-$(CONFIG_SUN8I_V3S_CCU) += ccu-sun8i-v3s.o lib.a
> +obj-$(CONFIG_SUN8I_DE2_CCU) += ccu-sun8i-de2.o lib.a
> +obj-$(CONFIG_SUN8I_R_CCU) += ccu-sun8i-r.o lib.a
> +obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80.o lib.a
> +obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-de.o lib.a
> +obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-usb.o lib.a
>
> It's not documented behavior, but I think it's still good enough,
> and improves the current version, unless there is another bug
> after we add this to your patch.

I think having just

obj-$(CONFIG_SUNXI_CCU) += lib.a

at the bottom (with a comment) would be cleaner, and
we wouldn't need to modify all the existing lines.
AFAIK about Makefiles, that should work?

ChenYu

>
>         Arnd

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


#1659483 — Re: [PATCH] clk: sunxi-ng: Move all clock types to a library

FromArnd Bergmann <arnd@arndb.de>
Date2017-06-07 09:40 +0200
SubjectRe: [PATCH] clk: sunxi-ng: Move all clock types to a library
Message-ID<tPDJo-3zy-29@gated-at.bofh.it>
In reply to#1659381
On Wed, Jun 7, 2017 at 7:45 AM, Chen-Yu Tsai <wens@csie.org> wrote:
> at the bottom (with a comment) would be cleaner, and
> we wouldn't need to modify all the existing lines.
> AFAIK about Makefiles, that should work?

Ah, yes. That's much better.

      Arnd

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


#1659505 — Re: [PATCH] clk: sunxi-ng: Move all clock types to a library

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2017-06-07 10:20 +0200
SubjectRe: [PATCH] clk: sunxi-ng: Move all clock types to a library
Message-ID<tPEm5-44h-3@gated-at.bofh.it>
In reply to#1659483

[Multipart message — attachments visible in raw view] — view raw

On Wed, Jun 07, 2017 at 09:36:34AM +0200, Arnd Bergmann wrote:
> On Wed, Jun 7, 2017 at 7:45 AM, Chen-Yu Tsai <wens@csie.org> wrote:
> > at the bottom (with a comment) would be cleaner, and
> > we wouldn't need to modify all the existing lines.
> > AFAIK about Makefiles, that should work?
> 
> Ah, yes. That's much better.
> 
>       Arnd

I just applied the original patch, with that addition, and a comment
as suggested by Stephen.

thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web