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: 1281281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 65B22DF288 for ; Mon, 6 Aug 2012 21:38:10 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SyUuC-00034L-3G; Mon, 06 Aug 2012 21:32:04 +0000 Received: from na3sys009aog111.obsmtp.com ([74.125.149.205]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1SyUu8-000347-HP for linux-arm-kernel@lists.infradead.org; Mon, 06 Aug 2012 21:32:01 +0000 Received: from mail-pb0-f44.google.com ([209.85.160.44]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKUCA3zuHlirB6imcn8KFXJNFD9wvM6NFm@postini.com; Mon, 06 Aug 2012 14:32:00 PDT Received: by pbbrr4 with SMTP id rr4so4508382pbb.3 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=fMX2dw8D0W3z0+474fhHb4XmcSA9WW4lOJ9fvPXqtYrEdYFivUiNwYpphUOAGKW4EB +J6bpHSCy/JZSJkY/WGv39z/z+AiM847BoHmn+LqkxhWF7xg3ic6jA8P7w42i2SCCUp2 3rc8xbpiH77ldrKffr0yK61F3SHLvsmeeCKHKd6jgsS1Pi32rjxB7J6k0j+jIERNZDr4 hziUd6+vJhML3nyIEl6krs9H9ucE9DlRaZ516JUwguEmdBK05XFxohzGBzKz1gKBmKDa dhb2s+/AKmznd748yMtvOcJm7xDtac9g+JMQwbxc9ayWAAnpTYn9ooFX0kOa/OAJoWKz lzIg== 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 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: ALoCoQmSiEXtPWXTLSBO0l43qr1UPrvKFIgBrl/ZD+aiod7c7qyRHcECZHh+7hP9PWq4X6C3pTjO X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.205 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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] 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");