Skip to content

Commit 96e023e

Browse files
apopplempe
authored andcommitted
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 <[email protected]> Cc: Mahesh Jagannath Salgaonkar <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 5703d2f commit 96e023e

File tree

6 files changed

+19
-8
lines changed

6 files changed

+19
-8
lines changed

arch/powerpc/include/asm/opal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ extern int opal_elog_init(void);
240240
extern void opal_platform_dump_init(void);
241241
extern void opal_sys_param_init(void);
242242
extern void opal_msglog_init(void);
243+
extern int opal_async_comp_init(void);
244+
extern int opal_sensor_init(void);
245+
extern int opal_hmi_handler_init(void);
243246

244247
extern int opal_machine_check(struct pt_regs *regs);
245248
extern bool opal_mce_check_early_recovery(struct pt_regs *regs);

arch/powerpc/platforms/powernv/opal-async.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static struct notifier_block opal_async_comp_nb = {
151151
.priority = 0,
152152
};
153153

154-
static int __init opal_async_comp_init(void)
154+
int __init opal_async_comp_init(void)
155155
{
156156
struct device_node *opal_node;
157157
const __be32 *async;
@@ -205,4 +205,3 @@ static int __init opal_async_comp_init(void)
205205
out:
206206
return err;
207207
}
208-
machine_subsys_initcall(powernv, opal_async_comp_init);

arch/powerpc/platforms/powernv/opal-hmi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static struct notifier_block opal_hmi_handler_nb = {
170170
.priority = 0,
171171
};
172172

173-
static int __init opal_hmi_handler_init(void)
173+
int __init opal_hmi_handler_init(void)
174174
{
175175
int ret;
176176

@@ -186,4 +186,3 @@ static int __init opal_hmi_handler_init(void)
186186
}
187187
return 0;
188188
}
189-
machine_subsys_initcall(powernv, opal_hmi_handler_init);

arch/powerpc/platforms/powernv/opal-memory-errors.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,4 @@ static int __init opal_mem_err_init(void)
144144
}
145145
return 0;
146146
}
147-
machine_subsys_initcall(powernv, opal_mem_err_init);
147+
machine_device_initcall(powernv, opal_mem_err_init);

arch/powerpc/platforms/powernv/opal-sensor.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data)
7777
}
7878
EXPORT_SYMBOL_GPL(opal_get_sensor_data);
7979

80-
static __init int opal_sensor_init(void)
80+
int __init opal_sensor_init(void)
8181
{
8282
struct platform_device *pdev;
8383
struct device_node *sensor;
@@ -93,4 +93,3 @@ static __init int opal_sensor_init(void)
9393

9494
return PTR_ERR_OR_ZERO(pdev);
9595
}
96-
machine_subsys_initcall(powernv, opal_sensor_init);

arch/powerpc/platforms/powernv/opal.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ static int __init opal_message_init(void)
393393
}
394394
return 0;
395395
}
396-
machine_early_initcall(powernv, opal_message_init);
397396

398397
int opal_get_chars(uint32_t vtermno, char *buf, int count)
399398
{
@@ -807,6 +806,18 @@ static int __init opal_init(void)
807806
of_node_put(consoles);
808807
}
809808

809+
/* Initialise OPAL messaging system */
810+
opal_message_init();
811+
812+
/* Initialise OPAL asynchronous completion interface */
813+
opal_async_comp_init();
814+
815+
/* Initialise OPAL sensor interface */
816+
opal_sensor_init();
817+
818+
/* Initialise OPAL hypervisor maintainence interrupt handling */
819+
opal_hmi_handler_init();
820+
810821
/* Create i2c platform devices */
811822
opal_i2c_create_devs();
812823

0 commit comments

Comments
 (0)