ramips: fix ethernet driver tx completion polling
[librecmc/librecmc.git] / target / linux / ramips / files / drivers / net / ethernet / ralink / ralink_soc_eth.c
index 9900a5e5088479296d3869a1b1fc915a8b316fe8..12c6ccaf98f41e29788021662800a63dc8299e46 100644 (file)
@@ -902,11 +902,11 @@ txpoll_again:
        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);