Skip to content

Commit

Permalink
powerpc/powernv: Reorder OPAL subsystem initialisation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alistair Popple authored and Michael Ellerman committed May 22, 2015
1 parent 5703d2f commit 96e023e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
3 changes: 3 additions & 0 deletions arch/powerpc/include/asm/opal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions arch/powerpc/platforms/powernv/opal-async.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -205,4 +205,3 @@ static int __init opal_async_comp_init(void)
out:
return err;
}
machine_subsys_initcall(powernv, opal_async_comp_init);
3 changes: 1 addition & 2 deletions arch/powerpc/platforms/powernv/opal-hmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -186,4 +186,3 @@ static int __init opal_hmi_handler_init(void)
}
return 0;
}
machine_subsys_initcall(powernv, opal_hmi_handler_init);
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/powernv/opal-memory-errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
3 changes: 1 addition & 2 deletions arch/powerpc/platforms/powernv/opal-sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data)
}
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;
Expand All @@ -93,4 +93,3 @@ static __init int opal_sensor_init(void)

return PTR_ERR_OR_ZERO(pdev);
}
machine_subsys_initcall(powernv, opal_sensor_init);
13 changes: 12 additions & 1 deletion arch/powerpc/platforms/powernv/opal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 96e023e

Please sign in to comment.