[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YK+sJ20/z5i6rYVK@orome.fritz.box>
Date: Thu, 27 May 2021 16:26:47 +0200
From: Thierry Reding <treding@...dia.com>
To: Joakim Zhang <qiangqing.zhang@....com>
CC: <f.fainelli@...il.com>, <jonathanh@...dia.com>,
<peppe.cavallaro@...com>, <alexandre.torgue@...s.st.com>,
<joabreu@...opsys.com>, <davem@...emloft.net>, <kuba@...nel.org>,
<mcoquelin.stm32@...il.com>, <andrew@...n.ch>,
<netdev@...r.kernel.org>, <linux-imx@....com>
Subject: Re: [PATCH V1 net-next] net: stmmac: should not modify RX descriptor
when STMMAC resume
On Thu, May 27, 2021 at 04:49:11PM +0800, Joakim Zhang wrote:
> When system resume back, STMMAC will clear RX descriptors:
> stmmac_resume()
> ->stmmac_clear_descriptors()
> ->stmmac_clear_rx_descriptors()
> ->stmmac_init_rx_desc()
> ->dwmac4_set_rx_owner()
> //p->des3 |= cpu_to_le32(RDES3_OWN | RDES3_BUFFER1_VALID_ADDR);
> It only asserts OWN and BUF1V bits in desc3 field, doesn't clear desc0/1/2 fields.
>
> Let's take a case into account, when system suspend, it is possible that
> there are packets have not received yet, so the RX descriptors are wrote
> back by DMA, e.g.
> 008 [0x00000000c4310080]: 0x0 0x40 0x0 0x34010040
This is something that completely baffles me. Why is DMA still writing
back RX descriptors on system suspend? stmmac_suspend() should take care
of completely quiescing the device so that DMA is no longer active. It
sounds like for some reason that doesn't happen when you run into this
problematic situation.
I see that some platform adaptations override the DMA ->stop_rx()
callback (see dwmac-sun8i.c and dwxgmac2_dma.c), so perhaps some similar
override is required on your platform to actually stop DMA?
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists