diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2019-12-18 17:34:43 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-12-18 12:34:56 -0800 |
commit | 7359393f3c19c9351e81345ef29f4f47229a6416 (patch) | |
tree | 329171a2f9e4ad79cde9fdd19093969f31a25b2f /drivers/s390/net/qeth_core.h | |
parent | 871602b1079234b2a9279062eaeadb3aad7bc863 (diff) |
s390/qeth: wake up all waiters from qeth_irq()
card->wait_q is shared by different users, for different wake-up
conditions. qeth_irq() can potentially trigger multiple of these
conditions:
1) A change to channel->irq_pending, which qeth_send_control_data() is
waiting for.
2) A change to card->state, which qeth_clear_channel() and
qeth_halt_channel() are waiting for.
As qeth_irq() does only a single wake_up(), we might miss to wake up
a second eligible waiter. Luckily all waiters are guarded with a
timeout, so this situation should recover on its own eventually.
To make things work robustly, add an additional wake_up() for changes
to channel->state. And extract a helper that updates
channel->irq_pending along with the needed wake_up().
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_core.h')
-rw-r--r-- | drivers/s390/net/qeth_core.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index a23875a4fa2b..b54ef12840a2 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -862,6 +862,13 @@ static inline bool qeth_card_hw_is_reachable(struct qeth_card *card) return card->state == CARD_STATE_SOFTSETUP; } +static inline void qeth_unlock_channel(struct qeth_card *card, + struct qeth_channel *channel) +{ + atomic_set(&channel->irq_pending, 0); + wake_up(&card->wait_q); +} + struct qeth_trap_id { __u16 lparnr; char vmname[8]; |