]> git.baikalelectronics.ru Git - kernel.git/commit
iavf: Add waiting so the port is initialized in remove
authorSlawomir Laba <slawomirx.laba@intel.com>
Wed, 23 Feb 2022 12:36:56 +0000 (13:36 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 25 Feb 2022 19:37:07 +0000 (11:37 -0800)
commit2d25b6bf596693a1bbfb25bef499f4ae9420d26f
treebfd48905b6ec5f8d2a767abd6f89fb8956a0532f
parent9fa96ef72d515d86e3bc12cec7dba89c6c3e77fb
iavf: Add waiting so the port is initialized in remove

There exist races when port is being configured and remove is
triggered.

unregister_netdev is not and can't be called under crit_lock
mutex since it is calling ndo_stop -> iavf_close which requires
this lock. Depending on init state the netdev could be still
unregistered so unregister_netdev never cleans up, when shortly
after that the device could become registered.

Make iavf_remove wait until port finishes initialization.
All critical state changes are atomic (under crit_lock).
Crashes that come from iavf_reset_interrupt_capability and
iavf_free_traffic_irqs should now be solved in a graceful
manner.

Fixes: e21941437499b ("iavf: Fix kernel BUG in free_msi_irqs")
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>
drivers/net/ethernet/intel/iavf/iavf_main.c