]> git.baikalelectronics.ru Git - kernel.git/commit
e1000e: Use rtnl_lock to prevent race conditions between net and pci/pm
authorAlexander Duyck <alexander.h.duyck@linux.intel.com>
Fri, 11 Oct 2019 15:34:52 +0000 (08:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Feb 2020 16:22:14 +0000 (17:22 +0100)
commit5baf5a001f61a3c512df8f2326887d118e994bd4
treed4061b2c37d29bc5d7e17d5eaa8382b4916ae4e9
parent27bdcb01ce3e715cc827e4970e662e06d9fea0b4
e1000e: Use rtnl_lock to prevent race conditions between net and pci/pm

commit e240ae1ba97d8b0638236762889eff8b0298c367 upstream.

This patch is meant to address possible race conditions that can exist
between network configuration and power management. A similar issue was
fixed for igb in commit 06f323cd1e10 ("igb: close/suspend race in
netif_device_detach").

In addition it consolidates the code so that the PCI error handling code
will essentially perform the power management freeze on the device prior to
attempting a reset, and will thaw the device afterwards if that is what it
is planning to do. Otherwise when we call close on the interface it should
see it is detached and not attempt to call the logic to down the interface
and free the IRQs again.

From what I can tell the check that was adding the check for __E1000_DOWN
in e1000e_close was added when runtime power management was added. However
it should not be relevant for us as we perform a call to
pm_runtime_get_sync before we call e1000_down/free_irq so it should always
be back up before we call into this anyway.

Reported-by: Morumuri Srivalli <smorumu1@in.ibm.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Tested-by: David Dai <zdai@linux.vnet.ibm.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/e1000e/netdev.c