Skip to content

Commit

Permalink
powerpc/powernv: Defer OPAL exception handler registration
Browse files Browse the repository at this point in the history
Currently, the OPAL exception vectors are registered before the feature
fixups are processed. This means that the now-firmware-owned vectors
will likely be overwritten by the kernel.

This change moves the exception registration code to an early initcall,
rather than at machine_init time.

Signed-off-by: Jeremy Kerr <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
  • Loading branch information
jk-ozlabs authored and ozbenh committed May 5, 2013
1 parent 73d2fb7 commit c4463b3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions arch/powerpc/platforms/powernv/opal.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ int __init early_init_dt_scan_opal(unsigned long node,
{
const void *basep, *entryp;
unsigned long basesz, entrysz;
u64 glue;

if (depth != 1 || strcmp(uname, "ibm,opal") != 0)
return 0;
Expand All @@ -61,6 +60,16 @@ int __init early_init_dt_scan_opal(unsigned long node,
printk("OPAL V1 detected !\n");
}

return 1;
}

static int __init opal_register_exception_handlers(void)
{
u64 glue;

if (!(powerpc_firmware_features & FW_FEATURE_OPAL))
return -ENODEV;

/* Hookup some exception handlers. We use the fwnmi area at 0x7000
* to provide the glue space to OPAL
*/
Expand All @@ -74,9 +83,11 @@ int __init early_init_dt_scan_opal(unsigned long node,
glue += 128;
opal_register_exception_handler(OPAL_SOFTPATCH_HANDLER, 0, glue);

return 1;
return 0;
}

early_initcall(opal_register_exception_handlers);

int opal_get_chars(uint32_t vtermno, char *buf, int count)
{
s64 len, rc;
Expand Down

0 comments on commit c4463b3

Please sign in to comment.