powerpc/powernv: Reorder OPAL subsystem initialisation

Most of the OPAL subsystems are always compiled in for PowerNV and
many of them need to be initialised before or after other OPAL
subsystems. Rather than trying to control this ordering through
machine initcalls it is clearer and easier to control initialisation
order with explicit calls in opal_init.

Signed-off-by: Alistair Popple <alistair@popple.id.au>
Cc: Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Alistair Popple 2015-05-15 14:06:36 +10:00 committed by Michael Ellerman
parent 5703d2f4a1
commit 96e023e753
6 changed files with 19 additions and 8 deletions

View File

@ -240,6 +240,9 @@ extern int opal_elog_init(void);
extern void opal_platform_dump_init(void);
extern void opal_sys_param_init(void);
extern void opal_msglog_init(void);
extern int opal_async_comp_init(void);
extern int opal_sensor_init(void);
extern int opal_hmi_handler_init(void);
extern int opal_machine_check(struct pt_regs *regs);
extern bool opal_mce_check_early_recovery(struct pt_regs *regs);

View File

@ -151,7 +151,7 @@ static struct notifier_block opal_async_comp_nb = {
.priority = 0,
};
static int __init opal_async_comp_init(void)
int __init opal_async_comp_init(void)
{
struct device_node *opal_node;
const __be32 *async;
@ -205,4 +205,3 @@ out_opal_node:
out:
return err;
}
machine_subsys_initcall(powernv, opal_async_comp_init);

View File

@ -170,7 +170,7 @@ static struct notifier_block opal_hmi_handler_nb = {
.priority = 0,
};
static int __init opal_hmi_handler_init(void)
int __init opal_hmi_handler_init(void)
{
int ret;
@ -186,4 +186,3 @@ static int __init opal_hmi_handler_init(void)
}
return 0;
}
machine_subsys_initcall(powernv, opal_hmi_handler_init);

View File

@ -144,4 +144,4 @@ static int __init opal_mem_err_init(void)
}
return 0;
}
machine_subsys_initcall(powernv, opal_mem_err_init);
machine_device_initcall(powernv, opal_mem_err_init);

View File

@ -77,7 +77,7 @@ out:
}
EXPORT_SYMBOL_GPL(opal_get_sensor_data);
static __init int opal_sensor_init(void)
int __init opal_sensor_init(void)
{
struct platform_device *pdev;
struct device_node *sensor;
@ -93,4 +93,3 @@ static __init int opal_sensor_init(void)
return PTR_ERR_OR_ZERO(pdev);
}
machine_subsys_initcall(powernv, opal_sensor_init);

View File

@ -393,7 +393,6 @@ static int __init opal_message_init(void)
}
return 0;
}
machine_early_initcall(powernv, opal_message_init);
int opal_get_chars(uint32_t vtermno, char *buf, int count)
{
@ -807,6 +806,18 @@ static int __init opal_init(void)
of_node_put(consoles);
}
/* Initialise OPAL messaging system */
opal_message_init();
/* Initialise OPAL asynchronous completion interface */
opal_async_comp_init();
/* Initialise OPAL sensor interface */
opal_sensor_init();
/* Initialise OPAL hypervisor maintainence interrupt handling */
opal_hmi_handler_init();
/* Create i2c platform devices */
opal_i2c_create_devs();