summaryrefslogtreecommitdiff
path: root/drivers/staging/vt6655/channel.c
diff options
context:
space:
mode:
authorMalcolm Priestley <tvboxspy@gmail.com>2015-01-11 10:26:12 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-12 19:45:35 -0800
commit95775d12219285d6e0116acb6267864582cd01ef (patch)
tree24aa44a150f966331ba196eea7ca79f0d7a98d9a /drivers/staging/vt6655/channel.c
parentbc22b4978d06e270372dc243f9341d921346f35a (diff)
staging: vt6655: [BUG] Protect MACvSelectPage1 with lock.
The device must not flip to page 1 while in interrupt lock causing loss of connection or dead lock. Protect from changes to page by adding lock where user can change the page in CARDvSetRSPINF, vnt_configure and set_channel Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6655/channel.c')
-rw-r--r--drivers/staging/vt6655/channel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c
index c8f739dd346e..983d9cbd3439 100644
--- a/drivers/staging/vt6655/channel.c
+++ b/drivers/staging/vt6655/channel.c
@@ -202,6 +202,10 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel)
BBvSoftwareReset(pDevice);
if (pDevice->byLocalID > REV_ID_VT3253_B1) {
+ unsigned long flags;
+
+ spin_lock_irqsave(&pDevice->lock, flags);
+
/* set HW default power register */
MACvSelectPage1(pDevice->PortOffset);
RFbSetPower(pDevice, RATE_1M, pDevice->byCurrentCh);
@@ -209,6 +213,8 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel)
RFbSetPower(pDevice, RATE_6M, pDevice->byCurrentCh);
VNSvOutPortB(pDevice->PortOffset + MAC_REG_PWROFDM, pDevice->byCurPwr);
MACvSelectPage0(pDevice->PortOffset);
+
+ spin_unlock_irqrestore(&pDevice->lock, flags);
}
if (pDevice->byBBType == BB_TYPE_11B)