From: Przemek Kitszel Date: Fri, 4 Apr 2025 10:23:18 +0000 (+0200) Subject: iavf: simplify watchdog_task in terms of adminq task scheduling X-Git-Tag: v6.16-rc1~36^2~7^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecb4cd0461accc446d20a7a167f39ed2fd5e9b0e;p=thirdparty%2Flinux.git iavf: simplify watchdog_task in terms of adminq task scheduling Simplify the decision whether to schedule adminq task. The condition is the same, but it is executed in more scenarios. Note that movement of watchdog_done label makes this commit a bit surprising. (Hence not squashing it to anything bigger). Reviewed-by: Jacob Keller Signed-off-by: Przemek Kitszel Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen --- diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index 2c6e033c73419..5efe44724d112 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -2934,6 +2934,7 @@ static void iavf_watchdog_task(struct work_struct *work) return; } + msec_delay = 20; goto restart_watchdog; } @@ -3053,10 +3054,13 @@ static void iavf_watchdog_task(struct work_struct *work) adapter->current_op = VIRTCHNL_OP_UNKNOWN; dev_err(&adapter->pdev->dev, "Hardware reset detected\n"); iavf_schedule_reset(adapter, IAVF_FLAG_RESET_PENDING); - msec_delay = 2000; - goto watchdog_done; } + if (adapter->aq_required) + msec_delay = 20; + else + msec_delay = 2000; +watchdog_done: mutex_unlock(&adapter->crit_lock); restart_watchdog: netdev_unlock(netdev); @@ -3064,15 +3068,6 @@ restart_watchdog: /* note that we schedule a different task */ if (adapter->state >= __IAVF_DOWN) queue_work(adapter->wq, &adapter->adminq_task); - if (adapter->aq_required) - msec_delay = 20; - else - msec_delay = 2000; - goto skip_unlock; -watchdog_done: - mutex_unlock(&adapter->crit_lock); - netdev_unlock(netdev); -skip_unlock: if (msec_delay != IAVF_NO_RESCHED) queue_delayed_work(adapter->wq, &adapter->watchdog_task,