Author: nbd
Date: 2015-02-01 09:20:37 +0100 (Sun, 01 Feb 2015)
New Revision: 44234

Modified:
   trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
Log:
ramips: fix ethernet driver tx completion polling

- budget is decremented with completed frames, so don't check if done is
smaller
- ACK the interrupt before processing further frames to fix a small race
condition.

Signed-off-by: Felix Fietkau <[email protected]>

Modified: 
trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
===================================================================
--- 
trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c    
    2015-01-31 22:23:01 UTC (rev 44233)
+++ 
trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c    
    2015-02-01 08:20:37 UTC (rev 44234)
@@ -902,11 +902,11 @@
        if (!done)
                return 0;
 
-       if (done < budget) {
+       if (budget) {
+               fe_reg_w32(tx_intr, FE_REG_FE_INT_STATUS);
                hwidx = fe_reg_r32(FE_REG_TX_DTX_IDX0);
                if (idx != hwidx)
                        goto txpoll_again;
-               fe_reg_w32(tx_intr, FE_REG_FE_INT_STATUS);
        }
 
        netdev_completed_queue(netdev, done, bytes_compl);
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to