From patchwork Mon Aug 6 21:31:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 1281271 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 55FDB3FD2B for ; Mon, 6 Aug 2012 21:31:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756018Ab2HFVbx (ORCPT ); Mon, 6 Aug 2012 17:31:53 -0400 Received: from na3sys009aog122.obsmtp.com ([74.125.149.147]:58760 "EHLO na3sys009aog122.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755996Ab2HFVbv (ORCPT ); Mon, 6 Aug 2012 17:31:51 -0400 Received: from mail-pb0-f42.google.com ([209.85.160.42]) (using TLSv1) by na3sys009aob122.postini.com ([74.125.148.12]) with SMTP ID DSNKUCA3xkOQB/HUhDKNQDtw/BCGqZjgS/Nv@postini.com; Mon, 06 Aug 2012 14:31:51 PDT Received: by pbbrp12 with SMTP id rp12so6543875pbb.29 for ; Mon, 06 Aug 2012 14:31:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type:x-gm-message-state; bh=xGW8Py4h/AWJnLbr5QkXpgm1fqrjl29bjRZE608rxQY=; b=Iv+EeUzbVfONo+iYLxqvoz83+19BcyELw9JUdlG0G9DlWrCSUZbbzegUDI5iAhbhVq 9kRO+0ofz/7/eWhc8zw/uPdduDBHoi6H0cnK9N6sd+sBeP9vF4gpCPNCP3q8uNph3TdO fH5y5FFzEO9ZTsUeVO+HAn5xNviQM/037Z1QaVgUlBzZR0H+mR5x9iWLnJNwQQW/f4bZ LIXE85dn/A3vXq7ZljPG82zhFY/Rk0rcR/iRiN6Wg1/qDcratBXdY8VV1wdeCIJb/HGE 8qT4g4z6LF4elHh7eWBZGwMXQQmJol+kMA3aKTk5qwvsTpq/Kq6NbJJcgzdbZbo7Bbw1 VTfA== Received: by 10.68.218.101 with SMTP id pf5mr22003800pbc.60.1344288709853; Mon, 06 Aug 2012 14:31:49 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net. [24.19.7.36]) by mx.google.com with ESMTPS id nv6sm9667120pbc.42.2012.08.06.14.31.48 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 14:31:48 -0700 (PDT) From: Kevin Hilman To: Paul Walmsley Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: DSS and USBHOST powerdomains not entering low-power states on 37xx EVM Organization: Texas Instruments, Inc. References: Date: Mon, 06 Aug 2012 14:31:48 -0700 In-Reply-To: (Paul Walmsley's message of "Fri, 3 Aug 2012 14:05:55 -0600 (MDT)") Message-ID: <877gtb6723.fsf@ti.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkEbVIHXz+5VzuF3t1IgG+1jh/jqTBCjYaYTsbFotvNXJO4ilhPSMH2oLaeYXDYu1llr4Ys Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Hi Paul, Paul Walmsley writes: > On v3.6-rc1 on 37xx EVM, DSS and USBHOST powerdomains aren't entering > low-power states. Test log is below. Is this only happening on this 37xx platform? Just curious, because it seems to be a problem on any OMAP3xxx SoC. [...] > # echo mem > /sys/power/state > [ 35.068359] PM: Syncing filesystems ... done. > [ 35.083038] Freezing user space processes ... (elapsed 0.00 seconds) > done. > [ 35.090698] Freezing remaining freezable tasks ... (elapsed 0.02 > seconds) done. > [ 35.122833] Suspending console(s) (use no_console_suspend to debug) > [ 35.144409] PM: suspend of devices complete after 11.260 msecs > [ 35.147369] PM: late suspend of devices complete after 2.929 msecs > [ 35.152465] PM: noirq suspend of devices complete after 5.096 msecs > [ 35.152526] Disabling non-boot CPUs ... > [ 36.958343] Successfully put all powerdomains to target state According to the readback of prev pwrst, it seems they are hitting the target pwrst (retention by default), so... > [ 36.960662] PM: noirq resume of devices complete after 2.166 msecs > [ 36.964050] PM: early resume of devices complete after 1.892 msecs > [ 36.973388] PM: resume of devices complete after 9.185 msecs > [ 37.025207] Restarting tasks ... done. > # cat /debug/pm_debug/count > usbhost_pwrdm > (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0 > sgx_pwrdm (OFF),OFF:1,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0 > core_pwrdm > (ON),OFF:0,RET:1,INA:0,ON:2,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:0 > per_pwrdm (ON),OFF:0,RET:1,INA:0,ON:2,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0 > dss_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0 > cam_pwrdm (RET),OFF:0,RET:1,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0 > neon_pwrdm (ON),OFF:0,RET:673,INA:0,ON:674,RET-LOGIC-OFF:0 > mpu_pwrdm (ON),OFF:0,RET:673,INA:0,ON:674,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0 > iva2_pwrdm (RET),OFF:0,RET:1,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:0,RET-MEMBANK3-OFF:0,RET-ME > MBANK4-OFF:0 > usbhost_clkdm->usbhost_pwrdm (1) > sgx_clkdm->sgx_pwrdm (0) > per_clkdm->per_pwrdm (22) > cam_clkdm->cam_pwrdm (0) > dss_clkdm->dss_pwrdm (1) > d2d_clkdm->core_pwrdm (0) > iva2_clkdm->iva2_pwrdm (0) > mpu_clkdm->mpu_pwrdm (0) > core_l4_clkdm->core_pwrdm (24) > core_l3_clkdm->core_pwrdm (4) > neon_clkdm->neon_pwrdm (0) ...it must be the usecounts that are not being updated. This seems to be a side effect of the pre/post transition optimization I did. A quick hack seems to indicate that that's indeed the case[1]. By default, omap_sram_idle() is now only calling the pre/post callbacks for MPU, NEON, PER, and CORE, and only if those domains are transitioning, so any other domains not explicitly managed by the idle path have lots their usecounting. Oops. I guess Tero's usecounting series should fix this up. Kevin [1] --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index e4fc88c..d87416f 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -70,6 +70,7 @@ void (*omap3_do_wfi_sram)(void); static struct powerdomain *mpu_pwrdm, *neon_pwrdm; static struct powerdomain *core_pwrdm, *per_pwrdm; +static struct powerdomain *dss_pwrdm, *usbhost_pwrdm; static void omap3_core_save_context(void) { @@ -393,7 +394,11 @@ static int omap3_pm_suspend(void) omap3_intc_suspend(); + pwrdm_pre_transition(dss_pwrdm); + pwrdm_pre_transition(usbhost_pwrdm); omap_sram_idle(); + pwrdm_post_transition(usbhost_pwrdm); + pwrdm_post_transition(dss_pwrdm); restore: /* Restore next_pwrsts */ @@ -718,6 +723,8 @@ int __init omap3_pm_init(void) neon_pwrdm = pwrdm_lookup("neon_pwrdm"); per_pwrdm = pwrdm_lookup("per_pwrdm"); core_pwrdm = pwrdm_lookup("core_pwrdm"); + dss_pwrdm = pwrdm_lookup("dss_pwrdm"); + usbhost_pwrdm = pwrdm_lookup("usbhost_pwrdm"); neon_clkdm = clkdm_lookup("neon_clkdm"); mpu_clkdm = clkdm_lookup("mpu_clkdm");