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

Michael Neuling mikey at neuling.org
Tue Oct 3 11:38:51 AEDT 2017


On Mon, 2017-10-02 at 19:23 -0300, Guilherme G. Piccoli wrote:
> 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;
> +

I'm not sure I'm keen on this solution.  We have this code in the creset path
which is calling phb4_init_hw()

	case PHB4_SLOT_CRESET_REINIT:
		PHBDBG(p, "CRESET: Reinitialization\n");
		p->flags &= ~PHB4_AIB_FENCED;
		p->flags &= ~PHB4_CAPP_RECOVERY;
		p->flags &= ~PHB4_CFG_USE_ASB;
		phb4_init_hw(p, false);
		pci_slot_set_state(slot, PHB4_SLOT_CRESET_FRESET);
		return pci_slot_set_sm_timeout(slot, msecs_to_tb(100));

It seems we are clearing it, and then you are setting it immediately after. 
Seems like the initial clearing would be wrong and we're just papering over the
issue.

Mikey


>  	/* 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 */
>  	phb4_init_ioda3(p);
>  


More information about the Skiboot mailing list