Netdev List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Yun Zhou <yun.zhou@windriver.com>,
	marcin.s.wojtas@gmail.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6] net: mvneta_bm: add suspend/resume support to prevent crash after resume
Date: Thu, 2 Jul 2026 15:00:28 +0200	[thread overview]
Message-ID: <4d7f991b-60c8-4b4f-920c-46bc7f82d049@redhat.com> (raw)
In-Reply-To: <20260630060311.4072140-1-yun.zhou@windriver.com>

On 6/30/26 8:03 AM, Yun Zhou wrote:
> The mvneta driver uses the hardware Buffer Manager (BM) for RX buffer
> allocation. During suspend, mvneta disables its clock, causing BM to
> lose all buffer address state. On resume, mvneta_bm_port_init() re-
> attaches the BM pool to the NIC, but BM hardware returns stale/garbage
> buffer addresses. When NAPI poll processes these buffers, DMA cache
> sync hits an invalid virtual address causing a kernel panic:
> 
>  Unable to handle kernel paging request at virtual address b0000080
>  PC is at v7_dma_inv_range
>  Call trace:
>   v7_dma_inv_range from arch_sync_dma_for_cpu+0x94/0x158
>   arch_sync_dma_for_cpu from __dma_sync_single_for_cpu+0xc4/0x15c
>   __dma_sync_single_for_cpu from mvneta_rx_swbm+0x6c8/0xf48
>   mvneta_rx_swbm from mvneta_poll+0x6fc/0x70c
>   mvneta_poll from __napi_poll.constprop.0+0x2c/0x1e0
>   __napi_poll.constprop.0 from net_rx_action+0x160/0x2c4
>   net_rx_action from handle_softirqs+0xd8/0x2b8
>   handle_softirqs from run_ksoftirqd+0x30/0x94
>   run_ksoftirqd from smpboot_thread_fn+0x100/0x204
>   smpboot_thread_fn from kthread+0xf4/0x110
>   kthread from ret_from_fork+0x14/0x28
> 
> Fix by adding suspend/resume callbacks to the BM driver:
> 
> - suspend: drain all buffers (with DMA unmapping), free the BPPE
>   regions, and reset pool state to FREE before stopping BM and gating
>   the clock.
> 
> - resume: enable the clock, reinitialize BM defaults, and restore pool
>   read/write pointers and size registers. Pool allocation and buffer
>   refill are handled by mvneta_resume() through the normal
>   mvneta_bm_port_init() path, which sees pools as FREE and performs
>   full initialization identical to probe.
> 
> Add a device_link (DL_FLAG_AUTOREMOVE_CONSUMER) in mvneta_probe to
> guarantee BM resumes before mvneta and suspends after mvneta. If the
> link cannot be created, fall back to SW buffer management to avoid a
> potential crash on resume due to unordered PM transitions.
> 
> Signed-off-by: Yun Zhou <yun.zhou@windriver.com>

Sashiko gemini has found a bunch of pre-existing issues; it would be
nice if you could follow-up on them:

https://sashiko.dev/#/patchset/20260630060311.4072140-1-yun.zhou%40windriver.com

/P


  reply	other threads:[~2026-07-02 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30  6:03 [PATCH v6] net: mvneta_bm: add suspend/resume support to prevent crash after resume Yun Zhou
2026-07-02 13:00 ` Paolo Abeni [this message]
2026-07-02 13:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d7f991b-60c8-4b4f-920c-46bc7f82d049@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.s.wojtas@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=yun.zhou@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox