mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
iavf: Fix race in init state
[ Upstream commita472eb5cba] 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:898ef1cb1c("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ddc5db0bcf
commit
598bc89559
@@ -2125,7 +2125,8 @@ static void iavf_watchdog_task(struct work_struct *work)
|
||||
schedule_delayed_work(&adapter->client_task, msecs_to_jiffies(5));
|
||||
mutex_unlock(&adapter->crit_lock);
|
||||
restart_watchdog:
|
||||
queue_work(iavf_wq, &adapter->adminq_task);
|
||||
if (adapter->state >= __IAVF_DOWN)
|
||||
queue_work(iavf_wq, &adapter->adminq_task);
|
||||
if (adapter->aq_required)
|
||||
queue_delayed_work(iavf_wq, &adapter->watchdog_task,
|
||||
msecs_to_jiffies(20));
|
||||
|
||||
Reference in New Issue
Block a user