summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaruch Siach <[email protected]>2025-06-18 19:04:35 +0300
committerTom Rini <[email protected]>2025-06-22 10:16:29 -0600
commit9d169ac9733b5c3f208921a1d82f4fa8ff708258 (patch)
tree5c34086f02703c4405b21b2715416bc6236d9186
parentc08cecf2d7632d2c7be9a9d260f74bb585d7a3e3 (diff)
net: designware: fix bus address dereference
Device bus address might not be valid for direct access when the bus address and CPU address are not the same. Use dev_bus_to_phys() to translate bus address back to CPU address. Fixes: 3d98b8c504e15 ("net: designware: Invalidate RX buffer cache before freeing the DMA descriptor") Signed-off-by: Baruch Siach <[email protected]> Reviewed-by: Ramon Fried <[email protected]>
-rw-r--r--drivers/net/designware.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 0f93c25e3fe..fce3ef910cb 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -716,7 +716,7 @@ static int _dw_free_pkt(struct dw_eth_dev *priv)
ulong desc_start = (ulong)desc_p;
ulong desc_end = desc_start +
roundup(sizeof(*desc_p), ARCH_DMA_MINALIGN);
- ulong data_start = desc_p->dmamac_addr;
+ ulong data_start = dev_bus_to_phys(priv->dev, desc_p->dmamac_addr);
ulong data_end = data_start + roundup(CFG_ETH_BUFSIZE, ARCH_DMA_MINALIGN);
/* Invalidate the descriptor buffer data */