pci/switchtec: Replace completion wait queue usage for poll
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Sat, 21 Mar 2020 11:25:46 +0000 (12:25 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Sat, 21 Mar 2020 15:00:20 +0000 (16:00 +0100)
commitdeaa0a8a74d86573f190e21ae9a444ea5e3bceee
tree86b43f9a8c2d06c39466cbc3bda43849a28f4d87
parentefbdc769601f4d50018bf7ca50fc9f7c67392ece
pci/switchtec: Replace completion wait queue usage for poll

The poll callback is using the completion wait queue and sticks it into
poll_wait() to wake up pollers after a command has completed.

This works to some extent, but cannot provide EPOLLEXCLUSIVE support
because the waker side uses complete_all() which unconditionally wakes up
all waiters. complete_all() is required because completions internally use
exclusive wait and complete() only wakes up one waiter by default.

This mixes conceptually different mechanisms and relies on internal
implementation details of completions, which in turn puts contraints on
changing the internal implementation of completions.

Replace it with a regular wait queue and store the state in struct
switchtec_user.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200321113240.936097534@linutronix.de
drivers/pci/switch/switchtec.c