[next,S94,12/13] i40e: Lock the rtnl lock when restoring interrupt scheme for recovery mode

Message ID 20180802004036.89363-12-alice.michael@intel.com
State Superseded
Delegated to: Jeff Kirsher
Headers show
Series
  • Untitled series #58958
Related show

Commit Message

Alice Michael Aug. 2, 2018, 12:40 a.m.
From: Patryk Małek <patryk.malek@intel.com>

When going out of recovery mode we have to check if rtnl lock is locked,
if it isn't then we have to lock it since i40e_restore_interrupt_scheme
will reinitialize queues and this needs to be done under the lock.

This patch fixes it by adding a rtnl_lock() call when the lock is not
held.

Signed-off-by: Patryk Małek <patryk.malek@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index ff04dc4..e46f8ab 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -9393,6 +9393,8 @@  static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
 			if (i40e_setup_misc_vector_for_recovery_mode(pf))
 				goto end_unlock;
 		} else {
+			if (!lock_acquired)
+				rtnl_lock();
 			/* we're going out of recovery mode so we'll free
 			 * the IRQ allocated specifically for recovery mode
 			 * and restore the interrupt scheme