diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 329b908b4033..588e7df0b1cc 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -1086,13 +1086,13 @@ static int am65_cpsw_nuss_tx_poll(struct napi_struct *napi_tx, int budget) else num_tx = am65_cpsw_nuss_tx_compl_packets(tx_chn->common, tx_chn->id, budget); - num_tx = min(num_tx, budget); - if (num_tx < budget) { - napi_complete(napi_tx); - enable_irq(tx_chn->irq); - } + if (num_tx >= budget) + return budget; - return num_tx; + if (napi_complete_done(napi_tx, num_tx)) + enable_irq(tx_chn->irq); + + return 0; } static irqreturn_t am65_cpsw_nuss_rx_irq(int irq, void *dev_id)