Skip to content

Commit 91896c8

Browse files
jacob-kelleranguy11
authored andcommitted
iavf: check for removal state before IAVF_FLAG_PF_COMMS_FAILED
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: fc2e6b3 ("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>
1 parent a2f054c commit 91896c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3250,9 +3250,6 @@ static void iavf_adminq_task(struct work_struct *work)
32503250
u32 val, oldval;
32513251
u16 pending;
32523252

3253-
if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED)
3254-
goto out;
3255-
32563253
if (!mutex_trylock(&adapter->crit_lock)) {
32573254
if (adapter->state == __IAVF_REMOVE)
32583255
return;
@@ -3261,6 +3258,9 @@ static void iavf_adminq_task(struct work_struct *work)
32613258
goto out;
32623259
}
32633260

3261+
if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED)
3262+
goto unlock;
3263+
32643264
event.buf_len = IAVF_MAX_AQ_BUF_SIZE;
32653265
event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);
32663266
if (!event.msg_buf)

0 commit comments

Comments
 (0)