[PATCH] powerpc/powernv: Bump opal_init initcall priority

2015-06-11 Thread Alistair Popple
opal_init() is called via a machine_subsys_initcall(). Due to a hack
in the eeh code the eeh driver is initialised with at the same
initcall level. This means depending on link ordering the following
error can occur because the opal irchip has not been initialised:

irq: XICS didn't like hwirq-0x9 to VIRQ17 mapping (rc=-22)
pnv_eeh_post_init: Can't request OPAL event interrupt (0)

This patch solves the issue by making sure opal_init is called prior
to the subsystems that may need it.

Signed-off-by: Alistair Popple 
Reported-by: Daniel Axtens 
---

Michael,

This fixes a problem in your next tree introduced by my opal irqchip
series. I encountered similar problems when moving some of the other
subsystems across to the new interface which was the motivation behind
the first patch in that series (powerpc/powernv: Reorder OPAL
subsystem initialisation). I missed this one due to a quirk in the
generic eeh code.

It seems that initcall dependencies are not well defined (or at least
my understanding of the dependencies isn't), so I'm not overly
comfortable with this fix. To be honest I don't have a clear
understanding of what side effects bumping this up a level might have
- it boots, everything seems to "work", and a quick grep reveals
nothing obvious. However I'm open to suggestions for a better fix...

In the meantime this should fix the problem in your branch until I get
a chance to dig further.

- Alistair

 arch/powerpc/platforms/powernv/opal.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/opal.c 
b/arch/powerpc/platforms/powernv/opal.c
index 9e9c483..cc3ba5f 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -718,7 +718,7 @@ static int __init opal_init(void)

return 0;
 }
-machine_subsys_initcall(powernv, opal_init);
+machine_arch_initcall(powernv, opal_init);

 void opal_shutdown(void)
 {
--
1.7.10.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] powerpc/powernv: Bump opal_init initcall priority

2015-06-13 Thread Daniel Axtens
On Thu, 2015-06-11 at 19:25 +1000, Alistair Popple wrote:
> opal_init() is called via a machine_subsys_initcall(). Due to a hack
> in the eeh code the eeh driver is initialised with at the same
> initcall level. This means depending on link ordering the following
> error can occur because the opal irchip has not been initialised:
> 
> irq: XICS didn't like hwirq-0x9 to VIRQ17 mapping (rc=-22)
> pnv_eeh_post_init: Can't request OPAL event interrupt (0)
> 
> This patch solves the issue by making sure opal_init is called prior
> to the subsystems that may need it.
> 
> Signed-off-by: Alistair Popple 
> Reported-by: Daniel Axtens 

This fixes the bug I was experiencing.
Tested-by: Daniel Axtens 

-- 
Regards,
Daniel

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev