struct bcm_sysport_tx_ring *ring)
{
unsigned int released;
+ unsigned long flags;
- spin_lock(&ring->lock);
+ spin_lock_irqsave(&ring->lock, flags);
released = __bcm_sysport_tx_reclaim(priv, ring);
- spin_unlock(&ring->lock);
+ spin_unlock_irqrestore(&ring->lock, flags);
return released;
}
struct netdev_queue *txq;
struct dma_desc *desc;
unsigned int skb_len;
+ unsigned long flags;
dma_addr_t mapping;
u32 len_status;
u16 queue;
txq = netdev_get_tx_queue(dev, queue);
ring = &priv->tx_rings[queue];
- /* lock against tx reclaim in BH context */
- spin_lock(&ring->lock);
+ /* lock against tx reclaim in BH context and TX ring full interrupt */
+ spin_lock_irqsave(&ring->lock, flags);
if (unlikely(ring->desc_count == 0)) {
netif_tx_stop_queue(txq);
netdev_err(dev, "queue %d awake and ring full!\n", queue);
ret = NETDEV_TX_OK;
out:
- spin_unlock(&ring->lock);
+ spin_unlock_irqrestore(&ring->lock, flags);
return ret;
}