diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2013-05-14 20:44:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-16 19:27:38 -0400 |
commit | 91ec61f8f01cf32868e2ed2fa96a299e77964055 (patch) | |
tree | 26c2ce6878232d4b738ee52e1a877e97a6bf0300 | |
parent | 2ea86d5ac6f5c850d719aa79de12c9af53bb244b (diff) |
staging: vt6656: [bug] Fix missing spin lock in iwctl_siwpower.
Fixes occasional dead lock on power up / down.
spin_lock_irq is used because of unlocking with spin_unlock_irq
elsewhere in the driver.
Only relevant to kernels 3.8 and later when command was
transferred to the iw_handler.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: stable@vger.kernel.org # 3.8+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/vt6656/iwctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c index c335808211ee..d0cf7d8a20e5 100644 --- a/drivers/staging/vt6656/iwctl.c +++ b/drivers/staging/vt6656/iwctl.c | |||
@@ -1345,9 +1345,12 @@ int iwctl_siwpower(struct net_device *dev, struct iw_request_info *info, | |||
1345 | return rc; | 1345 | return rc; |
1346 | } | 1346 | } |
1347 | 1347 | ||
1348 | spin_lock_irq(&pDevice->lock); | ||
1349 | |||
1348 | if (wrq->disabled) { | 1350 | if (wrq->disabled) { |
1349 | pDevice->ePSMode = WMAC_POWER_CAM; | 1351 | pDevice->ePSMode = WMAC_POWER_CAM; |
1350 | PSvDisablePowerSaving(pDevice); | 1352 | PSvDisablePowerSaving(pDevice); |
1353 | spin_unlock_irq(&pDevice->lock); | ||
1351 | return rc; | 1354 | return rc; |
1352 | } | 1355 | } |
1353 | if ((wrq->flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) { | 1356 | if ((wrq->flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) { |
@@ -1358,6 +1361,9 @@ int iwctl_siwpower(struct net_device *dev, struct iw_request_info *info, | |||
1358 | pDevice->ePSMode = WMAC_POWER_FAST; | 1361 | pDevice->ePSMode = WMAC_POWER_FAST; |
1359 | PSvEnablePowerSaving((void *)pDevice, pMgmt->wListenInterval); | 1362 | PSvEnablePowerSaving((void *)pDevice, pMgmt->wListenInterval); |
1360 | } | 1363 | } |
1364 | |||
1365 | spin_unlock_irq(&pDevice->lock); | ||
1366 | |||
1361 | switch (wrq->flags & IW_POWER_MODE) { | 1367 | switch (wrq->flags & IW_POWER_MODE) { |
1362 | case IW_POWER_UNICAST_R: | 1368 | case IW_POWER_UNICAST_R: |
1363 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWPOWER: IW_POWER_UNICAST_R \n"); | 1369 | DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWPOWER: IW_POWER_UNICAST_R \n"); |