[Skiboot] [PATCH 3/3] ... to prevent any potential poller recursions during lid load.
Ananth N Mavinakayanahalli
ananth at in.ibm.com
Tue Feb 17 15:20:51 AEDT 2015
On Tue, Feb 17, 2015 at 08:18:57AM +1100, Benjamin Herrenschmidt wrote:
> On Mon, 2015-02-16 at 20:45 +0530, Ananth N Mavinakayanahalli wrote:
...
> > +/* Find and preload all lids needed by hostservices */
> > +void hservices_lid_preload(void)
> > +{
> > + const uint32_t *lid_list = NULL;
> > + size_t num_lids;
> > +
> > + if (!hservice_runtime)
> > + return;
> > +
> > + lid_list = (const uint32_t *)hservice_runtime->get_lid_list(&num_lids);
> > + if (!lid_list) {
> > + prerror("HBRT: get_lid_list() returned NULL\n");
> > + return;
> > + }
> > +
> > + prlog(PR_INFO, "HBRT: %d lids to load\n", (int)num_lids);
> > +
> > + /* Currently HBRT needs only one (OCC) lid */
> > + while (num_lids--)
> > + __hservice_lid_preload(lid_list[num_lids]);
>
> The above looks wrong... for this to work you'd need to use --num_lids,
> otherwise, for let's say 2 lids, you would try to load 2, then 1 instead
> of 1 then 0.
Ugh! Right.. will fix.
...
> > static int hservice_lid_unload(void *buf __unused)
> > diff --git a/core/init.c b/core/init.c
> > index 0b29e2b..018f10f 100644
> > --- a/core/init.c
> > +++ b/core/init.c
> > @@ -645,6 +645,9 @@ void __noreturn main_cpu_entry(const void *fdt, u32 master_cpu)
> > if (platform.init)
> > platform.init();
> >
> > + /* Preload hostservices lids */
> > + hservices_lid_preload();
> > +
>
> Definitely not the right place to call this.
>
> My worry is I think we can get the OCC messages at any time after the
> OPL, but the preload itself can take time operating on FSP and so must
> be done after FSP is ready.
>
> Can you check with the FSP people when exactly we can start getting the
> startOCC messages ? Is it after we set the HV state ? We need to stick
> the preload just before that.
Sure, will check.
> In fact, build this patch on top of Jeremy's that moves hservices_init
> to the FSP platform code, and put the preload code right in the place
> where the FSP will be able to service the load request and before it
> will send us the OCC commands.
Will do.
Thanks for the review!
Ananth
More information about the Skiboot
mailing list