]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.152/qed-add-sanity-check-for-simd-fastpath-handler.patch
Linux 4.4.152
[thirdparty/kernel/stable-queue.git] / releases / 4.4.152 / qed-add-sanity-check-for-simd-fastpath-handler.patch
1 From foo@baz Wed Aug 22 10:28:26 CEST 2018
2 From: Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
3 Date: Mon, 18 Jun 2018 21:58:01 -0700
4 Subject: qed: Add sanity check for SIMD fastpath handler.
5
6 From: Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
7
8 [ Upstream commit 3935a70968820c3994db4de7e6e1c7e814bff875 ]
9
10 Avoid calling a SIMD fastpath handler if it is NULL. The check is needed
11 to handle an unlikely scenario where unsolicited interrupt is destined to
12 a PF in INTa mode.
13
14 Fixes: fe56b9e6a ("qed: Add module with basic common support")
15 Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
16 Signed-off-by: Ariel Elior <ariel.elior@cavium.com>
17 Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
18 Signed-off-by: David S. Miller <davem@davemloft.net>
19 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 ---
22 drivers/net/ethernet/qlogic/qed/qed_main.c | 12 ++++++++++--
23 1 file changed, 10 insertions(+), 2 deletions(-)
24
25 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c
26 +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
27 @@ -461,8 +461,16 @@ static irqreturn_t qed_single_int(int ir
28 /* Fastpath interrupts */
29 for (j = 0; j < 64; j++) {
30 if ((0x2ULL << j) & status) {
31 - hwfn->simd_proto_handler[j].func(
32 - hwfn->simd_proto_handler[j].token);
33 + struct qed_simd_fp_handler *p_handler =
34 + &hwfn->simd_proto_handler[j];
35 +
36 + if (p_handler->func)
37 + p_handler->func(p_handler->token);
38 + else
39 + DP_NOTICE(hwfn,
40 + "Not calling fastpath handler as it is NULL [handler #%d, status 0x%llx]\n",
41 + j, status);
42 +
43 status &= ~(0x2ULL << j);
44 rc = IRQ_HANDLED;
45 }