From patchwork Tue Oct 13 08:39:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 53338 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9D8lGBn015005 for ; Tue, 13 Oct 2009 08:47:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759212AbZJMIle (ORCPT ); Tue, 13 Oct 2009 04:41:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757330AbZJMIle (ORCPT ); Tue, 13 Oct 2009 04:41:34 -0400 Received: from smtp.nokia.com ([192.100.122.230]:57749 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756071AbZJMIld (ORCPT ); Tue, 13 Oct 2009 04:41:33 -0400 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx03.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9D8drxf016941; Tue, 13 Oct 2009 11:40:03 +0300 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 13 Oct 2009 11:39:56 +0300 Received: from vaebe101.NOE.Nokia.com ([10.160.244.11]) by vaebh104.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 13 Oct 2009 11:39:56 +0300 Received: from localhost.localdomain ([172.21.40.103]) by vaebe101.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 13 Oct 2009 11:39:56 +0300 From: Eduardo Valentin To: ext Kevin Hilman Cc: Linux-OMAP , Eduardo Valentin , Quadros Roger (EXT-Teleca/Helsinki) Subject: [PATCH 1/1] OMAP3: PM: SmartReflex: Fix scheduled while atomic problem Date: Tue, 13 Oct 2009 11:39:45 +0300 Message-Id: <1255423185-30568-1-git-send-email-eduardo.valentin@nokia.com> X-Mailer: git-send-email 1.6.4.183.g04423 X-OriginalArrivalTime: 13 Oct 2009 08:39:56.0088 (UTC) FILETIME=[BDB34380:01CA4BE0] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 8660863..8946e7c 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -43,6 +43,7 @@ struct omap_sr { int is_sr_reset; int is_autocomp_active; struct clk *clk; + struct clk *vdd_opp_clk; u32 clk_length; u32 req_opp_no; u32 opp1_nvalue, opp2_nvalue, opp3_nvalue, opp4_nvalue; @@ -170,28 +171,24 @@ static u16 get_opp(struct omap_opp *opp_freq_table, static u16 get_vdd1_opp(void) { u16 opp; - struct clk *clk; - clk = clk_get(NULL, "dpll1_ck"); - - if (clk == NULL || IS_ERR(clk) || mpu_opps == NULL) + if (sr1.vdd_opp_clk == NULL || IS_ERR(sr1.vdd_opp_clk) || + mpu_opps == NULL) return 0; - opp = get_opp(mpu_opps + MAX_VDD1_OPP, clk->rate); + opp = get_opp(mpu_opps + MAX_VDD1_OPP, sr1.vdd_opp_clk->rate); return opp; } static u16 get_vdd2_opp(void) { u16 opp; - struct clk *clk; - - clk = clk_get(NULL, "l3_ick"); - if (clk == NULL || IS_ERR(clk) || l3_opps == NULL) + if (sr2.vdd_opp_clk == NULL || IS_ERR(sr2.vdd_opp_clk) || + l3_opps == NULL) return 0; - opp = get_opp(l3_opps + MAX_VDD2_OPP, clk->rate); + opp = get_opp(l3_opps + MAX_VDD2_OPP, sr2.vdd_opp_clk->rate); return opp; } @@ -999,6 +996,8 @@ static int __init omap3_sr_init(void) sr1.clk = clk_get(NULL, "sr1_fck"); sr2.clk = clk_get(NULL, "sr2_fck"); } + sr1.vdd_opp_clk = clk_get(NULL, "dpll1_ck"); + sr2.vdd_opp_clk = clk_get(NULL, "l3_ick"); sr_set_clk_length(&sr1); sr_set_clk_length(&sr2);