Skip to content

Commit

Permalink
powerpc/powernv: Move opal_power_control_init() call in opal_init().
Browse files Browse the repository at this point in the history
opal_power_control_init() depends on opal message notifier to be
initialized, which is done in opal_init()->opal_message_init(). But both
these initialization are called through machine initcalls and it all
depends on in which order they being called. So far these are called in
correct order (may be we got lucky) and never saw any issue. But it is
clearer to control initialization order explicitly by moving
opal_power_control_init() into opal_init().

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Mahesh Salgaonkar authored and Michael Ellerman committed Dec 21, 2018
1 parent ae6263c commit 08fb726
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/opal.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ extern int opal_async_comp_init(void);
extern int opal_sensor_init(void);
extern int opal_hmi_handler_init(void);
extern int opal_event_init(void);
int opal_power_control_init(void);

extern int opal_machine_check(struct pt_regs *regs);
extern bool opal_mce_check_early_recovery(struct pt_regs *regs);
Expand Down
3 changes: 1 addition & 2 deletions arch/powerpc/platforms/powernv/opal-power.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static struct notifier_block opal_power_control_nb = {
.priority = 0,
};

static int __init opal_power_control_init(void)
int __init opal_power_control_init(void)
{
int ret, supported = 0;
struct device_node *np;
Expand Down Expand Up @@ -176,4 +176,3 @@ static int __init opal_power_control_init(void)

return 0;
}
machine_subsys_initcall(powernv, opal_power_control_init);
3 changes: 3 additions & 0 deletions arch/powerpc/platforms/powernv/opal.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,9 @@ static int __init opal_init(void)
/* Initialise OPAL sensor groups */
opal_sensor_groups_init();

/* Initialise OPAL Power control interface */
opal_power_control_init();

return 0;
}
machine_subsys_initcall(powernv, opal_init);
Expand Down

0 comments on commit 08fb726

Please sign in to comment.