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: 3d98b8c504 ("net: designware: Invalidate RX buffer cache before freeing the DMA descriptor")
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user