linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Malcolm Priestley <tvboxspy@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-wireless@vger.kernel.org, Malcolm Priestley <tvboxspy@gmail.com>
Subject: [PATCH 07/13] staging: vt6656: lock changes: vRunCommand nsDMA_tx_packet
Date: Sat,  3 May 2014 15:17:28 +0100	[thread overview]
Message-ID: <1399126654-2663-7-git-send-email-tvboxspy@gmail.com> (raw)
In-Reply-To: <1399126654-2663-1-git-send-email-tvboxspy@gmail.com>

vRunCommand is nolonger atomic add lock for nsDMA_tx_packet.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/wcmd.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index d51cc90..66d59d5 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -279,6 +279,7 @@ void vRunCommand(struct work_struct *work)
 	int ii;
 	u8 byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80};
 	u8 byData;
+	unsigned long flags;
 
 	if (pDevice->Flags & fMP_DISCONNECTED)
 		return;
@@ -667,9 +668,13 @@ void vRunCommand(struct work_struct *work)
 					pDevice->bMoreData = true;
 				}
 
+				spin_lock_irqsave(&pDevice->lock, flags);
+
 				if (nsDMA_tx_packet(pDevice, skb) != 0)
 					DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Multicast ps tx fail\n");
 
+				spin_unlock_irqrestore(&pDevice->lock, flags);
+
 				pMgmt->sNodeDBTable[0].wEnQueueCnt--;
 			}
 		}
@@ -690,9 +695,13 @@ void vRunCommand(struct work_struct *work)
 						pDevice->bMoreData = true;
 					}
 
+					spin_lock_irqsave(&pDevice->lock, flags);
+
 					if (nsDMA_tx_packet(pDevice, skb) != 0)
 						DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "sta ps tx fail\n");
 
+					spin_unlock_irqrestore(&pDevice->lock, flags);
+
 					pMgmt->sNodeDBTable[ii].wEnQueueCnt--;
 					// check if sta ps enable, wait next pspoll
 					// if sta ps disable, send all pending buffers.
-- 
1.9.1


  parent reply	other threads:[~2014-05-03 14:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-03 14:17 [PATCH 01/13] staging: vt6656: lock changes: Remove spin locks Malcolm Priestley
2014-05-03 14:17 ` [PATCH 02/13] staging: vt6656: lock changes: vRunCommand remove locks Malcolm Priestley
2014-05-03 14:17 ` [PATCH 03/13] staging: vt6656: lock changes: RXvMngWorkItem Malcolm Priestley
2014-05-03 14:17 ` [PATCH 04/13] staging: vt6656: lock changes: csMgmt_xmit Malcolm Priestley
2014-05-03 14:17 ` [PATCH 05/13] staging: vt6656: lock changes: vDMA0_tx_80211 Malcolm Priestley
2014-05-03 14:17 ` [PATCH 06/13] staging: vt6656: lock changes: bMgrPrepareBeaconToSend add lock Malcolm Priestley
2014-05-03 14:17 ` Malcolm Priestley [this message]
2014-05-03 14:17 ` [PATCH 08/13] staging: vt6656: lock changes: usbpipe.c add mutex lock Malcolm Priestley
2014-05-03 14:17 ` [PATCH 09/13] staging: vt6656: lock changes: s_nsBulkInUsbIoCompleteRead Malcolm Priestley
2014-05-03 14:17 ` [PATCH 10/13] staging: vt6656: lock changes device_xmit Malcolm Priestley
2014-05-03 14:17 ` [PATCH 11/13] staging: vt6656: usbpipe.c PIPEnsControlOut use usb_control_msg Malcolm Priestley
2014-05-03 14:17 ` [PATCH 12/13] staging: vt6656: PIPEnsControlIn " Malcolm Priestley
2014-05-03 14:17 ` [PATCH 13/13] staging: vt6656: Remove PIPEnsControlOutAsyn/CONTROLnsRequestOutAsyn Malcolm Priestley
2014-05-15 20:31 ` [PATCH 01/13] staging: vt6656: lock changes: Remove spin locks Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399126654-2663-7-git-send-email-tvboxspy@gmail.com \
    --to=tvboxspy@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).