diff options
author | Mithlesh Thukral <mithlesh@linsyssoft.com> | 2009-03-25 06:21:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-17 14:06:31 -0400 |
commit | cc4b8dfc3ff32f890cd5de0ce22de44f124d0d05 (patch) | |
tree | 87599f51989f80cb86f9da51ce75da0a10a88ff2 /drivers/staging | |
parent | 8d17e6ad8113f7534d978b1b3511f62637483fcc (diff) |
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/sxg/sxg.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/sxg/sxg.c b/drivers/staging/sxg/sxg.c index d8edf42ac528..583fbb470e9d 100644 --- a/drivers/staging/sxg/sxg.c +++ b/drivers/staging/sxg/sxg.c | |||
@@ -322,6 +322,8 @@ int sxg_add_msi_isr(struct adapter_t *adapter) | |||
322 | int ret,i; | 322 | int ret,i; |
323 | 323 | ||
324 | if (!adapter->intrregistered) { | 324 | if (!adapter->intrregistered) { |
325 | spin_unlock_irqrestore(&sxg_global.driver_lock, | ||
326 | sxg_global.flags); | ||
325 | for (i=0; i<adapter->nr_msix_entries; i++) { | 327 | for (i=0; i<adapter->nr_msix_entries; i++) { |
326 | ret = request_irq (adapter->msi_entries[i].vector, | 328 | ret = request_irq (adapter->msi_entries[i].vector, |
327 | sxg_isr, | 329 | sxg_isr, |
@@ -329,6 +331,8 @@ int sxg_add_msi_isr(struct adapter_t *adapter) | |||
329 | adapter->netdev->name, | 331 | adapter->netdev->name, |
330 | adapter->netdev); | 332 | adapter->netdev); |
331 | if (ret) { | 333 | if (ret) { |
334 | spin_lock_irqsave(&sxg_global.driver_lock, | ||
335 | sxg_global.flags); | ||
332 | DBG_ERROR("sxg: MSI-X request_irq (%s) " | 336 | DBG_ERROR("sxg: MSI-X request_irq (%s) " |
333 | "FAILED [%x]\n", adapter->netdev->name, | 337 | "FAILED [%x]\n", adapter->netdev->name, |
334 | ret); | 338 | ret); |
@@ -336,6 +340,7 @@ int sxg_add_msi_isr(struct adapter_t *adapter) | |||
336 | } | 340 | } |
337 | } | 341 | } |
338 | } | 342 | } |
343 | spin_lock_irqsave(&sxg_global.driver_lock, sxg_global.flags); | ||
339 | adapter->msi_enabled = TRUE; | 344 | adapter->msi_enabled = TRUE; |
340 | adapter->intrregistered = 1; | 345 | adapter->intrregistered = 1; |
341 | adapter->IntRegistered = TRUE; | 346 | adapter->IntRegistered = TRUE; |