[Skiboot] [PATCH] IPMI: Trigger attention in abort path.

Mahesh J Salgaonkar mahesh at linux.vnet.ibm.com
Thu Oct 24 14:44:38 AEDT 2019


On 2019-10-23 22:16:10 Wed, Vasant Hegde wrote:
> On 10/23/19 9:50 PM, Mahesh Salgaonkar wrote:
> > +	/*
> > +	 * if BMC has attn support then let BMC know that we are terminating by
> > +	 * triggering attn so that BMC will decide whether to reboot/IPL or not
> > +	 * depending on AutoReboot policy.  This helps in cases where OPAL is
> > +	 * crashing/terminating before host reaches to runtime. With BMC
> > +	 * AutoReboot policy, in such cases, it will make sure that system is
> > +	 * moved to Quiesced state after 3 or so attempts to IPL. Without
> > +	 * `attn` call BMC will never know that OPAL is terminating and system
> > +	 * would go into never ending IPL'ing loop.
> > +	 *
> > +	 * When BMC moves the system into Quiesced state, it does not make sure
> > +	 * that all CPU threads are also quiesced. Hence, make sure to move all
> > +	 * secondaries into quiesced state before calling attn.
> > +	 *
> > +	 * Once the system reaches to runtime BMC resets the boot counter.
> > +	 * Hence next time when BMC receieves the attn it will IPL the system
> > +	 * if AutoReboot is enabled. We don't need to worry about self
> > +	 * rebooting
> > +	 */
> > +
> > +	if (platform.bmc->sw->attn_supported) {
> > +		/* Put everybody in stop/quiesce except myself. */
> > +		sreset_all_prepare();
> 
> I think we should validate return value from sreset_all_prepare(). If we
> fails to quiesce the CPU then
> its better to reboot.

Even if it fails, once we trigger attn, BMC will anyway reboot us. Let BMC
decide if it wants to reboot or move into quiesced state for someone to
take a look. That way we try best effort to quiesce secondaries and at
the same time honouring BMC's AutoReboot policy.

> 
> > +		trigger_attn();
> > +		for (;;) ;
> >   	}
> > 
> >   	/* Reboot call */
> >   	if (platform.cec_reboot)
> >   		platform.cec_reboot();
> > 
> > -out:
> >   	while (1)
> >   		time_wait_ms(100);
> >   }
> > diff --git a/include/platform.h b/include/platform.h
> > index 0b043856b..1fdc07fb8 100644
> > --- a/include/platform.h
> > +++ b/include/platform.h
> > @@ -39,6 +39,7 @@ struct bmc_sw_config {
> >   	uint32_t ipmi_oem_partial_add_esel;
> >   	uint32_t ipmi_oem_pnor_access_status;
> >   	uint32_t ipmi_oem_hiomap_cmd;
> > +	uint32_t attn_supported;
> 
> Better bool ?

Yup, we can.

Thanks,
-Mahesh.

-- 
Mahesh J Salgaonkar



More information about the Skiboot mailing list