[Skiboot] [PATCH 2/2] Add SBE driver support

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon Apr 16 09:40:17 AEST 2018


On Sun, 2018-04-15 at 14:15 +0530, Vasant Hegde wrote:
> > 
> > > +            p9_sbe_msg_complete(sbe, msg);
> > > +
> > > +            /* Try to send next message */
> > > +            p9_sbe_process_queue(sbe);
> > 
> > Not fan of the recursion here, I would rather have a loop.
> 
> Its in error path. Only when first message sending fails we enter recursion to 
> send second message. Do you really want to convert this to loop?

Yes. I want to avoid recursions. You never know what pathological case
we'll find one day, maybe something's wrong causing the thing to error
immediately but the completion keeps requeueing... that would blow the
stack, which is a very bad failure mode.

Also the loop, you could add some limit on iterations with a big fat
warning.

And the next poll can always restart if the queue non-empty and state
is idle.

Cheers,
Ben.



More information about the Skiboot mailing list