]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iavf: check for removal state before IAVF_FLAG_PF_COMMS_FAILED
authorJacob Keller <jacob.e.keller@intel.com>
Mon, 10 Jul 2023 20:41:28 +0000 (13:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:23:58 +0000 (10:23 +0200)
commitc76d3742b6882dc49b5bcf53905f711c4f82e6dd
tree846061bc3c904658860680c886ca9f25cb09b2e6
parent469879eda36d27969a0ebeec860722650214bfbc
iavf: check for removal state before IAVF_FLAG_PF_COMMS_FAILED

[ Upstream commit 91896c8acce23d33ed078cffd46a9534b1f82be5 ]

In iavf_adminq_task(), if the function can't acquire the
adapter->crit_lock, it checks if the driver is removing. If so, it simply
exits without re-enabling the interrupt. This is done to ensure that the
task stops processing as soon as possible once the driver is being removed.

However, if the IAVF_FLAG_PF_COMMS_FAILED is set, the function checks this
before attempting to acquire the lock. In this case, the function exits
early and re-enables the interrupt. This will happen even if the driver is
already removing.

Avoid this, by moving the check to after the adapter->crit_lock is
acquired. This way, if the driver is removing, we will not re-enable the
interrupt.

Fixes: fc2e6b3b132a ("iavf: Rework mutexes for better synchronisation")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/iavf/iavf_main.c