* [PATCH v2] staging: vt6656: [bug] Fix missing spin lock in iwctl_siwpower.
@ 2013-05-15 0:44 Malcolm Priestley
0 siblings, 0 replies; only message in thread
From: Malcolm Priestley @ 2013-05-15 0:44 UTC (permalink / raw)
To: gregkh; +Cc: Andres More, linux-wireless
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+
---
drivers/staging/vt6656/iwctl.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c
index c335808..d0cf7d8 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,
return rc;
}
+ spin_lock_irq(&pDevice->lock);
+
if (wrq->disabled) {
pDevice->ePSMode = WMAC_POWER_CAM;
PSvDisablePowerSaving(pDevice);
+ spin_unlock_irq(&pDevice->lock);
return rc;
}
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,
pDevice->ePSMode = WMAC_POWER_FAST;
PSvEnablePowerSaving((void *)pDevice, pMgmt->wListenInterval);
}
+
+ spin_unlock_irq(&pDevice->lock);
+
switch (wrq->flags & IW_POWER_MODE) {
case IW_POWER_UNICAST_R:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWPOWER: IW_POWER_UNICAST_R \n");
--
1.8.1.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-05-15 0:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-15 0:44 [PATCH v2] staging: vt6656: [bug] Fix missing spin lock in iwctl_siwpower Malcolm Priestley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox