lkml.org 
[lkml]   [2019]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Regression: spi: core: avoid waking pump thread from spi_sync instead run teardown delayed
On Tue, Jan 15, 2019 at 09:58:55PM +0100, Martin Sperl wrote:

> Maybe a bigger change to the reduce the complexity of
> the state machine would solve that problem and also
> reduce code complexity...

Yeah, that's where I was getting to with that test patch I posted.

> I may find some time over the weekend if no solution
> has been found until then.

Thanks for volunteering :)

> The way I would envision it it would have a “state”
> as a level (0=shutdown, 1=hw enabled, 2=in pump,
> 3=in transfer, 4=in hw-mode,...) and a complete
> to allow waking the shutdown thread (and by this
> avoiding the busy wait loop we have now).
> This would replace those idling, busy, and running flags.

That's a good idea, yes - a single enum much more reflects what we can
actually do in terms of transitions.

> Drawback: it is invasive, but let us see what it
> really looks like...

I think we need to either drop your change (which would be bad since it
is a big performance improvement, I'd punted it for later when I did the
original refactoring to push the work into the caller threads then never
got around to it) or have a invasive changes to make the new situation
clearer. Right now things are just far too complex to reason about
which isn't helping anyone.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-01-15 22:26    [W:0.082 / U:8.492 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site