Patch "iavf: check for removal state before IAVF_FLAG_PF_COMMS_FAILED" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    iavf: check for removal state before IAVF_FLAG_PF_COMMS_FAILED

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iavf-check-for-removal-state-before-iavf_flag_pf_com.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 677156dbd8971c0ae5da58b1115858fd0449491e
Author: Jacob Keller <jacob.e.keller@xxxxxxxxx>
Date:   Mon Jul 10 13:41:28 2023 -0700

    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@xxxxxxxxx>
    Tested-by: Rafal Romanowski <rafal.romanowski@xxxxxxxxx>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 6c25d240e70bc..e48810e0627d2 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -3286,9 +3286,6 @@ static void iavf_adminq_task(struct work_struct *work)
 	u32 val, oldval;
 	u16 pending;
 
-	if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED)
-		goto out;
-
 	if (!mutex_trylock(&adapter->crit_lock)) {
 		if (adapter->state == __IAVF_REMOVE)
 			return;
@@ -3297,6 +3294,9 @@ static void iavf_adminq_task(struct work_struct *work)
 		goto out;
 	}
 
+	if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED)
+		goto unlock;
+
 	event.buf_len = IAVF_MAX_AQ_BUF_SIZE;
 	event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);
 	if (!event.msg_buf)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux