ARM: etm: Power down etm(s) when tracing is not enabled
authorArve Hjønnevåg <arve@android.com>
Thu, 24 Feb 2011 00:51:58 +0000 (16:51 -0800)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 20:40:33 +0000 (13:40 -0700)
Without this change a saw an 18% increase in idle power consumption
on one deivce when trace support is compiled into the kernel. Now
I see the same increase only when tracing.

Change-Id: I21bb5ecf1b7d29ce3790ceeb5323409cc22d5a3b
Signed-off-by: Arve Hjønnevåg <arve@android.com>
arch/arm/kernel/etm.c

index b550f5c1104635f6a7f09c8651f1ff4732b32f46..5d0e0696175b235ad597b69ff4e6f27f2711ed07 100644 (file)
@@ -200,7 +200,7 @@ static int trace_stop_etm(struct tracectx *t, int id)
 
        etm_unlock(t, id);
 
-       etm_writel(t, id, 0x440, ETMR_CTRL);
+       etm_writel(t, id, 0x441, ETMR_CTRL);
        while (!(etm_readl(t, id, ETMR_CTRL) & ETMCTRL_PROGRAM) && --timeout)
                ;
        if (!timeout) {
@@ -739,7 +739,7 @@ static int etm_probe(struct amba_device *dev, const struct amba_id *id)
        (void)etm_readl(&tracer, t->etm_regs_count, ETMMR_OSSRR);
 
        t->ncmppairs = etm_readl(t, t->etm_regs_count, ETMR_CONFCODE) & 0xf;
-       etm_writel(t, t->etm_regs_count, 0x440, ETMR_CTRL);
+       etm_writel(t, t->etm_regs_count, 0x441, ETMR_CTRL);
        etm_writel(t, t->etm_regs_count, new_count, ETMR_TRACEIDR);
        etm_lock(t, t->etm_regs_count);