From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5561938654F; Sat, 17 Oct 2026 16:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792254127; cv=none; b=UHYGKKJz+2SRnU6RYaTRxJtLntgMRb5vWFjBpc24GKWR8ACvA+E6cQ7MsOOTm/DdoX1vi9n73+Ap1vOJfJwmlxruApOOV7uXnurhggrmfhBaqdkLXmaaa/DQMFTl4L/qWXp6bpn5F6X+MuGxIGa2fBZURGhtANnyq1a7+MEiCkk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792254127; c=relaxed/simple; bh=Px40ikDji87uWhhm7en2qb5v474fmB5njRh+d+66cok=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VQeixw6FyYqyDeXl1bjT+FPGXW2BlxQ8HRGM38YBt+Y7KCAjHI7baVTVlrUcMrkIt4N4JzROe0cC9nxJhfAFpqcLW2aJAAWoM9Wnb9yGU4+V+ulAbTbh+ZiLyGJYOm+/lxvIQPHdQyMby3XGPphNRC+zwmvEmhvNLBtjCb6yR7o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=e1lj2CHk; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="e1lj2CHk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63F581F000C4; Sat, 17 Oct 2026 16:22:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792254126; bh=oIh6myns+k6EV2VdABmVHxexlug6ZAkK23mbp/5iemk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=e1lj2CHk9vGgyGMBS7WSV8fktqCqajAWTNWUUSnkZhg/NM246oCPIP8wHQubzORiV KXIp6THCCQAj+JEGCoSMXBJAgIXI8I0YdY3udVMZg3j9aWOXiGLyfLCQs3PcCaMMXy tsL2YtlhCKqCm+ieyZ2zh5yg45IUObkPeCji9zDE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lorenzo Bianconi , Simon Horman , Paolo Abeni , Sasha Levin Subject: [PATCH 6.12 345/869] net: airoha: Add missing bits in airoha_qdma_cleanup_tx_queue() Date: Sat, 17 Oct 2026 17:53:06 +0200 Message-ID: <20261017160045.943649065@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160036.979869304@linuxfoundation.org> References: <20261017160036.979869304@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lorenzo Bianconi [ Upstream commit 3309965fe44c00fd65af7cef5016e9e782c021a7 ] Similar to airoha_qdma_cleanup_rx_queue(), reset DMA TX descriptors in airoha_qdma_cleanup_tx_queue routine. Moreover, reset TX_DMA_IDX to TX_CPU_IDX to notify the NIC the QDMA TX ring is empty. Fixes: 23020f0493270 ("net: airoha: Introduce ethernet support for EN7581 SoC") Signed-off-by: Lorenzo Bianconi Link: https://patch.msgid.link/20260417-airoha_qdma_cleanup_tx_queue-fix-net-v4-2-e04bcc2c9642@kernel.org Reviewed-by: Simon Horman Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/airoha/airoha_eth.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c index 1488eb17514eb..4589396ab01fc 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.c +++ b/drivers/net/ethernet/airoha/airoha_eth.c @@ -1901,20 +1901,40 @@ static int airoha_qdma_init_tx(struct airoha_qdma *qdma) static void airoha_qdma_cleanup_tx_queue(struct airoha_queue *q) { - struct airoha_eth *eth = q->qdma->eth; + struct airoha_qdma *qdma = q->qdma; + struct airoha_eth *eth = qdma->eth; + int qid = q - &qdma->q_tx[0]; spin_lock_bh(&q->lock); while (q->queued) { struct airoha_queue_entry *e = &q->entry[q->tail]; + struct airoha_qdma_desc *desc = &q->desc[q->tail]; dma_unmap_single(eth->dev, e->dma_addr, e->dma_len, DMA_TO_DEVICE); dev_kfree_skb_any(e->skb); e->skb = NULL; + /* Reset DMA descriptor */ + WRITE_ONCE(desc->ctrl, 0); + WRITE_ONCE(desc->addr, 0); + WRITE_ONCE(desc->data, 0); + WRITE_ONCE(desc->msg0, 0); + WRITE_ONCE(desc->msg1, 0); + WRITE_ONCE(desc->msg2, 0); + q->tail = (q->tail + 1) % q->ndesc; q->queued--; } + + /* Set TX_DMA_IDX to TX_CPU_IDX to notify the hw the QDMA TX ring is + * empty. + */ + airoha_qdma_rmw(qdma, REG_TX_CPU_IDX(qid), TX_RING_CPU_IDX_MASK, + FIELD_PREP(TX_RING_CPU_IDX_MASK, q->head)); + airoha_qdma_rmw(qdma, REG_TX_DMA_IDX(qid), TX_RING_DMA_IDX_MASK, + FIELD_PREP(TX_RING_DMA_IDX_MASK, q->head)); + spin_unlock_bh(&q->lock); } -- 2.53.0