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

Paul Menzel
2025-02-18T20:13:23Z

Dear Frederic, dear Francois,

Thank you for the patch and review.

Am 12.02.25 um 21:58 schrieb Frederic Weisbecker:
> Le Wed, Feb 12, 2025 at 09:49:29PM +0100, Francois Romieu a écrit :
>> 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.
>
> It's a workqueue function and softirqs don't seem to be disabled.
> Looks like a goot catch!

Tested-by: Paul Menzel <pmenzel@molgen.mpg.de>

Are you going to send a v2, so it might get into Linux 6.14, or is it
too late anyway?

Kind regards,

Paul