On Mon, Mar 23, 2020 at 3:45 AM Marek Vasut <ma...@denx.de> wrote: > > The DMA may attempt to write a DMA descriptor in the ring while it is > being updated. By writing the DMA descriptor buffer address to 0, it > is assured the DMA will not use such a buffer and the buffer can be > updated without any interference. > > Signed-off-by: Marek Vasut <ma...@denx.de> > Cc: Joe Hershberger <joe.hershber...@ni.com> > Cc: Patrice Chotard <patrice.chot...@st.com> > Cc: Patrick Delaunay <patrick.delau...@st.com> > Cc: Ramon Fried <rfried....@gmail.com> > Cc: Stephen Warren <swar...@nvidia.com> > --- > drivers/net/dwc_eth_qos.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c > index 7dadb10fe7..c86b9d59a5 100644 > --- a/drivers/net/dwc_eth_qos.c > +++ b/drivers/net/dwc_eth_qos.c > @@ -1431,8 +1431,10 @@ static int eqos_free_pkt(struct udevice *dev, uchar > *packet, int length) > > rx_desc = &(eqos->rx_descs[eqos->rx_desc_idx]); > > + rx_desc->des0 = 0; > + mb(); Better use wmb() for better understanding your goal here ? > + eqos->config->ops->eqos_flush_desc(rx_desc); > eqos->config->ops->eqos_inval_buffer(packet, length); > - > rx_desc->des0 = (u32)(ulong)packet; > rx_desc->des1 = 0; > rx_desc->des2 = 0; > -- > 2.25.1 >
- [PATCH 5/6] net: dwc_eth_qos: Invalidate RX packet DMA bu... Marek Vasut
- Re: [PATCH 5/6] net: dwc_eth_qos: Invalidate RX pack... Ramon Fried
- RE: [PATCH 5/6] net: dwc_eth_qos: Invalidate RX pack... Patrick DELAUNAY
- [PATCH 3/6] net: dwc_eth_qos: Flush the RX descriptors on... Marek Vasut
- Re: [PATCH 3/6] net: dwc_eth_qos: Flush the RX descr... Ramon Fried
- RE: [PATCH 3/6] net: dwc_eth_qos: Flush the RX descr... Patrick DELAUNAY
- [PATCH 4/6] net: dwc_eth_qos: Invalidate RX descriptor be... Marek Vasut
- Re: [PATCH 4/6] net: dwc_eth_qos: Invalidate RX desc... Ramon Fried
- RE: [PATCH 4/6] net: dwc_eth_qos: Invalidate RX desc... Patrick DELAUNAY
- [PATCH 6/6] net: dwc_eth_qos: Prevent DMA from writing up... Marek Vasut
- Re: [PATCH 6/6] net: dwc_eth_qos: Prevent DMA from w... Ramon Fried
- Re: [PATCH 6/6] net: dwc_eth_qos: Prevent DMA fr... Marek Vasut
- Re: [PATCH 6/6] net: dwc_eth_qos: Prevent DM... Ramon Fried
- Re: [PATCH 6/6] net: dwc_eth_qos: Preven... Marek Vasut
- Re: [PATCH 6/6] net: dwc_eth_qos: P... Ramon Fried
- Re: [PATCH 6/6] net: dwc_eth_qo... Marek Vasut
- Re: [PATCH 6/6] net: dwc_eth_qos: Prevent DMA from w... Ramon Fried
- RE: [PATCH 6/6] net: dwc_eth_qos: Prevent DMA from w... Patrick DELAUNAY
- Re: [PATCH 1/6] net: dwc_eth_qos: Fully rewrite RX descri... Ramon Fried
- Re: [PATCH 1/6] net: dwc_eth_qos: Fully rewrite RX descri... Stephen Warren
- RE: [PATCH 1/6] net: dwc_eth_qos: Fully rewrite RX descri... Patrick DELAUNAY