Re: [PATCH v2] net: stmmac: fix fatal bus error on resume by reinitializing RX buffers
From: Jakub Raczynski
Date: Thu May 28 2026 - 11:05:34 EST
On Tue, May 26, 2026 at 10:26:17AM +0800, Ding Hui wrote:
> From: Ding Hui <dinghui@xxxxxxxxxxx>
> + } else {
> + /* Theoretically unreachable: napi_disable() in
> + * stmmac_suspend() ensures all initialized slots
> + * have a valid page before we get here.
> + * Defensive check only.
> + */
> + if (!buf->page)
> + continue;
> +
> + stmmac_set_desc_addr(priv, p, buf->addr);
> + stmmac_set_desc_sec_addr(priv, p, buf->sec_addr,
> + priv->sph_active &&
> + buf->sec_page);
It this generally sufficient? Or, in fact, isn't that overkill?
stmmac_rx_refill() generally does a bit more preparation of descriptors.
The issue seems to be that during suspend there is mismatch,
caused by writeback format, between rx_dirty and rx_cur pointers and
there is bad handling of this case, since there is no verification
of leftover stuff and there will be leftover bad address crashing platform.
So stmmac needs to refill/reinit descriptors that were consumed but not
refilled. So isn't going through whole dma_rx_size overkill?
Wouldn't it be better to iterate over buffer from cur_rx as long as descriptors
are 0 and only apply refill to those corrupted?
Could you paste panic that occurs during this issue?
You mention "fatal bus error" which I would assume is system panic?
Thanks
BR
Jakub Raczynski