From patchwork Tue Mar 9 13:23:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sripathy, Vishwanath" X-Patchwork-Id: 84278 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o29DM4RR014959 for ; Tue, 9 Mar 2010 13:23:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752494Ab0CINXP (ORCPT ); Tue, 9 Mar 2010 08:23:15 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:49578 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750870Ab0CINXP convert rfc822-to-8bit (ORCPT ); Tue, 9 Mar 2010 08:23:15 -0500 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o29DNBAc018648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 9 Mar 2010 07:23:14 -0600 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id o29DNBdg018891 for ; Tue, 9 Mar 2010 18:53:11 +0530 (IST) Received: from dbde02.ent.ti.com ([172.24.170.145]) by dbde70.ent.ti.com ([172.24.170.148]) with mapi; Tue, 9 Mar 2010 18:53:11 +0530 From: "Sripathy, Vishwanath" To: "linux-omap@vger.kernel.org" Date: Tue, 9 Mar 2010 18:53:05 +0530 Subject: [PATCH] OMAP3 PM : Remove IVA state conflict between PM and DspBridge code Thread-Topic: [PATCH] OMAP3 PM : Remove IVA state conflict between PM and DspBridge code Thread-Index: AcquDY5KFy38mIaKSr+40ulYaSNyDgRfdlHg Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 09 Mar 2010 13:23:16 +0000 (UTC) Index: kernel-omap3/arch/arm/mach-omap2/pm34xx.c =================================================================== --- kernel-omap3.orig/arch/arm/mach-omap2/pm34xx.c +++ kernel-omap3/arch/arm/mach-omap2/pm34xx.c @@ -764,16 +764,20 @@ static int omap3_pm_suspend(void) omap2_pm_wakeup_on_timer(wakeup_timer_seconds); /* Read current next_pwrsts */ - list_for_each_entry(pwrst, &pwrst_list, node) - pwrst->saved_state = pwrdm_read_next_pwrst(pwrst->pwrdm); - /* Set ones wanted by suspend */ list_for_each_entry(pwrst, &pwrst_list, node) { - if (set_pwrdm_state(pwrst->pwrdm, pwrst->next_state)) - goto restore; - if (pwrdm_clear_all_prev_pwrst(pwrst->pwrdm)) - goto restore; + if (strcmp("iva2_pwrdm", pwrst->pwrdm->name)) + pwrst->saved_state = + pwrdm_read_next_pwrst(pwrst->pwrdm); + } + /* Set ones wanted by suspend */ + list_for_each_entry(pwrst, &pwrst_list, node) { + if (strcmp("iva2_pwrdm", pwrst->pwrdm->name)) { + if (set_pwrdm_state(pwrst->pwrdm, pwrst->next_state)) + goto restore; + if (pwrdm_clear_all_prev_pwrst(pwrst->pwrdm)) + goto restore; + } } - omap_uart_prepare_suspend(); omap3_intc_suspend(); @@ -782,14 +786,16 @@ static int omap3_pm_suspend(void) restore: /* Restore next_pwrsts */ list_for_each_entry(pwrst, &pwrst_list, node) { - state = pwrdm_read_prev_pwrst(pwrst->pwrdm); - if (state > pwrst->next_state) { - printk(KERN_INFO "Powerdomain (%s) didn't enter " - "target state %d\n", - pwrst->pwrdm->name, pwrst->next_state); - ret = -1; + if (strcmp("iva2_pwrdm", pwrst->pwrdm->name)) { + state = pwrdm_read_prev_pwrst(pwrst->pwrdm); + if (state > pwrst->next_state) { + printk(KERN_INFO "Powerdomain (%s) didn't enter" + "target state %d\n", pwrst->pwrdm->name, + pwrst->next_state); + ret = -1; + } + set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); } - set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); } if (ret) printk(KERN_ERR "Could not enter target state in pm_suspend\n"); @@ -1136,6 +1142,12 @@ static void __init prcm_setup_regs(void) /* Clear any pending PRCM interrupts */ prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); + /* Put the IVA2 In Idle */ + prm_rmw_mod_reg_bits(OMAP3430_LASTPOWERSTATEENTERED_MASK, 0, + OMAP3430_IVA2_MOD, PM_PWSTCTRL); + /* Make Clock transition Automatic */ + cm_rmw_mod_reg_bits(OMAP3430_CLKTRCTRL_IVA2_MASK, 0x3, + OMAP3430_IVA2_MOD, CM_CLKSTCTRL); omap3_iva_idle(); omap3_d2d_idle(); @@ -1160,8 +1172,10 @@ void omap3_pm_off_mode_enable(int disabl resource_unlock_opp(VDD2_OPP); #endif list_for_each_entry(pwrst, &pwrst_list, node) { - pwrst->next_state = state; - set_pwrdm_state(pwrst->pwrdm, state); + if (strcmp("iva2_pwrdm", pwrst->pwrdm->name)) { + pwrst->next_state = state; + set_pwrdm_state(pwrst->pwrdm, state); + } } } @@ -1274,7 +1288,10 @@ static int __init pwrdms_setup(struct po if (!pwrst) return -ENOMEM; pwrst->pwrdm = pwrdm; - pwrst->next_state = PWRDM_POWER_RET; + if (strcmp("iva2_pwrdm", pwrdm->name)) + pwrst->next_state = PWRDM_POWER_RET; + else + pwrst->next_state = PWRDM_POWER_OFF; list_add(&pwrst->node, &pwrst_list); if (pwrdm_has_hdwr_sar(pwrdm))