]> git.baikalelectronics.ru Git - kernel.git/commit
iavf: Fix race condition between iavf_shutdown and iavf_remove
authorSlawomir Laba <slawomirx.laba@intel.com>
Thu, 3 Nov 2022 13:00:03 +0000 (14:00 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 18 Nov 2022 22:18:09 +0000 (14:18 -0800)
commite344c5032b527f434bb8b75b63d6f7453f2367d7
treecb43c470c27953cabf28cc8c446aba46c14d8494
parentdb74e18e10752e8959f3d082146f116743686a0a
iavf: Fix race condition between iavf_shutdown and iavf_remove

Fix a deadlock introduced by commit
2d25b6bf5966 ("iavf: Add waiting so the port is initialized in remove")
due to race condition between iavf_shutdown and iavf_remove, where
iavf_remove stucks forever in while loop since iavf_shutdown already
set __IAVF_REMOVE adapter state.

Fix this by checking if the __IAVF_IN_REMOVE_TASK has already been
set and return if so.

Fixes: 2d25b6bf5966 ("iavf: Add waiting so the port is initialized in remove")
Signed-off-by: Slawomir Laba <slawomirx.laba@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Marek Szlosek <marek.szlosek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf_main.c