linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Chen-Yu Tsai <wens@csie.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Tobias Regnery <tobias.regnery@gmail.com>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	linux-clk@vger.kernel.org,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Icenowy Zheng <icenowy@aosc.io>
Subject: Re: [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t
Date: Thu, 1 Jun 2017 00:17:50 -0700	[thread overview]
Message-ID: <20170601071750.GP20170@codeaurora.org> (raw)
In-Reply-To: <CAK8P3a37CT0tzdy4V8Hj=-Mu=JrdR08zv2fqVH5Y+hzT7OK4Vg@mail.gmail.com>

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

  reply	other threads:[~2017-06-01  7:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 20:29 [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t Arnd Bergmann
2017-05-23  0:55 ` Stephen Boyd
2017-05-23  7:19   ` Chen-Yu Tsai
2017-05-23  7:54     ` Arnd Bergmann
2017-06-01  7:17       ` Stephen Boyd [this message]
2017-06-01  9:07         ` Arnd Bergmann
2017-06-02 12:15           ` Maxime Ripard
2017-06-02 22:30             ` [PATCH] clk: sunxi-ng: Move all clock types to a library Stephen Boyd
2017-06-03  4:22               ` kbuild test robot
2017-06-05 14:45                 ` Maxime Ripard
2017-06-06 10:04                   ` Arnd Bergmann
2017-06-06 22:08                     ` Stephen Boyd
2017-06-07  5:45                     ` Chen-Yu Tsai
2017-06-07  7:36                       ` Arnd Bergmann
2017-06-07  8:17                         ` Maxime Ripard
2017-06-08  1:46                           ` Masahiro Yamada
2017-05-23  7:31 ` [PATCH] clk: sunxi-ng: select SUNXI_CCU_MULT for sun8i-a83t Chen-Yu Tsai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170601071750.GP20170@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=arnd@arndb.de \
    --cc=icenowy@aosc.io \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=mturquette@baylibre.com \
    --cc=tobias.regnery@gmail.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).