]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ixgbe: handle close/suspend race with netif_device_detach/present
authorEmil Tantilov <emil.s.tantilov@intel.com>
Fri, 11 Nov 2016 18:07:47 +0000 (10:07 -0800)
committerJack Vogel <jack.vogel@oracle.com>
Fri, 16 Jun 2017 06:01:22 +0000 (23:01 -0700)
commit1355a630bec461627860bbe9558ebc5498f2cdb0
tree294ba37f855632e09f8254e2943fb713a3f91a7b
parent6d5700cd0976a526b7b779d1fff5634bc6ca6a22
ixgbe: handle close/suspend race with netif_device_detach/present

When an interface is part of a namespace it is possible that
ixgbe_close() may be called while __ixgbe_shutdown() is running
which ends up in a double free WARN and/or a BUG in free_msi_irqs().

To handle this situation we extend the rtnl_lock() to protect the
call to netif_device_detach() and ixgbe_clear_interrupt_scheme()
in __ixgbe_shutdown() and check for netif_device_present()
to avoid clearing the interrupts second time in ixgbe_close();

Also extend the rtnl lock in ixgbe_resume() to netif_device_attach().

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26242766
(cherry picked from commit f7f37e7ff2b9b7eff7fbd035569cab35896869a3)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Ethan Zhao <ethan.zhao@oracle.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c