Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1654904 > unrolled thread

[PATCH] qlcnic: Fix a sleep-in-atomic bug in qlcnic_82xx_hw_write_wx_2M and qlcnic_82xx_hw_read_wx_2M

Started byJia-Ju Bai <baijiaju1990@163.com>
First post2017-06-01 10:20 +0200
Last post2017-06-01 17:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] qlcnic: Fix a sleep-in-atomic bug in qlcnic_82xx_hw_write_wx_2M and qlcnic_82xx_hw_read_wx_2M Jia-Ju Bai <baijiaju1990@163.com> - 2017-06-01 10:20 +0200
    Re: [PATCH] qlcnic: Fix a sleep-in-atomic bug in  qlcnic_82xx_hw_write_wx_2M and qlcnic_82xx_hw_read_wx_2M David Miller <davem@davemloft.net> - 2017-06-01 17:50 +0200

#1654904 — [PATCH] qlcnic: Fix a sleep-in-atomic bug in qlcnic_82xx_hw_write_wx_2M and qlcnic_82xx_hw_read_wx_2M

FromJia-Ju Bai <baijiaju1990@163.com>
Date2017-06-01 10:20 +0200
Subject[PATCH] qlcnic: Fix a sleep-in-atomic bug in qlcnic_82xx_hw_write_wx_2M and qlcnic_82xx_hw_read_wx_2M
Message-ID<tNtuN-61-5@gated-at.bofh.it>
The driver may sleep under a write spin lock, and the function 
call path is:
qlcnic_82xx_hw_write_wx_2M (acquire the lock by write_lock_irqsave)
  crb_win_lock
    qlcnic_pcie_sem_lock
      usleep_range
qlcnic_82xx_hw_read_wx_2M (acquire the lock by write_lock_irqsave)
  crb_win_lock
    qlcnic_pcie_sem_lock
      usleep_range

To fix it, the usleep_range is replaced with udelay.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index 838cc0c..7848cf0 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -341,7 +341,7 @@ static void qlcnic_write_window_reg(u32 addr, void __iomem *bar0, u32 data)
 			}
 			return -EIO;
 		}
-		usleep_range(1000, 1500);
+		udelay(1200);
 	}
 
 	if (id_reg)
-- 
1.7.9.5

[toc] | [next] | [standalone]


#1655272 — Re: [PATCH] qlcnic: Fix a sleep-in-atomic bug in qlcnic_82xx_hw_write_wx_2M and qlcnic_82xx_hw_read_wx_2M

FromDavid Miller <davem@davemloft.net>
Date2017-06-01 17:50 +0200
SubjectRe: [PATCH] qlcnic: Fix a sleep-in-atomic bug in qlcnic_82xx_hw_write_wx_2M and qlcnic_82xx_hw_read_wx_2M
Message-ID<tNAwj-4oP-57@gated-at.bofh.it>
In reply to#1654904
From: Jia-Ju Bai <baijiaju1990@163.com>
Date: Thu,  1 Jun 2017 16:18:10 +0800

> The driver may sleep under a write spin lock, and the function 
> call path is:
> qlcnic_82xx_hw_write_wx_2M (acquire the lock by write_lock_irqsave)
>   crb_win_lock
>     qlcnic_pcie_sem_lock
>       usleep_range
> qlcnic_82xx_hw_read_wx_2M (acquire the lock by write_lock_irqsave)
>   crb_win_lock
>     qlcnic_pcie_sem_lock
>       usleep_range
> 
> To fix it, the usleep_range is replaced with udelay.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web