From: Lorenzo Bianconi Date: Tue, 31 Mar 2026 10:33:24 +0000 (+0200) Subject: net: airoha: Set REG_RX_CPU_IDX() once in airoha_qdma_fill_rx_queue() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=269389ba539834ec80e4d55583fca2cd70e4dc9c;p=thirdparty%2Flinux.git net: airoha: Set REG_RX_CPU_IDX() once in airoha_qdma_fill_rx_queue() It is not necessary to update REG_RX_CPU_IDX register for each iteration of the descriptor loop in airoha_qdma_fill_rx_queue routine. Move REG_RX_CPU_IDX configuration out of the descriptor loop and rely on the last queue head value updated in the descriptor loop. Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20260331-airoha-cpu-idx-out-off-loop-v1-1-75c66b428f50@kernel.org Signed-off-by: Paolo Abeni --- diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c index 2beba017e791d..a9fa96e103edd 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.c +++ b/drivers/net/ethernet/airoha/airoha_eth.c @@ -572,11 +572,12 @@ static int airoha_qdma_fill_rx_queue(struct airoha_queue *q) WRITE_ONCE(desc->msg1, 0); WRITE_ONCE(desc->msg2, 0); WRITE_ONCE(desc->msg3, 0); + } + if (nframes) airoha_qdma_rmw(qdma, REG_RX_CPU_IDX(qid), RX_RING_CPU_IDX_MASK, FIELD_PREP(RX_RING_CPU_IDX_MASK, q->head)); - } return nframes; }