qlcnic: Fix a sleep-in-atomic bug in qlcnic_82xx_hw_write_wx_2M and qlcnic_82xx_hw_re...
authorJia-Ju Bai <baijiaju1990@163.com>
Thu, 1 Jun 2017 08:18:10 +0000 (16:18 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Jun 2017 15:42:19 +0000 (11:42 -0400)
commit5ea6d691aac6c93b790f0905e3460d44cc4c449b
treec90e6d72606ae7d1777cd0ea1018ad46c072679a
parentc2e8471d98f072f0f18acdd7df5b401ed0d29a2c
qlcnic: Fix a sleep-in-atomic bug in qlcnic_82xx_hw_write_wx_2M and qlcnic_82xx_hw_read_wx_2M

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c