Re: [PATCH v2] platform/chrome: cros_ec_spi: Transfer messages at high priority

From: Brian Norris
Date: Wed Apr 03 2019 - 13:55:43 EST


On Wed, Apr 3, 2019 at 10:49 AM Doug Anderson <dianders@xxxxxxxxxxxx> wrote:
> On Wed, Apr 3, 2019 at 10:04 AM Brian Norris <briannorris@xxxxxxxxxxxx> wrote:
> > Does anybody know what the definition of "too long" is for the phrase
> > "Don't queue works which can run for too long" in the documentation?
...
> So I think the summary is that I'm back to being convinced that the
> "system_highpri_wq" should be OK.

Makes sense.

> > > + wait_for_completion(&params.completion);
> >
> > I think flush_workqueue() was discussed and rejected, but what about
> > flush_work()? Then you don't have to worry about the rest of the
> > contents of the workqueue -- just your own work--and I think you could
> > avoid the 'completion'.
...
> Thanks, I'll do that in v3 assuming someone doesn't convince me to
> switch back to a private workqueue.

You can do flush_work() in either case :) Then, if for some reason you
start queueing up other work on your private workqueue, you still
won't have to worry about inter-'work' dependencies.

Brian