]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.1/ib-hfi1-handle-wakeup-of-orphaned-qps-for-pio.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.1 / ib-hfi1-handle-wakeup-of-orphaned-qps-for-pio.patch
1 From 931eaaa3e85d9818e48f799a8aa69a9d6fccfffa Mon Sep 17 00:00:00 2001
2 From: Mike Marciniszyn <mike.marciniszyn@intel.com>
3 Date: Fri, 14 Jun 2019 12:33:00 -0400
4 Subject: IB/hfi1: Handle wakeup of orphaned QPs for pio
5
6 [ Upstream commit 099a884ba4c00145cef283d36e050726311c2e95 ]
7
8 Once a send context is taken down due to a link failure, any QPs waiting
9 for pio credits will stay on the waitlist indefinitely.
10
11 Fix by wakeing up all QPs linked to piowait list.
12
13 Fixes: 7724105686e7 ("IB/hfi1: add driver files")
14 Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
15 Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
16 Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
17 Signed-off-by: Doug Ledford <dledford@redhat.com>
18 Signed-off-by: Sasha Levin <sashal@kernel.org>
19 ---
20 drivers/infiniband/hw/hfi1/pio.c | 16 ++++++++++++++++
21 1 file changed, 16 insertions(+)
22
23 diff --git a/drivers/infiniband/hw/hfi1/pio.c b/drivers/infiniband/hw/hfi1/pio.c
24 index a1de566fe95e..1ee47838d4de 100644
25 --- a/drivers/infiniband/hw/hfi1/pio.c
26 +++ b/drivers/infiniband/hw/hfi1/pio.c
27 @@ -952,6 +952,22 @@ void sc_disable(struct send_context *sc)
28 }
29 }
30 spin_unlock(&sc->release_lock);
31 +
32 + write_seqlock(&sc->waitlock);
33 + while (!list_empty(&sc->piowait)) {
34 + struct iowait *wait;
35 + struct rvt_qp *qp;
36 + struct hfi1_qp_priv *priv;
37 +
38 + wait = list_first_entry(&sc->piowait, struct iowait, list);
39 + qp = iowait_to_qp(wait);
40 + priv = qp->priv;
41 + list_del_init(&priv->s_iowait.list);
42 + priv->s_iowait.lock = NULL;
43 + hfi1_qp_wakeup(qp, RVT_S_WAIT_PIO | HFI1_S_WAIT_PIO_DRAIN);
44 + }
45 + write_sequnlock(&sc->waitlock);
46 +
47 spin_unlock_irq(&sc->alloc_lock);
48 }
49
50 --
51 2.20.1
52