]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/amd/xgbe/xgbe-drv.c
Merge remote-tracking branch 'sound-current/for-linus'
[karo-tx-linux.git] / drivers / net / ethernet / amd / xgbe / xgbe-drv.c
index aae9d5ecd1822b16a2812de3bee503f59113adaa..53ce1222b11d13fc8649bc00bb3b083d0ee23525 100644 (file)
@@ -360,6 +360,9 @@ static irqreturn_t xgbe_isr(int irq, void *data)
                        }
                }
 
+               if (XGMAC_GET_BITS(dma_ch_isr, DMA_CH_SR, RBU))
+                       pdata->ext_stats.rx_buffer_unavailable++;
+
                /* Restart the device on a Fatal Bus Error */
                if (XGMAC_GET_BITS(dma_ch_isr, DMA_CH_SR, FBE))
                        schedule_work(&pdata->restart_work);
@@ -384,7 +387,8 @@ static irqreturn_t xgbe_isr(int irq, void *data)
                                /* Read Tx Timestamp to clear interrupt */
                                pdata->tx_tstamp =
                                        hw_if->get_tx_tstamp(pdata);
-                               schedule_work(&pdata->tx_tstamp_work);
+                               queue_work(pdata->dev_workqueue,
+                                          &pdata->tx_tstamp_work);
                        }
                }
        }
@@ -450,7 +454,7 @@ static void xgbe_service_timer(unsigned long data)
 {
        struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data;
 
-       schedule_work(&pdata->service_work);
+       queue_work(pdata->dev_workqueue, &pdata->service_work);
 
        mod_timer(&pdata->service_timer, jiffies + HZ);
 }
@@ -891,7 +895,7 @@ static int xgbe_start(struct xgbe_prv_data *pdata)
        netif_tx_start_all_queues(netdev);
 
        xgbe_start_timers(pdata);
-       schedule_work(&pdata->service_work);
+       queue_work(pdata->dev_workqueue, &pdata->service_work);
 
        DBGPR("<--xgbe_start\n");
 
@@ -1807,6 +1811,7 @@ static int xgbe_tx_poll(struct xgbe_channel *channel)
        struct netdev_queue *txq;
        int processed = 0;
        unsigned int tx_packets = 0, tx_bytes = 0;
+       unsigned int cur;
 
        DBGPR("-->xgbe_tx_poll\n");
 
@@ -1814,10 +1819,15 @@ static int xgbe_tx_poll(struct xgbe_channel *channel)
        if (!ring)
                return 0;
 
+       cur = ring->cur;
+
+       /* Be sure we get ring->cur before accessing descriptor data */
+       smp_rmb();
+
        txq = netdev_get_tx_queue(netdev, channel->queue_index);
 
        while ((processed < XGBE_TX_DESC_MAX_PROC) &&
-              (ring->dirty != ring->cur)) {
+              (ring->dirty != cur)) {
                rdata = XGBE_GET_DESC_DATA(ring, ring->dirty);
                rdesc = rdata->rdesc;