* [PATCH] netxen: Fix a sleep-in-atomic bug in netxen_nic_hw_read_wx_2M and netxen_nic_hw_write_wx_2M
@ 2017-05-31 9:15 Jia-Ju Bai
0 siblings, 0 replies; 2+ messages in thread
From: Jia-Ju Bai @ 2017-05-31 9:15 UTC (permalink / raw)
To: manish.chopra, rahul.verma, Dept-GELinuxNICDev
Cc: netdev, linux-kernel, Jia-Ju Bai
The driver may sleep under a write spin lock, and function call path is:
netxen_nic_hw_read_wx_2M (acquire the lock by write_lock_irqsave)
crb_win_lock
netxen_pcie_sem_lock
msleep --> may sleep
netxen_nic_hw_write_wx_2M (acquire the lock by write_lock_irqsave)
crb_win_lock
netxen_pcie_sem_lock
msleep --> may sleep
To fix it, the "msleep" is replaced with "mdelay" in netxen_pcie_sem_lock.
Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
index a996801..0a9da42 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
@@ -329,7 +329,7 @@ static void __iomem *pci_base_offset(struct netxen_adapter *adapter,
break;
if (++timeout >= NETXEN_PCIE_SEM_TIMEOUT)
return -EIO;
- msleep(1);
+ mdelay(1);
}
if (id_reg)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] netxen: Fix a sleep-in-atomic bug in netxen_nic_hw_read_wx_2M and netxen_nic_hw_write_wx_2M
@ 2017-06-19 2:47 Jia-Ju Bai
0 siblings, 0 replies; 2+ messages in thread
From: Jia-Ju Bai @ 2017-06-19 2:47 UTC (permalink / raw)
To: rahul.verma, davem; +Cc: netdev, linux-kernel, Jia-Ju Bai
The driver may sleep under a write spin lock, and function call path is:
netxen_nic_hw_read_wx_2M (acquire the lock by write_lock_irqsave)
crb_win_lock
netxen_pcie_sem_lock
msleep --> may sleep
netxen_nic_hw_write_wx_2M (acquire the lock by write_lock_irqsave)
crb_win_lock
netxen_pcie_sem_lock
msleep --> may sleep
To fix it, the "msleep" is replaced with "mdelay" in netxen_pcie_sem_lock.
Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
index a996801..0a9da42 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
@@ -329,7 +329,7 @@ static void __iomem *pci_base_offset(struct netxen_adapter *adapter,
break;
if (++timeout >= NETXEN_PCIE_SEM_TIMEOUT)
return -EIO;
- msleep(1);
+ mdelay(1);
}
if (id_reg)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-19 2:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-31 9:15 [PATCH] netxen: Fix a sleep-in-atomic bug in netxen_nic_hw_read_wx_2M and netxen_nic_hw_write_wx_2M Jia-Ju Bai
2017-06-19 2:47 Jia-Ju Bai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.