]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.0.15/ib-hfi1-clear-the-iowait-pending-bits-when-qp-is-put.patch
Linux 5.0.15
[thirdparty/kernel/stable-queue.git] / releases / 5.0.15 / ib-hfi1-clear-the-iowait-pending-bits-when-qp-is-put.patch
1 From 0b2831840daeb32bb0c286cc92fbbd1451cebf18 Mon Sep 17 00:00:00 2001
2 From: Kaike Wan <kaike.wan@intel.com>
3 Date: Mon, 18 Mar 2019 09:55:29 -0700
4 Subject: IB/hfi1: Clear the IOWAIT pending bits when QP is put into error
5 state
6
7 [ Upstream commit 93b289b9aff66eca7575b09f36f5abbeca8e6167 ]
8
9 When a QP is put into error state, it may be waiting for send engine
10 resources. In this case, the QP will be removed from the send engine's
11 waiting list, but its IOWAIT pending bits are not cleared. This will
12 normally not have any major impact as the QP is being destroyed. However,
13 the QP still needs to wind down its operations, such as draining the send
14 queue by scheduling the send engine. Clearing the pending bits will avoid
15 any potential complications. In addition, if the QP will eventually hang,
16 clearing the pending bits can help debugging by presenting a consistent
17 picture if the user dumps the qp_stats.
18
19 This patch clears a QP's IOWAIT_PENDING_IB and IO_PENDING_TID bits in
20 priv->s_iowait.flags in this case.
21
22 Fixes: 5da0fc9dbf89 ("IB/hfi1: Prepare resource waits for dual leg")
23 Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
24 Reviewed-by: Alex Estrin <alex.estrin@intel.com>
25 Signed-off-by: Kaike Wan <kaike.wan@intel.com>
26 Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
27 Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
28 Signed-off-by: Sasha Levin <sashal@kernel.org>
29 ---
30 drivers/infiniband/hw/hfi1/qp.c | 2 ++
31 1 file changed, 2 insertions(+)
32
33 diff --git a/drivers/infiniband/hw/hfi1/qp.c b/drivers/infiniband/hw/hfi1/qp.c
34 index 5866f358ea044..df8e812804b34 100644
35 --- a/drivers/infiniband/hw/hfi1/qp.c
36 +++ b/drivers/infiniband/hw/hfi1/qp.c
37 @@ -834,6 +834,8 @@ void notify_error_qp(struct rvt_qp *qp)
38 if (!list_empty(&priv->s_iowait.list) &&
39 !(qp->s_flags & RVT_S_BUSY)) {
40 qp->s_flags &= ~HFI1_S_ANY_WAIT_IO;
41 + iowait_clear_flag(&priv->s_iowait, IOWAIT_PENDING_IB);
42 + iowait_clear_flag(&priv->s_iowait, IOWAIT_PENDING_TID);
43 list_del_init(&priv->s_iowait.list);
44 priv->s_iowait.lock = NULL;
45 rvt_put_qp(qp);
46 --
47 2.20.1
48