Skip to content

Commit c956b75

Browse files
Rajendra NayakPaul Walmsley
authored andcommitted
OMAP: powerdomains: Make all powerdomain target states as ON at init
Program all powerdomain target state as ON; this is to prevent domains from hitting low power states (if bootloader has target states set to something other than ON) and potentially even losing context while PM is not fully initialized, which can cause the system to crash. The PM late init code can then program the desired target state for all the power domains. Signed-off-by: Rajendra Nayak <[email protected]> Signed-off-by: Santosh Shilimkar <[email protected]> [[email protected]: dropped comment typo hunk; fixed comment indent and moved to kerneldoc; moved code to pwrdm_init(); changed pwrdm_init() argument name to prevent clash; cleaned up patch description] Signed-off-by: Paul Walmsley <[email protected]>
1 parent 5ccc387 commit c956b75

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

arch/arm/mach-omap2/powerdomain.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,28 +195,35 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused)
195195

196196
/**
197197
* pwrdm_init - set up the powerdomain layer
198-
* @pwrdm_list: array of struct powerdomain pointers to register
198+
* @pwrdms: array of struct powerdomain pointers to register
199199
* @custom_funcs: func pointers for arch specific implementations
200200
*
201-
* Loop through the array of powerdomains @pwrdm_list, registering all
202-
* that are available on the current CPU. If pwrdm_list is supplied
203-
* and not null, all of the referenced powerdomains will be
204-
* registered. No return value. XXX pwrdm_list is not really a
205-
* "list"; it is an array. Rename appropriately.
201+
* Loop through the array of powerdomains @pwrdms, registering all
202+
* that are available on the current CPU. Also, program all
203+
* powerdomain target state as ON; this is to prevent domains from
204+
* hitting low power states (if bootloader has target states set to
205+
* something other than ON) and potentially even losing context while
206+
* PM is not fully initialized. The PM late init code can then program
207+
* the desired target state for all the power domains. No return
208+
* value.
206209
*/
207-
void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs)
210+
void pwrdm_init(struct powerdomain **pwrdms, struct pwrdm_ops *custom_funcs)
208211
{
209212
struct powerdomain **p = NULL;
213+
struct powerdomain *temp_p;
210214

211215
if (!custom_funcs)
212216
WARN(1, "powerdomain: No custom pwrdm functions registered\n");
213217
else
214218
arch_pwrdm = custom_funcs;
215219

216-
if (pwrdm_list) {
217-
for (p = pwrdm_list; *p; p++)
220+
if (pwrdms) {
221+
for (p = pwrdms; *p; p++)
218222
_pwrdm_register(*p);
219223
}
224+
225+
list_for_each_entry(temp_p, &pwrdm_list, node)
226+
pwrdm_set_next_pwrst(temp_p, PWRDM_POWER_ON);
220227
}
221228

222229
/**

0 commit comments

Comments
 (0)