[Linux-stm32] [PATCH net-next v5 04/19] xsk: freeze deferred pool teardown during system sleep

Björn Töpel bjorn at kernel.org
Mon Sep 28 12:16:38 UTC 2026


James Hilliard <james.hilliard1 at gmail.com> writes:

> Pool destruction calls the driver under RTNL from system_wq. That queue
> is not frozen during system sleep, so ndo_bpf() can run after the device
> suspend callback has gated its clocks or after the noirq phase.
>
> Use the freezable workqueue for deferred pool release. Work already
> running completes before device suspend, and newly queued destruction
> waits until device resume. The pool, UMEM and netdev references remain
> owned by the work until then. This does not replace driver error
> handling after a failed resume.
>
> Fixes: 1c1efc2af158 ("xsk: Create and free buffer pool independently from umem")
> Signed-off-by: James Hilliard <james.hilliard1 at gmail.com>

This fix should go as a separate net fix for AF_XDP (potentially paired
with a minimal stmac-fix).

> diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c
> index 9d2d94f1fb75..c58f56f24a9c 100644
> --- a/net/xdp/xsk_buff_pool.c
> +++ b/net/xdp/xsk_buff_pool.c
> @@ -337,7 +337,10 @@ bool xp_put_pool(struct xsk_buff_pool *pool)
>  
>  	if (refcount_dec_and_test(&pool->users)) {
>  		INIT_WORK(&pool->work, xp_release_deferred);
> -		schedule_work(&pool->work);
> +		/* Teardown calls ndo_bpf(), which may need powered hardware.
> +		 * RTNL alone does not exclude the device's system PM callbacks.
> +		 */

Remove the comment, please. The commit message is enough in this case.


Björn



More information about the Linux-stm32 mailing list