Re: linux-next: origin tree build failure

Paul Mundt
2009-06-25T04:13:39Z

On Thu, Jun 25, 2009 at 06:24:08AM +0300, Baruch Siach wrote:
> Hi Stephen,
>
> On Thu, Jun 25, 2009 at 11:13:44AM +1000, Stephen Rothwell wrote:
> > Today's linux-next build (x86_64 allmodconfig) failed like this:
> >
> > ERROR: "clk_enable" [drivers/i2c/busses/i2c-designware.ko] undefined!
> > ERROR: "clk_disable" [drivers/i2c/busses/i2c-designware.ko] undefined!
> > ERROR: "clk_put" [drivers/i2c/busses/i2c-designware.ko] undefined!
> > ERROR: "clk_get_rate" [drivers/i2c/busses/i2c-designware.ko] undefined!
> > ERROR: "clk_get" [drivers/i2c/busses/i2c-designware.ko] undefined!
> >
> > Caused by commit 1ab52cf910bbbee92861227e6ed77c56b1dc233c ("i2c: driver
> > for the Synopsys DesignWare I2C controller") from Linus' tree which I
> > have reverted for today.
>
> So, what is the right configuration symbol to depend on for the clk API?
>
CONFIG_HAVE_CLK.

> A short archives search led to the "provide a dummy implementation of the clk
> API" patch from Uwe Kleine-K?nig
> (http://lkml.indiana.edu/hypermail/linux/kernel/0804.2/2748.html). Is this the
> right solution?
>
Something like this would be better handled in include/linux/clk.h.

One of the things to watch out for is clk_get_rate(), there are
cases in the kernel where the rate is fetched with clk_get_rate() and
then subsequently used as a divisor in some other equation.
clk_get_rate() probably ought to WARN_ON(1) unconditionally, as any
driver wanting rate information is going to need proper clock
information.