Skip to content

Commit a472eb5

Browse files
SlawomirLabaanguy11
authored andcommitted
iavf: Fix race in init state
When iavf_init_version_check sends VIRTCHNL_OP_GET_VF_RESOURCES message, the driver will wait for the response after requeueing the watchdog task in iavf_init_get_resources call stack. The logic is implemented this way that iavf_init_get_resources has to be called in order to allocate adapter->vf_res. It is polling for the AQ response in iavf_get_vf_config function. Expect a call trace from kernel when adminq_task worker handles this message first. adapter->vf_res will be NULL in iavf_virtchnl_completion. Make the watchdog task not queue the adminq_task if the init process is not finished yet. Fixes: 898ef1c ("iavf: Combine init and watchdog state machines") Signed-off-by: Slawomir Laba <slawomirx.laba@intel.com> Signed-off-by: Phani Burra <phani.r.burra@intel.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com> Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 0579faf commit a472eb5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2532,7 +2532,8 @@ static void iavf_watchdog_task(struct work_struct *work)
25322532
schedule_delayed_work(&adapter->client_task, msecs_to_jiffies(5));
25332533
mutex_unlock(&adapter->crit_lock);
25342534
restart_watchdog:
2535-
queue_work(iavf_wq, &adapter->adminq_task);
2535+
if (adapter->state >= __IAVF_DOWN)
2536+
queue_work(iavf_wq, &adapter->adminq_task);
25362537
if (adapter->aq_required)
25372538
queue_delayed_work(iavf_wq, &adapter->watchdog_task,
25382539
msecs_to_jiffies(20));

0 commit comments

Comments
 (0)