• Stefan Assmann's avatar
    iavf: fix locking of critical sections · 226d5285
    Stefan Assmann authored
    To avoid races between iavf_init_task(), iavf_reset_task(),
    iavf_watchdog_task(), iavf_adminq_task() as well as the shutdown and
    remove functions more locking is required.
    The current protection by __IAVF_IN_CRITICAL_TASK is needed in
    additional places.
    
    - The reset task performs state transitions, therefore needs locking.
    - The adminq task acts on replies from the PF in
      iavf_virtchnl_completion() which may alter the states.
    - The init task is not only run during probe but also if a VF gets stuck
      to reinitialize it.
    - The shutdown function performs a state transition.
    - The remove function performs a state transition and also free's
      resources.
    
    iavf_lock_timeout() is introduced to avoid waiting infinitely
    and cause a deadlock. Rather unlock and print a warning.
    Signed-off-by: default avatarStefan Assmann <sassmann@kpanic.de>
    Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    226d5285
iavf_main.c 110 KB