Comment 34 for bug 709245

Revision history for this message
Paolo Pisati (p-pisati) wrote :

comparing the boot logs of an smp and a nosmp kernel (see attached file), what struck me was an error message about the smp_twd clock:

 CPU: Testing write buffer coherency: ok
-twd_timer_setup: no clock found <<<<<
-Calibrating local timer... 492.00MHz. <<<<<
 L310 cache controller enabled
 l2x0: 16 ways, CACHE_ID 0x410000c4, AUX_CTRL 0x5e470000, Cache size: 1048576 B

looking closer at the code, i found that:

smp_twd.c::twd_timer_setup():

...
    if (twd_clk == NULL) {
        twd_clk = clk_get_sys("smp_twd", NULL);
        if (IS_ERR_OR_NULL(twd_clk))
            pr_warn("%s: no clock found\n", __func__);
    }
...

and clk_get_sys() prototype is:

struct clk *clk_get_sys(const char *dev_id, const char *con_id)

while clocks are defined as:

clock44xx_data.c in struct omap_clk omap44xx_clks[]:
...
CLK(NULL, "smp_twd", &smp_twd, CK_44XX)
...

#define CLK(dev, con, ck, cp) \
    { \
         .cpu = cp, \
        .lk = { \
            .dev_id = dev, \
            .con_id = con, \
            .clk = ck, \
        }, \
    }

so the parameters in clk_get_sys() are inverted:

--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -175,7 +175,8 @@ static void __cpuinit twd_calibrate_rate(void)
  */
 void __cpuinit twd_timer_setup(struct clock_event_device *clk)
 {
        if (twd_clk == NULL) {
- twd_clk = clk_get_sys("smp_twd", NULL);
+ twd_clk = clk_get_sys(NULL, "smp_twd");
                if (IS_ERR_OR_NULL(twd_clk))
                        pr_warn("%s: no clock found\n", __func__);

this will make the error go away, but unfortunately won't fix the i/o problem.

hdparm -t /dev/sda1

smp:

/dev/sda1:
 Timing buffered disk reads: 6 MB in 4.73 seconds = 1.27 MB/sec

nosmp:

/dev/sda1:
 Timing buffered disk reads: 44 MB in 3.08 seconds = 14.27 MB/sec