[Skiboot] [PATCH RFC 2/2] phb4: Use ASB for read/writes to PHB registers on resets

Guilherme G. Piccoli gpiccoli at linux.vnet.ibm.com
Tue Oct 3 09:23:01 AEDT 2017

If we are performing a PHB reset and coming for a bad situation,
(and PHB is fenced), we fail because we don't use ASB by default
in the phb4_init_hw().

This patch makes use of this trick when we are resetting PHBs
to workaround possible problems in PHB (aka it might be fenced)
and at least try to perform the complete initialization.

This proved useful in kdump kernel boot on POWER9 (wspoon).

Signed-off-by: Guilherme G. Piccoli <gpiccoli at linux.vnet.ibm.com>

Tested on wspoon DD 2.01, worked fine. But...after kdump is complete,
system does not reboot automatically. I'll investigate too, could be
another problem or (probably) something due to this change.

I thought in sending it anyway, as-is, in order to get feedback
and stop my investigation in this direction if it does not worth.
Thanks in advance!

 hw/phb4.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/phb4.c b/hw/phb4.c
index 99902d3a..12312a5c 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -4312,6 +4312,10 @@ static void phb4_init_hw(struct phb4 *p, bool first_init)
 	PHBDBG(p, "Initializing PHB4...\n");
+	/* Use ASB to try initialize even if the PHB is fenced. */
+	if (!first_init)
+		p->flags |= PHB4_CFG_USE_ASB;
 	/* Init_1 - Sync reset
 	 * At this point we assume the PHB has already been reset.
@@ -4387,6 +4391,9 @@ static void phb4_init_hw(struct phb4 *p, bool first_init)
 	phb4_write_reg(p, PHB_CTRLR, val);
+        if (!first_init)
+                p->flags &= ~PHB4_CFG_USE_ASB;
 	/* Init_18..41 - Architected IODA3 inits */

More information about the Skiboot mailing list