Skip to contentSkip to conversation

net: stmmac: Set OWN bit last in dwmac4_set_rx_owner()

PATCH In review [email protected] 2 participants 2 messages Aug 9, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: Set OWN bit last in dwmac4_set_rx_owner()

From: Tan En De <[email protected]>

Ensure that all other bits in the RDES3 descriptor are configured before transferring ownership of the descriptor to DMA via the OWN bit.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c +4 -1
index 1c5802e0d7f4..95aea6ad485b 100644
@@ -186,10 +186,13 @@ static void dwmac4_set_tx_owner(struct dma_desc *p)
 
 static void dwmac4_set_rx_owner(struct dma_desc *p, int disable_rx_ic)
 {
-	p->des3 |= cpu_to_le32(RDES3_OWN | RDES3_BUFFER1_VALID_ADDR);
+	p->des3 |= cpu_to_le32(RDES3_BUFFER1_VALID_ADDR);
 
 	if (!disable_rx_ic)
 		p->des3 |= cpu_to_le32(RDES3_INT_ON_COMPLETION_EN);
+
+	dma_wmb();
+	p->des3 |= cpu_to_le32(RDES3_OWN);
 }
 
 static int dwmac4_get_tx_ls(struct dma_desc *p)
Signature · 1 line
2.34.1
#1 lore raw
Quoted 4 lines · On Fri, Aug 09, 2024 at 11:31:38PM +0800, [email protected] wrote:

From: Tan En De <[email protected]>

Ensure that all other bits in the RDES3 descriptor are configured before transferring ownership of the descriptor to DMA via the OWN bit.

Please leave at least 24 hours between versions. If you notice something wrong with your own patch, please reply to it and point out the problem. And then wait the needed 24 hours before posting a new version.

Also, this should be v2, and you should include under the --- how this version is different to v1.

Andrew

---
pw-bot: cr