summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-mainline-3.2/omap_fixes/0003-ARM-OMAP4-hwmod-Don-t-wait-for-the-idle-status-if-mo.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-mainline-3.2/omap_fixes/0003-ARM-OMAP4-hwmod-Don-t-wait-for-the-idle-status-if-mo.patch')
-rw-r--r--recipes-kernel/linux/linux-mainline-3.2/omap_fixes/0003-ARM-OMAP4-hwmod-Don-t-wait-for-the-idle-status-if-mo.patch200
1 files changed, 200 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-mainline-3.2/omap_fixes/0003-ARM-OMAP4-hwmod-Don-t-wait-for-the-idle-status-if-mo.patch b/recipes-kernel/linux/linux-mainline-3.2/omap_fixes/0003-ARM-OMAP4-hwmod-Don-t-wait-for-the-idle-status-if-mo.patch
new file mode 100644
index 00000000..aa293045
--- /dev/null
+++ b/recipes-kernel/linux/linux-mainline-3.2/omap_fixes/0003-ARM-OMAP4-hwmod-Don-t-wait-for-the-idle-status-if-mo.patch
@@ -0,0 +1,200 @@
1From 3752df4a899250ce6ad4ebd46e0c58235f9dcfa0 Mon Sep 17 00:00:00 2001
2From: Benoit Cousson <b-cousson@ti.com>
3Date: Fri, 16 Dec 2011 16:09:11 -0800
4Subject: [PATCH 3/6] ARM: OMAP4: hwmod: Don't wait for the idle status if
5 modulemode is not supported
6
7If the module does not have any modulemode, the _disable_module function
8will do nothing. There is then no point waiting for a idle status change.
9
10It will remove the following warnings.
11
12[ 0.331848] omap_hwmod: dmm: _wait_target_disable failed
13[ 0.339935] omap_hwmod: emif_fw: _wait_target_disable failed
14[ 0.348358] omap_hwmod: l3_main_1: _wait_target_disable failed
15[ 0.356964] omap_hwmod: l3_main_2: _wait_target_disable failed
16[ 0.365600] omap_hwmod: l4_abe: _wait_target_disable failed
17[ 0.373931] omap_hwmod: l4_cfg: _wait_target_disable failed
18[ 0.382263] omap_hwmod: l4_per: _wait_target_disable failed
19[ 0.391113] omap_hwmod: l4_wkup: _wait_target_disable failed
20[ 0.399536] omap_hwmod: dma_system: _wait_target_disable failed
21[ 0.408325] omap_hwmod: dss_core: _wait_target_disable failed
22[ 0.416839] omap_hwmod: dss_dispc: _wait_target_disable failed
23[ 0.425445] omap_hwmod: dss_dsi1: _wait_target_disable failed
24[ 0.433990] omap_hwmod: dss_dsi2: _wait_target_disable failed
25[ 0.442504] omap_hwmod: dss_hdmi: _wait_target_disable failed
26[ 0.451019] omap_hwmod: dss_rfbi: _wait_target_disable failed
27[ 0.459564] omap_hwmod: dss_venc: _wait_target_disable failed
28[ 0.489471] omap_hwmod: mailbox: _wait_target_disable failed
29[ 0.505920] omap_hwmod: spinlock: _wait_target_disable failed
30
31Note: For such module, the state is managed automatically by HW according
32to clock domain transition. It is then not possible to wait for idle even
33later in the _idle function since the status will change at clock domain
34boundary.
35
36Signed-off-by: Benoit Cousson <b-cousson@ti.com>
37Cc: Paul Walmsley <paul@pwsan.com>
38Cc: Rajendra Nayak <rnayak@ti.com>
39[paul@pwsan.com: renamed fns to indicate that they are OMAP4-only; moved
40 _wait_target_disable() into _disable_module(), removing duplicate code]
41Signed-off-by: Paul Walmsley <paul@pwsan.com>
42Signed-off-by: Tony Lindgren <tony@atomide.com>
43---
44 arch/arm/mach-omap2/omap_hwmod.c | 98 +++++++++++++++++++-------------------
45 1 files changed, 49 insertions(+), 49 deletions(-)
46
47diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
48index 207a2ff..ebace0f 100644
49--- a/arch/arm/mach-omap2/omap_hwmod.c
50+++ b/arch/arm/mach-omap2/omap_hwmod.c
51@@ -706,27 +706,65 @@ static void _enable_module(struct omap_hwmod *oh)
52 }
53
54 /**
55- * _disable_module - enable CLKCTRL modulemode on OMAP4
56+ * _omap4_wait_target_disable - wait for a module to be disabled on OMAP4
57+ * @oh: struct omap_hwmod *
58+ *
59+ * Wait for a module @oh to enter slave idle. Returns 0 if the module
60+ * does not have an IDLEST bit or if the module successfully enters
61+ * slave idle; otherwise, pass along the return value of the
62+ * appropriate *_cm*_wait_module_idle() function.
63+ */
64+static int _omap4_wait_target_disable(struct omap_hwmod *oh)
65+{
66+ if (!cpu_is_omap44xx())
67+ return 0;
68+
69+ if (!oh)
70+ return -EINVAL;
71+
72+ if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
73+ return 0;
74+
75+ if (oh->flags & HWMOD_NO_IDLEST)
76+ return 0;
77+
78+ return omap4_cminst_wait_module_idle(oh->clkdm->prcm_partition,
79+ oh->clkdm->cm_inst,
80+ oh->clkdm->clkdm_offs,
81+ oh->prcm.omap4.clkctrl_offs);
82+}
83+
84+/**
85+ * _omap4_disable_module - enable CLKCTRL modulemode on OMAP4
86 * @oh: struct omap_hwmod *
87 *
88 * Disable the PRCM module mode related to the hwmod @oh.
89- * No return value.
90+ * Return EINVAL if the modulemode is not supported and 0 in case of success.
91 */
92-static void _disable_module(struct omap_hwmod *oh)
93+static int _omap4_disable_module(struct omap_hwmod *oh)
94 {
95+ int v;
96+
97 /* The module mode does not exist prior OMAP4 */
98- if (cpu_is_omap24xx() || cpu_is_omap34xx())
99- return;
100+ if (!cpu_is_omap44xx())
101+ return -EINVAL;
102
103 if (!oh->clkdm || !oh->prcm.omap4.modulemode)
104- return;
105+ return -EINVAL;
106
107- pr_debug("omap_hwmod: %s: _disable_module\n", oh->name);
108+ pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__);
109
110 omap4_cminst_module_disable(oh->clkdm->prcm_partition,
111 oh->clkdm->cm_inst,
112 oh->clkdm->clkdm_offs,
113 oh->prcm.omap4.clkctrl_offs);
114+
115+ v = _omap4_wait_target_disable(oh);
116+ if (v)
117+ pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
118+ oh->name);
119+
120+ return 0;
121 }
122
123 /**
124@@ -1153,36 +1191,6 @@ static int _wait_target_ready(struct omap_hwmod *oh)
125 }
126
127 /**
128- * _wait_target_disable - wait for a module to be disabled
129- * @oh: struct omap_hwmod *
130- *
131- * Wait for a module @oh to enter slave idle. Returns 0 if the module
132- * does not have an IDLEST bit or if the module successfully enters
133- * slave idle; otherwise, pass along the return value of the
134- * appropriate *_cm*_wait_module_idle() function.
135- */
136-static int _wait_target_disable(struct omap_hwmod *oh)
137-{
138- /* TODO: For now just handle OMAP4+ */
139- if (cpu_is_omap24xx() || cpu_is_omap34xx())
140- return 0;
141-
142- if (!oh)
143- return -EINVAL;
144-
145- if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
146- return 0;
147-
148- if (oh->flags & HWMOD_NO_IDLEST)
149- return 0;
150-
151- return omap4_cminst_wait_module_idle(oh->clkdm->prcm_partition,
152- oh->clkdm->cm_inst,
153- oh->clkdm->clkdm_offs,
154- oh->prcm.omap4.clkctrl_offs);
155-}
156-
157-/**
158 * _lookup_hardreset - fill register bit info for this hwmod/reset line
159 * @oh: struct omap_hwmod *
160 * @name: name of the reset line in the context of this hwmod
161@@ -1524,8 +1532,6 @@ static int _enable(struct omap_hwmod *oh)
162 */
163 static int _idle(struct omap_hwmod *oh)
164 {
165- int ret;
166-
167 pr_debug("omap_hwmod: %s: idling\n", oh->name);
168
169 if (oh->_state != _HWMOD_STATE_ENABLED) {
170@@ -1537,11 +1543,9 @@ static int _idle(struct omap_hwmod *oh)
171 if (oh->class->sysc)
172 _idle_sysc(oh);
173 _del_initiator_dep(oh, mpu_oh);
174- _disable_module(oh);
175- ret = _wait_target_disable(oh);
176- if (ret)
177- pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
178- oh->name);
179+
180+ _omap4_disable_module(oh);
181+
182 /*
183 * The module must be in idle mode before disabling any parents
184 * clocks. Otherwise, the parent clock might be disabled before
185@@ -1642,11 +1646,7 @@ static int _shutdown(struct omap_hwmod *oh)
186 if (oh->_state == _HWMOD_STATE_ENABLED) {
187 _del_initiator_dep(oh, mpu_oh);
188 /* XXX what about the other system initiators here? dma, dsp */
189- _disable_module(oh);
190- ret = _wait_target_disable(oh);
191- if (ret)
192- pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
193- oh->name);
194+ _omap4_disable_module(oh);
195 _disable_clocks(oh);
196 if (oh->clkdm)
197 clkdm_hwmod_disable(oh->clkdm, oh);
198--
1991.7.7.4
200