From: Marek Vasut Date: Mon, 23 Mar 2020 01:09:21 +0000 (+0100) Subject: net: dwc_eth_qos: Invalidate RX descriptor before reading X-Git-Tag: v2020.07-rc2~18^2~28 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=738ee270fe17ea9e48fee8823eb356ed03656e7c;p=oweals%2Fu-boot.git net: dwc_eth_qos: Invalidate RX descriptor before reading The current code polls the RX desciptor ring for new packets by reading the RX descriptor status. This works by accident, as the RX descriptors are often in non-cacheable memory. However, the driver does support use of RX descriptors in cacheable memory. This patch adds a missing RX descriptor invalidation, which assures the CPU will read a fresh copy of the RX descriptor instead of a cached one. Reviewed-by: Patrick Delaunay Signed-off-by: Marek Vasut Cc: Joe Hershberger Cc: Patrice Chotard Cc: Patrick Delaunay Cc: Ramon Fried Cc: Stephen Warren --- diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index e33f3045fe..2b37cc3cde 100644 --- a/drivers/net/dwc_eth_qos.c +++ b/drivers/net/dwc_eth_qos.c @@ -1443,6 +1443,7 @@ static int eqos_recv(struct udevice *dev, int flags, uchar **packetp) debug("%s(dev=%p, flags=%x):\n", __func__, dev, flags); rx_desc = &(eqos->rx_descs[eqos->rx_desc_idx]); + eqos->config->ops->eqos_inval_desc(rx_desc); if (rx_desc->des3 & EQOS_DESC3_OWN) { debug("%s: RX packet not available\n", __func__); return -EAGAIN;