Commit 37628606 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

Staging: et131x: spinlocks

Switch to the more normal "flags" naming. Also fix up the nested use of
spin_lock_irqsave
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 25ad00bb
...@@ -484,7 +484,7 @@ void et131x_Mii_check(struct et131x_adapter *etdev, ...@@ -484,7 +484,7 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
uint32_t uiMdiMdix; uint32_t uiMdiMdix;
uint32_t uiMasterSlave; uint32_t uiMasterSlave;
uint32_t uiPolarity; uint32_t uiPolarity;
unsigned long lockflags; unsigned long flags;
DBG_ENTER(et131x_dbginfo); DBG_ENTER(et131x_dbginfo);
...@@ -495,12 +495,12 @@ void et131x_Mii_check(struct et131x_adapter *etdev, ...@@ -495,12 +495,12 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
/* Update our state variables and indicate the /* Update our state variables and indicate the
* connected state * connected state
*/ */
spin_lock_irqsave(&etdev->Lock, lockflags); spin_lock_irqsave(&etdev->Lock, flags);
etdev->MediaState = NETIF_STATUS_MEDIA_CONNECT; etdev->MediaState = NETIF_STATUS_MEDIA_CONNECT;
MP_CLEAR_FLAG(etdev, fMP_ADAPTER_LINK_DETECTION); MP_CLEAR_FLAG(etdev, fMP_ADAPTER_LINK_DETECTION);
spin_unlock_irqrestore(&etdev->Lock, lockflags); spin_unlock_irqrestore(&etdev->Lock, flags);
/* Don't indicate state if we're in loopback mode */ /* Don't indicate state if we're in loopback mode */
if (etdev->RegistryPhyLoopbk == false) if (etdev->RegistryPhyLoopbk == false)
...@@ -533,11 +533,11 @@ void et131x_Mii_check(struct et131x_adapter *etdev, ...@@ -533,11 +533,11 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
(etdev, fMP_ADAPTER_LINK_DETECTION)) (etdev, fMP_ADAPTER_LINK_DETECTION))
|| (etdev->MediaState == || (etdev->MediaState ==
NETIF_STATUS_MEDIA_DISCONNECT)) { NETIF_STATUS_MEDIA_DISCONNECT)) {
spin_lock_irqsave(&etdev->Lock, lockflags); spin_lock_irqsave(&etdev->Lock, flags);
etdev->MediaState = etdev->MediaState =
NETIF_STATUS_MEDIA_DISCONNECT; NETIF_STATUS_MEDIA_DISCONNECT;
spin_unlock_irqrestore(&etdev->Lock, spin_unlock_irqrestore(&etdev->Lock,
lockflags); flags);
/* Only indicate state if we're in loopback /* Only indicate state if we're in loopback
* mode * mode
......
...@@ -119,7 +119,7 @@ extern dbg_info_t *et131x_dbginfo; ...@@ -119,7 +119,7 @@ extern dbg_info_t *et131x_dbginfo;
*/ */
void EnablePhyComa(struct et131x_adapter *etdev) void EnablePhyComa(struct et131x_adapter *etdev)
{ {
unsigned long lockflags; unsigned long flags;
PM_CSR_t GlobalPmCSR; PM_CSR_t GlobalPmCSR;
int32_t LoopCounter = 10; int32_t LoopCounter = 10;
...@@ -134,9 +134,9 @@ void EnablePhyComa(struct et131x_adapter *etdev) ...@@ -134,9 +134,9 @@ void EnablePhyComa(struct et131x_adapter *etdev)
etdev->PoMgmt.PowerDownDuplex = etdev->AiForceDpx; etdev->PoMgmt.PowerDownDuplex = etdev->AiForceDpx;
/* Stop sending packets. */ /* Stop sending packets. */
spin_lock_irqsave(&etdev->SendHWLock, lockflags); spin_lock_irqsave(&etdev->SendHWLock, flags);
MP_SET_FLAG(etdev, fMP_ADAPTER_LOWER_POWER); MP_SET_FLAG(etdev, fMP_ADAPTER_LOWER_POWER);
spin_unlock_irqrestore(&etdev->SendHWLock, lockflags); spin_unlock_irqrestore(&etdev->SendHWLock, flags);
/* Wait for outstanding Receive packets */ /* Wait for outstanding Receive packets */
while ((MP_GET_RCV_REF(etdev) != 0) && (LoopCounter-- > 0)) while ((MP_GET_RCV_REF(etdev) != 0) && (LoopCounter-- > 0))
......
...@@ -685,7 +685,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev) ...@@ -685,7 +685,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)
PFBR_DESC_t pFbrEntry; PFBR_DESC_t pFbrEntry;
uint32_t iEntry; uint32_t iEntry;
RXDMA_PSR_NUM_DES_t psr_num_des; RXDMA_PSR_NUM_DES_t psr_num_des;
unsigned long lockflags; unsigned long flags;
DBG_ENTER(et131x_dbginfo); DBG_ENTER(et131x_dbginfo);
...@@ -718,7 +718,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev) ...@@ -718,7 +718,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)
writel((psr_num_des.bits.psr_ndes * LO_MARK_PERCENT_FOR_PSR) / 100, writel((psr_num_des.bits.psr_ndes * LO_MARK_PERCENT_FOR_PSR) / 100,
&pRxDma->psr_min_des.value); &pRxDma->psr_min_des.value);
spin_lock_irqsave(&etdev->RcvLock, lockflags); spin_lock_irqsave(&etdev->RcvLock, flags);
/* These local variables track the PSR in the adapter structure */ /* These local variables track the PSR in the adapter structure */
pRxLocal->local_psr_full.bits.psr_full = 0; pRxLocal->local_psr_full.bits.psr_full = 0;
...@@ -801,7 +801,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev) ...@@ -801,7 +801,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)
*/ */
writel(etdev->RegistryRxTimeInterval, &pRxDma->max_pkt_time.value); writel(etdev->RegistryRxTimeInterval, &pRxDma->max_pkt_time.value);
spin_unlock_irqrestore(&etdev->RcvLock, lockflags); spin_unlock_irqrestore(&etdev->RcvLock, flags);
DBG_LEAVE(et131x_dbginfo); DBG_LEAVE(et131x_dbginfo);
} }
...@@ -914,7 +914,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev) ...@@ -914,7 +914,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
PMP_RFD pMpRfd; PMP_RFD pMpRfd;
uint32_t nIndex; uint32_t nIndex;
uint8_t *pBufVa; uint8_t *pBufVa;
unsigned long lockflags; unsigned long flags;
struct list_head *element; struct list_head *element;
uint8_t ringIndex; uint8_t ringIndex;
uint16_t bufferIndex; uint16_t bufferIndex;
...@@ -1013,7 +1013,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev) ...@@ -1013,7 +1013,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
} }
/* Get and fill the RFD. */ /* Get and fill the RFD. */
spin_lock_irqsave(&etdev->RcvLock, lockflags); spin_lock_irqsave(&etdev->RcvLock, flags);
pMpRfd = NULL; pMpRfd = NULL;
element = pRxLocal->RecvList.next; element = pRxLocal->RecvList.next;
...@@ -1023,14 +1023,14 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev) ...@@ -1023,14 +1023,14 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
DBG_RX(et131x_dbginfo, DBG_RX(et131x_dbginfo,
"NULL RFD returned from RecvList via list_entry()\n"); "NULL RFD returned from RecvList via list_entry()\n");
DBG_RX_LEAVE(et131x_dbginfo); DBG_RX_LEAVE(et131x_dbginfo);
spin_unlock_irqrestore(&etdev->RcvLock, lockflags); spin_unlock_irqrestore(&etdev->RcvLock, flags);
return NULL; return NULL;
} }
list_del(&pMpRfd->list_node); list_del(&pMpRfd->list_node);
pRxLocal->nReadyRecv--; pRxLocal->nReadyRecv--;
spin_unlock_irqrestore(&etdev->RcvLock, lockflags); spin_unlock_irqrestore(&etdev->RcvLock, flags);
pMpRfd->iBufferIndex = bufferIndex; pMpRfd->iBufferIndex = bufferIndex;
pMpRfd->iRingIndex = ringIndex; pMpRfd->iRingIndex = ringIndex;
...@@ -1260,9 +1260,9 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *etdev) ...@@ -1260,9 +1260,9 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *etdev)
* Besides, we don't really need (at this point) the * Besides, we don't really need (at this point) the
* pending list anyway. * pending list anyway.
*/ */
/* spin_lock_irqsave( &etdev->RcvPendLock, lockflags ); /* spin_lock_irqsave( &etdev->RcvPendLock, flags );
* list_add_tail( &pMpRfd->list_node, &etdev->RxRing.RecvPendingList ); * list_add_tail( &pMpRfd->list_node, &etdev->RxRing.RecvPendingList );
* spin_unlock_irqrestore( &etdev->RcvPendLock, lockflags ); * spin_unlock_irqrestore( &etdev->RcvPendLock, flags );
*/ */
/* Update the number of outstanding Recvs */ /* Update the number of outstanding Recvs */
...@@ -1302,7 +1302,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd) ...@@ -1302,7 +1302,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
struct _RXDMA_t __iomem *pRxDma = &etdev->CSRAddress->rxdma; struct _RXDMA_t __iomem *pRxDma = &etdev->CSRAddress->rxdma;
uint16_t bi = pMpRfd->iBufferIndex; uint16_t bi = pMpRfd->iBufferIndex;
uint8_t ri = pMpRfd->iRingIndex; uint8_t ri = pMpRfd->iRingIndex;
unsigned long lockflags; unsigned long flags;
DBG_RX_ENTER(et131x_dbginfo); DBG_RX_ENTER(et131x_dbginfo);
...@@ -1314,7 +1314,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd) ...@@ -1314,7 +1314,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
(ri == 0 && bi < pRxLocal->Fbr0NumEntries) || (ri == 0 && bi < pRxLocal->Fbr0NumEntries) ||
#endif #endif
(ri == 1 && bi < pRxLocal->Fbr1NumEntries)) { (ri == 1 && bi < pRxLocal->Fbr1NumEntries)) {
spin_lock_irqsave(&etdev->FbrLock, lockflags); spin_lock_irqsave(&etdev->FbrLock, flags);
if (ri == 1) { if (ri == 1) {
PFBR_DESC_t pNextDesc = PFBR_DESC_t pNextDesc =
...@@ -1362,7 +1362,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd) ...@@ -1362,7 +1362,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
&pRxDma->fbr0_full_offset.value); &pRxDma->fbr0_full_offset.value);
} }
#endif #endif
spin_unlock_irqrestore(&etdev->FbrLock, lockflags); spin_unlock_irqrestore(&etdev->FbrLock, flags);
} else { } else {
DBG_ERROR(et131x_dbginfo, DBG_ERROR(et131x_dbginfo,
"NICReturnRFD illegal Buffer Index returned\n"); "NICReturnRFD illegal Buffer Index returned\n");
...@@ -1371,10 +1371,10 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd) ...@@ -1371,10 +1371,10 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
/* The processing on this RFD is done, so put it back on the tail of /* The processing on this RFD is done, so put it back on the tail of
* our list * our list
*/ */
spin_lock_irqsave(&etdev->RcvLock, lockflags); spin_lock_irqsave(&etdev->RcvLock, flags);
list_add_tail(&pMpRfd->list_node, &pRxLocal->RecvList); list_add_tail(&pMpRfd->list_node, &pRxLocal->RecvList);
pRxLocal->nReadyRecv++; pRxLocal->nReadyRecv++;
spin_unlock_irqrestore(&etdev->RcvLock, lockflags); spin_unlock_irqrestore(&etdev->RcvLock, flags);
DBG_ASSERT(pRxLocal->nReadyRecv <= pRxLocal->NumRfd); DBG_ASSERT(pRxLocal->nReadyRecv <= pRxLocal->NumRfd);
DBG_RX_LEAVE(et131x_dbginfo); DBG_RX_LEAVE(et131x_dbginfo);
......
This diff is collapsed.
...@@ -492,18 +492,18 @@ void et131x_error_timer_handler(unsigned long data) ...@@ -492,18 +492,18 @@ void et131x_error_timer_handler(unsigned long data)
void et131x_link_detection_handler(unsigned long data) void et131x_link_detection_handler(unsigned long data)
{ {
struct et131x_adapter *etdev = (struct et131x_adapter *) data; struct et131x_adapter *etdev = (struct et131x_adapter *) data;
unsigned long lockflags; unsigned long flags;
/* Let everyone know that we have run */ /* Let everyone know that we have run */
etdev->bLinkTimerActive = false; etdev->bLinkTimerActive = false;
if (etdev->MediaState == 0) { if (etdev->MediaState == 0) {
spin_lock_irqsave(&etdev->Lock, lockflags); spin_lock_irqsave(&etdev->Lock, flags);
etdev->MediaState = NETIF_STATUS_MEDIA_DISCONNECT; etdev->MediaState = NETIF_STATUS_MEDIA_DISCONNECT;
MP_CLEAR_FLAG(etdev, fMP_ADAPTER_LINK_DETECTION); MP_CLEAR_FLAG(etdev, fMP_ADAPTER_LINK_DETECTION);
spin_unlock_irqrestore(&etdev->Lock, lockflags); spin_unlock_irqrestore(&etdev->Lock, flags);
netif_carrier_off(etdev->netdev); netif_carrier_off(etdev->netdev);
......
...@@ -467,12 +467,12 @@ void et131x_multicast(struct net_device *netdev) ...@@ -467,12 +467,12 @@ void et131x_multicast(struct net_device *netdev)
struct et131x_adapter *adapter = netdev_priv(netdev); struct et131x_adapter *adapter = netdev_priv(netdev);
uint32_t PacketFilter = 0; uint32_t PacketFilter = 0;
uint32_t count; uint32_t count;
unsigned long lockflags; unsigned long flags;
struct dev_mc_list *mclist = netdev->mc_list; struct dev_mc_list *mclist = netdev->mc_list;
DBG_ENTER(et131x_dbginfo); DBG_ENTER(et131x_dbginfo);
spin_lock_irqsave(&adapter->Lock, lockflags); spin_lock_irqsave(&adapter->Lock, flags);
/* Before we modify the platform-independent filter flags, store them /* Before we modify the platform-independent filter flags, store them
* locally. This allows us to determine if anything's changed and if * locally. This allows us to determine if anything's changed and if
...@@ -552,7 +552,7 @@ void et131x_multicast(struct net_device *netdev) ...@@ -552,7 +552,7 @@ void et131x_multicast(struct net_device *netdev)
"NO UPDATE REQUIRED, FLAGS didn't change\n"); "NO UPDATE REQUIRED, FLAGS didn't change\n");
} }
spin_unlock_irqrestore(&adapter->Lock, lockflags); spin_unlock_irqrestore(&adapter->Lock, flags);
DBG_LEAVE(et131x_dbginfo); DBG_LEAVE(et131x_dbginfo);
} }
...@@ -610,7 +610,7 @@ void et131x_tx_timeout(struct net_device *netdev) ...@@ -610,7 +610,7 @@ void et131x_tx_timeout(struct net_device *netdev)
{ {
struct et131x_adapter *etdev = netdev_priv(netdev); struct et131x_adapter *etdev = netdev_priv(netdev);
PMP_TCB pMpTcb; PMP_TCB pMpTcb;
unsigned long lockflags; unsigned long flags;
DBG_WARNING(et131x_dbginfo, "TX TIMEOUT\n"); DBG_WARNING(et131x_dbginfo, "TX TIMEOUT\n");
...@@ -635,7 +635,7 @@ void et131x_tx_timeout(struct net_device *netdev) ...@@ -635,7 +635,7 @@ void et131x_tx_timeout(struct net_device *netdev)
} }
/* Is send stuck? */ /* Is send stuck? */
spin_lock_irqsave(&etdev->TCBSendQLock, lockflags); spin_lock_irqsave(&etdev->TCBSendQLock, flags);
pMpTcb = etdev->TxRing.CurrSendHead; pMpTcb = etdev->TxRing.CurrSendHead;
...@@ -660,7 +660,7 @@ void et131x_tx_timeout(struct net_device *netdev) ...@@ -660,7 +660,7 @@ void et131x_tx_timeout(struct net_device *netdev)
} }
spin_unlock_irqrestore(&etdev->TCBSendQLock, spin_unlock_irqrestore(&etdev->TCBSendQLock,
lockflags); flags);
DBG_WARNING(et131x_dbginfo, DBG_WARNING(et131x_dbginfo,
"Send stuck - reset. pMpTcb->WrIndex %x, Flags 0x%08x\n", "Send stuck - reset. pMpTcb->WrIndex %x, Flags 0x%08x\n",
...@@ -689,7 +689,7 @@ void et131x_tx_timeout(struct net_device *netdev) ...@@ -689,7 +689,7 @@ void et131x_tx_timeout(struct net_device *netdev)
} }
} }
spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags); spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
} }
/** /**
......
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