Skip to content

Commit

Permalink
igc: reinit_locked() should be called with rtnl_lock
Browse files Browse the repository at this point in the history
This commit applies to the igc_reset_task the same changes that
were applied to the igb driver in commit 024a816 ("igb:
reinit_locked() should be called with rtnl_lock")
and fix possible race in reset subtask.

Fixes: 0507ef8 ("igc: Add transmit and receive fastpath and interrupt handlers")
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
Sasha Neftin authored and Tony Nguyen committed Mar 11, 2021
1 parent 47142ed commit 6da2623
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/net/ethernet/intel/igc/igc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3831,10 +3831,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();
}

/**
Expand Down

0 comments on commit 6da2623

Please sign in to comment.