]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
c63080b3933a5776557d5bf95bf662b47c245525
[thirdparty/kernel/stable-queue.git] /
1 From foo@baz Tue Apr 10 13:58:07 CEST 2018
2 From: Jia-Ju Bai <baijiaju1990@163.com>
3 Date: Thu, 1 Jun 2017 16:18:10 +0800
4 Subject: qlcnic: Fix a sleep-in-atomic bug in qlcnic_82xx_hw_write_wx_2M and qlcnic_82xx_hw_read_wx_2M
5
6 From: Jia-Ju Bai <baijiaju1990@163.com>
7
8
9 [ Upstream commit 5ea6d691aac6c93b790f0905e3460d44cc4c449b ]
10
11 The driver may sleep under a write spin lock, and the function
12 call path is:
13 qlcnic_82xx_hw_write_wx_2M (acquire the lock by write_lock_irqsave)
14 crb_win_lock
15 qlcnic_pcie_sem_lock
16 usleep_range
17 qlcnic_82xx_hw_read_wx_2M (acquire the lock by write_lock_irqsave)
18 crb_win_lock
19 qlcnic_pcie_sem_lock
20 usleep_range
21
22 To fix it, the usleep_range is replaced with udelay.
23
24 Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
25 Signed-off-by: David S. Miller <davem@davemloft.net>
26 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28 ---
29 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 2 +-
30 1 file changed, 1 insertion(+), 1 deletion(-)
31
32 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
33 +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
34 @@ -341,7 +341,7 @@ qlcnic_pcie_sem_lock(struct qlcnic_adapt
35 }
36 return -EIO;
37 }
38 - usleep_range(1000, 1500);
39 + udelay(1200);
40 }
41
42 if (id_reg)