Staging: sxg: Fix sleep in atomic context warning while loading driver
Leave a spinlock before calling request_irq(). request_irq() calls kmalloc which can sleep. This was generating a warning dump while driver is loaded. Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com> Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
8d17e6ad81
commit
cc4b8dfc3f
1 changed files with 5 additions and 0 deletions
|
@ -322,6 +322,8 @@ int sxg_add_msi_isr(struct adapter_t *adapter)
|
||||||
int ret,i;
|
int ret,i;
|
||||||
|
|
||||||
if (!adapter->intrregistered) {
|
if (!adapter->intrregistered) {
|
||||||
|
spin_unlock_irqrestore(&sxg_global.driver_lock,
|
||||||
|
sxg_global.flags);
|
||||||
for (i=0; i<adapter->nr_msix_entries; i++) {
|
for (i=0; i<adapter->nr_msix_entries; i++) {
|
||||||
ret = request_irq (adapter->msi_entries[i].vector,
|
ret = request_irq (adapter->msi_entries[i].vector,
|
||||||
sxg_isr,
|
sxg_isr,
|
||||||
|
@ -329,6 +331,8 @@ int sxg_add_msi_isr(struct adapter_t *adapter)
|
||||||
adapter->netdev->name,
|
adapter->netdev->name,
|
||||||
adapter->netdev);
|
adapter->netdev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
spin_lock_irqsave(&sxg_global.driver_lock,
|
||||||
|
sxg_global.flags);
|
||||||
DBG_ERROR("sxg: MSI-X request_irq (%s) "
|
DBG_ERROR("sxg: MSI-X request_irq (%s) "
|
||||||
"FAILED [%x]\n", adapter->netdev->name,
|
"FAILED [%x]\n", adapter->netdev->name,
|
||||||
ret);
|
ret);
|
||||||
|
@ -336,6 +340,7 @@ int sxg_add_msi_isr(struct adapter_t *adapter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
spin_lock_irqsave(&sxg_global.driver_lock, sxg_global.flags);
|
||||||
adapter->msi_enabled = TRUE;
|
adapter->msi_enabled = TRUE;
|
||||||
adapter->intrregistered = 1;
|
adapter->intrregistered = 1;
|
||||||
adapter->IntRegistered = TRUE;
|
adapter->IntRegistered = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue