Commit e03ce839 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: lock changes: RXvMngWorkItem.

Narrow atomic locks in RXvMngWorkItem.

We must lock the DequeueRCB and RXvFreeRCB so that
they are in sync.

vMgrRxManagePacket can nolonger be atomically called.

There is no need for an overall lock.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d1d4120f
...@@ -1363,34 +1363,43 @@ void RXvMngWorkItem(struct work_struct *work) ...@@ -1363,34 +1363,43 @@ void RXvMngWorkItem(struct work_struct *work)
struct vnt_rcb *pRCB = NULL; struct vnt_rcb *pRCB = NULL;
struct vnt_rx_mgmt *pRxPacket; struct vnt_rx_mgmt *pRxPacket;
int bReAllocSkb = false; int bReAllocSkb = false;
unsigned long flags;
if (pDevice->Flags & fMP_DISCONNECTED) if (pDevice->Flags & fMP_DISCONNECTED)
return; return;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Rx Mng Thread\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Rx Mng Thread\n");
spin_lock_irq(&pDevice->lock);
while (pDevice->NumRecvMngList!=0) while (pDevice->NumRecvMngList!=0)
{ {
spin_lock_irqsave(&pDevice->lock, flags);
pRCB = pDevice->FirstRecvMngList; pRCB = pDevice->FirstRecvMngList;
pDevice->NumRecvMngList--; pDevice->NumRecvMngList--;
DequeueRCB(pDevice->FirstRecvMngList, pDevice->LastRecvMngList); DequeueRCB(pDevice->FirstRecvMngList, pDevice->LastRecvMngList);
spin_unlock_irqrestore(&pDevice->lock, flags);
if(!pRCB){ if(!pRCB){
break; break;
} }
pRxPacket = &(pRCB->sMngPacket); pRxPacket = &(pRCB->sMngPacket);
vMgrRxManagePacket(pDevice, &pDevice->vnt_mgmt, pRxPacket); vMgrRxManagePacket(pDevice, &pDevice->vnt_mgmt, pRxPacket);
pRCB->Ref--; pRCB->Ref--;
if(pRCB->Ref == 0) { if (pRCB->Ref == 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"RxvFreeMng %d %d\n",pDevice->NumRecvFreeList, pDevice->NumRecvMngList); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"RxvFreeMng %d %d\n",
pDevice->NumRecvFreeList, pDevice->NumRecvMngList);
spin_lock_irqsave(&pDevice->lock, flags);
RXvFreeRCB(pRCB, bReAllocSkb); RXvFreeRCB(pRCB, bReAllocSkb);
spin_unlock_irqrestore(&pDevice->lock, flags);
} else { } else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Rx Mng Only we have the right to free RCB\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Rx Mng Only we have the right to free RCB\n");
} }
} }
pDevice->bIsRxMngWorkItemQueued = false; pDevice->bIsRxMngWorkItemQueued = false;
spin_unlock_irq(&pDevice->lock);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment