Skip to content

Commit 127532c

Browse files
hkallweitkuba-moo
authored andcommitted
r8169: improve handling task scheduling
If we know that the task is going to be a no-op, don't even schedule it. And remove the check for netif_running() in the worker function, the check for flag RTL_FLAG_TASK_ENABLED is sufficient. Note that we can't remove the check for flag RTL_FLAG_TASK_ENABLED in the worker function because we have no guarantee when it will be executed. Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ee75463 commit 127532c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/realtek/r8169_main.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -2227,6 +2227,9 @@ u16 rtl8168h_2_get_adc_bias_ioffset(struct rtl8169_private *tp)
22272227

22282228
static void rtl_schedule_task(struct rtl8169_private *tp, enum rtl_flag flag)
22292229
{
2230+
if (!test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags))
2231+
return;
2232+
22302233
set_bit(flag, tp->wk.flags);
22312234
schedule_work(&tp->wk.work);
22322235
}
@@ -4467,8 +4470,7 @@ static void rtl_task(struct work_struct *work)
44674470

44684471
rtnl_lock();
44694472

4470-
if (!netif_running(tp->dev) ||
4471-
!test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags))
4473+
if (!test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags))
44724474
goto out_unlock;
44734475

44744476
if (test_and_clear_bit(RTL_FLAG_TASK_TX_TIMEOUT, tp->wk.flags)) {

0 commit comments

Comments
 (0)