Patch "igc: reinit_locked() should be called with rtnl_lock" has been added to the 5.10-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

    igc: reinit_locked() should be called with rtnl_lock

to the 5.10-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:
     igc-reinit_locked-should-be-called-with-rtnl_lock.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 60f1fa62a4de62904ead9fd80dab8f93b5f7e7ce
Author: Sasha Neftin <sasha.neftin@xxxxxxxxx>
Date:   Tue Oct 20 16:34:00 2020 +0300

    igc: reinit_locked() should be called with rtnl_lock
    
    [ Upstream commit 6da262378c99b17b1a1ac2e42aa65acc1bd471c7 ]
    
    This commit applies to the igc_reset_task the same changes that
    were applied to the igb driver in commit 024a8168b749 ("igb:
    reinit_locked() should be called with rtnl_lock")
    and fix possible race in reset subtask.
    
    Fixes: 0507ef8a0372 ("igc: Add transmit and receive fastpath and interrupt handlers")
    Suggested-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Neftin <sasha.neftin@xxxxxxxxx>
    Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@xxxxxxxxxxxxxxx>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index b673ac1199bb..7b822cdcc6c5 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -3846,10 +3846,19 @@ static void igc_reset_task(struct work_struct *work)
 
 	adapter = container_of(work, struct igc_adapter, reset_task);
 
+	rtnl_lock();
+	/* If we're already down or resetting, just bail */
+	if (test_bit(__IGC_DOWN, &adapter->state) ||
+	    test_bit(__IGC_RESETTING, &adapter->state)) {
+		rtnl_unlock();
+		return;
+	}
+
 	igc_rings_dump(adapter);
 	igc_regs_dump(adapter);
 	netdev_err(adapter->netdev, "Reset adapter\n");
 	igc_reinit_locked(adapter);
+	rtnl_unlock();
 }
 
 /**



[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