Re: [PATCH 2/2] r8152: Call napi_schedule() from proper context

Francois Romieu
2025-02-12T20:51:26Z

Frederic Weisbecker <frederic@kernel.org> :
[...]
> r8152 may call napi_schedule() on device resume time from a bare task
> context without disabling softirqs as the following trace shows:
[...]
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 468c73974046..1325460ae457 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -8537,8 +8537,11 @@ static int rtl8152_runtime_resume(struct r8152 *tp)
> clear_bit(SELECTIVE_SUSPEND, &tp->flags);
> smp_mb__after_atomic();
>
> - if (!list_empty(&tp->rx_done))
> + if (!list_empty(&tp->rx_done)) {
> + local_bh_disable();
> napi_schedule(&tp->napi);
> + local_bh_enable();
> + }

AFAIU drivers/net/usb/r8152.c::rtl_work_func_t exhibits the same
problem.

--
Ueimor