[Skiboot] [PATCH] core: POWER9 implement OPAL_SIGNAL_SYSTEM_RESET

Nicholas Piggin npiggin at gmail.com
Thu Sep 14 16:36:33 AEST 2017


On Thu, 14 Sep 2017 12:29:05 +1000
Benjamin Herrenschmidt <benh at kernel.crashing.org> wrote:

> On Wed, 2017-09-13 at 18:50 +1000, Nicholas Piggin wrote:
> > +static int core_set_special_wakeup(struct cpu_thread *cpu)
> > +{
> > +       uint32_t chip_id = pir_to_chip_id(cpu->pir);
> > +       uint32_t core_id = pir_to_core_id(cpu->pir);
> > +       uint32_t swake_addr;
> > +       uint32_t gpmmr_addr;
> > +       uint64_t val;
> > +       int i;
> > +
> > +       swake_addr = XSCOM_ADDR_P9_EC(core_id, P9_PPM_SPWKUP_OTR);
> > +       gpmmr_addr = XSCOM_ADDR_P9_EC(core_id, P9_PPM_GPMMR);
> > +  
> 
> We need a common place to handle special wakeups (with per-core use
> counts) because I bet you that's not the only place that will need it.
> 
> Talking of which ... why do we need it anyway ? Won't the sreset wake
> up the core ?

I did try that, but it seems not to handle running vs idle threads
properly. Does not set SRR1[46:47] for threads in power save mode,
by the looks.

So we have to assert special wakeup, read out the stop state of the
thread, set the PWR bit if needed, then we can do the sreset. It
would be nice to just ping the sreset, but this has been working
robustly so far. We *could* possibly work around things by adding
some extra checks to idle paths, but I prefer not to if we can do it
this way (unless there is some other good reason not to).

Thanks,
Nick


More information about the Skiboot mailing list