Re: [PATCH] firmware: wake all waiters

From: Luis R. Rodriguez
Date: Wed Jul 12 2017 - 14:45:36 EST


On Wed, Jul 05, 2017 at 09:33:38AM -0700, Linus Torvalds wrote:
> On Wed, Jul 5, 2017 at 9:18 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > In any case, I'm not seeing why you call it idiotic.
>
> Have you read the problems?
>
> There were originally three users:
>
> - one of them is firmware loading, and it was actively *buggy* due to
> using hat shit interface, and it's going away

To be fair the issue with the firmware loading was due to a regression on the
port from using swait/completion to swait. swake_up() was used instead of
swake_up_all(). Before the port complate_all() was used instead of just
complete().

So I would personally not add the firmware API to the list of reasons why swait
would be crap.

The more *general* semantics issue you pointed out with swake_up() though seem
more reasonable to be attacking the swait API and those are best followed on
the other thread [0].

I should also point out that there are *other* issues with the firmware API on
this whole wait stuff, but that have been present since even before when we
were using the regular wait / completion API -- a wake was never issued upon an
error in some situations on some kernel builds. I have a fix for that now along
with a test case for it which I'll post soon. After all these fixes the code
works as expected with either the swait API or the good 'ol wait/completion
API. But given swait is still out by you as only specialized I did already post
patches to revert the firmware API to switch back to the wait/completion API.

[0] https://lkml.kernel.org/r/CA+55aFykNULx-b6M6FmUYdK2cn-OJKKfjaPwLN5xZGK+bioGaA@xxxxxxxxxxxxxx

Luis