* [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06
@ 2017-01-06 10:48 Jeff Kirsher
2017-01-06 10:48 ` [net-next 01/10] igb: Realign bad indentation Jeff Kirsher
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-01-06 10:48 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene,
guru.anbalagane
This series contains updates/fixes to igb and e1000e.
Joe fixes indentation and improper line wrapping in igb.
David Singleton fixes an issue in e1000e where in systemd, where things
are done in parallel and can create a condition where e1000_shutdown is
called after e1000_close, hitting BUG_ON assert in free_msi_irqs.
Cao Jin fixes a code comment on the wakeup status register. Also fixes
a possible NULL pointer dereference by using igb_adapter->io_addr
instead of e1000_hw->hw_addr in igb_configure_tx_ring().
Chris Arges works around a firmware issue, which can cause probe of i210
NIC to fail, so zero the page select register during igb_get_phy_id() to
workaround the issue. Aaron Sierra adds also a check for this issue
during the initialization of PHY parameters to ensure that this same
issue happens after probe.
Todd fixes a possible race condition in close/suspend by extending
the rtnl_lock() to protect the call to netif_device_detach() and
igb_clear_interrupt_scheme(). Also adds i211 to a known i210/i211
workaround.
Hannu Lounento fixes inverted logic on a debug statement.
The following are changes since commit c1878f7a89efbbe1ac0082d09b2928782a6ceba1:
tools: psock_tpacket: block Rx until socket filter has been added and socket has been bound to loopback.
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 1GbE
Aaron Sierra (1):
igb: reset the PHY before reading the PHY ID
Cao jin (2):
igb: correct register comments
igb: use igb_adapter->io_addr instead of e1000_hw->hw_addr
Chris J Arges (1):
igb: Workaround for igb i210 firmware issue
Guilherme G Piccoli (1):
igb: re-assign hw address pointer on reset after PCI error
Hannu Lounento (1):
igb: Fix hw_dbg logging in igb_update_flash_i210
Joe Perches (1):
igb: Realign bad indentation
Todd Fujinaka (2):
igb: close/suspend race in netif_device_detach
igb: add i211 to i210 PHY workaround
khalidm (1):
e1000e: driver trying to free already-free irq
drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
drivers/net/ethernet/intel/igb/e1000_82575.c | 11 ++++++++++
drivers/net/ethernet/intel/igb/e1000_i210.c | 4 ++--
drivers/net/ethernet/intel/igb/e1000_mac.c | 15 ++++++--------
drivers/net/ethernet/intel/igb/e1000_phy.c | 4 ++++
drivers/net/ethernet/intel/igb/e1000_regs.h | 2 +-
drivers/net/ethernet/intel/igb/igb_main.c | 30 ++++++++++++++++++----------
7 files changed, 44 insertions(+), 24 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [net-next 01/10] igb: Realign bad indentation
2017-01-06 10:48 [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 Jeff Kirsher
@ 2017-01-06 10:48 ` Jeff Kirsher
2017-01-06 10:48 ` [net-next 02/10] e1000e: driver trying to free already-free irq Jeff Kirsher
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-01-06 10:48 UTC (permalink / raw)
To: davem
Cc: Joe Perches, netdev, nhorman, sassmann, jogreene, guru.anbalagane,
Jeff Kirsher
From: Joe Perches <joe@perches.com>
Statements should start on tabstops.
Use a single statement and test instead of multiple tests.
Signed-off-by: Joe Perches <joe@perches.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_mac.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/e1000_mac.c b/drivers/net/ethernet/intel/igb/e1000_mac.c
index 5010e22..5eff826 100644
--- a/drivers/net/ethernet/intel/igb/e1000_mac.c
+++ b/drivers/net/ethernet/intel/igb/e1000_mac.c
@@ -792,15 +792,13 @@ static s32 igb_set_default_fc(struct e1000_hw *hw)
* control setting, then the variable hw->fc will
* be initialized based on a value in the EEPROM.
*/
- if (hw->mac.type == e1000_i350) {
+ if (hw->mac.type == e1000_i350)
lan_offset = NVM_82580_LAN_FUNC_OFFSET(hw->bus.func);
- ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG
- + lan_offset, 1, &nvm_data);
- } else {
- ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG,
- 1, &nvm_data);
- }
+ else
+ lan_offset = 0;
+ ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG + lan_offset,
+ 1, &nvm_data);
if (ret_val) {
hw_dbg("NVM Read Error\n");
goto out;
@@ -808,8 +806,7 @@ static s32 igb_set_default_fc(struct e1000_hw *hw)
if ((nvm_data & NVM_WORD0F_PAUSE_MASK) == 0)
hw->fc.requested_mode = e1000_fc_none;
- else if ((nvm_data & NVM_WORD0F_PAUSE_MASK) ==
- NVM_WORD0F_ASM_DIR)
+ else if ((nvm_data & NVM_WORD0F_PAUSE_MASK) == NVM_WORD0F_ASM_DIR)
hw->fc.requested_mode = e1000_fc_tx_pause;
else
hw->fc.requested_mode = e1000_fc_full;
--
2.9.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [net-next 02/10] e1000e: driver trying to free already-free irq
2017-01-06 10:48 [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 Jeff Kirsher
2017-01-06 10:48 ` [net-next 01/10] igb: Realign bad indentation Jeff Kirsher
@ 2017-01-06 10:48 ` Jeff Kirsher
2017-01-06 10:48 ` [net-next 03/10] igb: correct register comments Jeff Kirsher
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-01-06 10:48 UTC (permalink / raw)
To: davem
Cc: khalidm, netdev, nhorman, sassmann, jogreene, guru.anbalagane,
xe-kernel, David Singleton, Jeff Kirsher
From: khalidm <khalidm@cisco.com>
During systemd reboot sequence network driver interface is shutdown
by e1000_close. The PCI driver interface is shut by e1000_shutdown.
The e1000_shutdown checks for netif_running status, if still up it
brings down driver. But it disables msi outside of this if statement,
regardless of netif status. All this is OK when e1000_close happens
after shutdown. However, by default, everything in systemd is done
in parallel. This creates a conditions where e1000_shutdown is called
after e1000_close, therefore hitting BUG_ON assert in free_msi_irqs.
CC: xe-kernel@external.cisco.com
Signed-off-by: khalidm <khalidm@cisco.com>
Signed-off-by: David Singleton <davsingl@cisco.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index eccf1da..af39608 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -6276,8 +6276,8 @@ static int e1000e_pm_freeze(struct device *dev)
/* Quiesce the device without resetting the hardware */
e1000e_down(adapter, false);
e1000_free_irq(adapter);
+ e1000e_reset_interrupt_capability(adapter);
}
- e1000e_reset_interrupt_capability(adapter);
/* Allow time for pending master requests to run */
e1000e_disable_pcie_master(&adapter->hw);
--
2.9.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [net-next 03/10] igb: correct register comments
2017-01-06 10:48 [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 Jeff Kirsher
2017-01-06 10:48 ` [net-next 01/10] igb: Realign bad indentation Jeff Kirsher
2017-01-06 10:48 ` [net-next 02/10] e1000e: driver trying to free already-free irq Jeff Kirsher
@ 2017-01-06 10:48 ` Jeff Kirsher
2017-01-06 10:48 ` [net-next 04/10] igb: Workaround for igb i210 firmware issue Jeff Kirsher
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-01-06 10:48 UTC (permalink / raw)
To: davem
Cc: Cao jin, netdev, nhorman, sassmann, jogreene, guru.anbalagane,
Jeff Kirsher
From: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_regs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igb/e1000_regs.h b/drivers/net/ethernet/intel/igb/e1000_regs.h
index d84afdd..58adbf2 100644
--- a/drivers/net/ethernet/intel/igb/e1000_regs.h
+++ b/drivers/net/ethernet/intel/igb/e1000_regs.h
@@ -320,7 +320,7 @@
#define E1000_VT_CTL 0x0581C /* VMDq Control - RW */
#define E1000_WUC 0x05800 /* Wakeup Control - RW */
#define E1000_WUFC 0x05808 /* Wakeup Filter Control - RW */
-#define E1000_WUS 0x05810 /* Wakeup Status - RO */
+#define E1000_WUS 0x05810 /* Wakeup Status - R/W1C */
#define E1000_MANC 0x05820 /* Management Control - RW */
#define E1000_IPAV 0x05838 /* IP Address Valid - RW */
#define E1000_WUPL 0x05900 /* Wakeup Packet Length - RW */
--
2.9.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [net-next 04/10] igb: Workaround for igb i210 firmware issue
2017-01-06 10:48 [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 Jeff Kirsher
` (2 preceding siblings ...)
2017-01-06 10:48 ` [net-next 03/10] igb: correct register comments Jeff Kirsher
@ 2017-01-06 10:48 ` Jeff Kirsher
2017-01-06 10:48 ` [net-next 05/10] igb: use igb_adapter->io_addr instead of e1000_hw->hw_addr Jeff Kirsher
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-01-06 10:48 UTC (permalink / raw)
To: davem
Cc: Chris J Arges, netdev, nhorman, sassmann, jogreene,
guru.anbalagane, Jeff Kirsher
From: Chris J Arges <christopherarges@gmail.com>
Sometimes firmware may not properly initialize I347AT4_PAGE_SELECT causing
the probe of an igb i210 NIC to fail. This patch adds an addition zeroing
of this register during igb_get_phy_id to workaround this issue.
Thanks for Jochen Henneberg for the idea and original patch.
Signed-off-by: Chris J Arges <christopherarges@gmail.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_phy.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c b/drivers/net/ethernet/intel/igb/e1000_phy.c
index 5b54254..569ee25 100644
--- a/drivers/net/ethernet/intel/igb/e1000_phy.c
+++ b/drivers/net/ethernet/intel/igb/e1000_phy.c
@@ -77,6 +77,10 @@ s32 igb_get_phy_id(struct e1000_hw *hw)
s32 ret_val = 0;
u16 phy_id;
+ /* ensure PHY page selection to fix misconfigured i210 */
+ if (hw->mac.type == e1000_i210)
+ phy->ops.write_reg(hw, I347AT4_PAGE_SELECT, 0);
+
ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
if (ret_val)
goto out;
--
2.9.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [net-next 05/10] igb: use igb_adapter->io_addr instead of e1000_hw->hw_addr
2017-01-06 10:48 [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 Jeff Kirsher
` (3 preceding siblings ...)
2017-01-06 10:48 ` [net-next 04/10] igb: Workaround for igb i210 firmware issue Jeff Kirsher
@ 2017-01-06 10:48 ` Jeff Kirsher
2017-01-06 10:48 ` [net-next 06/10] igb: reset the PHY before reading the PHY ID Jeff Kirsher
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-01-06 10:48 UTC (permalink / raw)
To: davem
Cc: Cao jin, netdev, nhorman, sassmann, jogreene, guru.anbalagane,
Jeff Kirsher
From: Cao jin <caoj.fnst@cn.fujitsu.com>
When running as guest, under certain condition, it will oops as following.
writel() in igb_configure_tx_ring() results in oops, because hw->hw_addr
is NULL. While other register access won't oops kernel because they use
wr32/rd32 which have a defense against NULL pointer.
[ 141.225449] pcieport 0000:00:1c.0: AER: Multiple Uncorrected (Fatal)
error received: id=0101
[ 141.225523] igb 0000:01:00.1: PCIe Bus Error:
severity=Uncorrected (Fatal), type=Unaccessible,
id=0101(Unregistered Agent ID)
[ 141.299442] igb 0000:01:00.1: broadcast error_detected message
[ 141.300539] igb 0000:01:00.0 enp1s0f0: PCIe link lost, device now
detached
[ 141.351019] igb 0000:01:00.1 enp1s0f1: PCIe link lost, device now
detached
[ 143.465904] pcieport 0000:00:1c.0: Root Port link has been reset
[ 143.465994] igb 0000:01:00.1: broadcast slot_reset message
[ 143.466039] igb 0000:01:00.0: enabling device (0000 -> 0002)
[ 144.389078] igb 0000:01:00.1: enabling device (0000 -> 0002)
[ 145.312078] igb 0000:01:00.1: broadcast resume message
[ 145.322211] BUG: unable to handle kernel paging request at
0000000000003818
[ 145.361275] IP: [<ffffffffa02fd38d>]
igb_configure_tx_ring+0x14d/0x280 [igb]
[ 145.400048] PGD 0
[ 145.438007] Oops: 0002 [#1] SMP
A similar issue & solution could be found at:
http://patchwork.ozlabs.org/patch/689592/
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index a761001..1e4bd84 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3394,7 +3394,7 @@ void igb_configure_tx_ring(struct igb_adapter *adapter,
tdba & 0x00000000ffffffffULL);
wr32(E1000_TDBAH(reg_idx), tdba >> 32);
- ring->tail = hw->hw_addr + E1000_TDT(reg_idx);
+ ring->tail = adapter->io_addr + E1000_TDT(reg_idx);
wr32(E1000_TDH(reg_idx), 0);
writel(0, ring->tail);
@@ -3733,7 +3733,7 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
ring->count * sizeof(union e1000_adv_rx_desc));
/* initialize head and tail */
- ring->tail = hw->hw_addr + E1000_RDT(reg_idx);
+ ring->tail = adapter->io_addr + E1000_RDT(reg_idx);
wr32(E1000_RDH(reg_idx), 0);
writel(0, ring->tail);
--
2.9.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [net-next 06/10] igb: reset the PHY before reading the PHY ID
2017-01-06 10:48 [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 Jeff Kirsher
` (4 preceding siblings ...)
2017-01-06 10:48 ` [net-next 05/10] igb: use igb_adapter->io_addr instead of e1000_hw->hw_addr Jeff Kirsher
@ 2017-01-06 10:48 ` Jeff Kirsher
2017-01-06 10:48 ` [net-next 07/10] igb: re-assign hw address pointer on reset after PCI error Jeff Kirsher
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-01-06 10:48 UTC (permalink / raw)
To: davem
Cc: Aaron Sierra, netdev, nhorman, sassmann, jogreene,
guru.anbalagane, Matwey V . Kornilov, Chris Arges,
Jochen Henneberg, Jeff Kirsher
From: Aaron Sierra <asierra@xes-inc.com>
Several people have reported firmware leaving the I210/I211 PHY's page
select register set to something other than the default of zero. This
causes the first accesses, PHY_IDx register reads, to access something
else, resulting in device probe failure:
igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
igb: Copyright (c) 2007-2014 Intel Corporation.
igb: probe of 0000:01:00.0 failed with error -2
This problem began for them after a previous patch I submitted was
applied:
commit 2a3cdead8b408351fa1e3079b220fa331480ffbc
Author: Aaron Sierra <asierra@xes-inc.com>
Date: Tue Nov 3 12:37:09 2015 -0600
igb: Remove GS40G specific defines/functions
I personally experienced this problem after attempting to PXE boot from
I210 devices using this firmware:
Intel(R) Boot Agent GE v1.5.78
Copyright (C) 1997-2014, Intel Corporation
Resetting the PHY before reading from it, ensures the page select
register is in its default state and doesn't make assumptions about
the PHY's register set before the PHY has been probed.
Cc: Matwey V. Kornilov <matwey@sai.msu.ru>
Cc: Chris Arges <carges@vectranetworks.com>
Cc: Jochen Henneberg <jh@henneberg-systemdesign.com>
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Tested-by: Matwey V. Kornilov <matwey@sai.msu.ru>
Tested-by: Chris J Arges <christopherarges@gmail.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_82575.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index a61447f..ee44398 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -245,6 +245,17 @@ static s32 igb_init_phy_params_82575(struct e1000_hw *hw)
hw->bus.func = (rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) >>
E1000_STATUS_FUNC_SHIFT;
+ /* Make sure the PHY is in a good state. Several people have reported
+ * firmware leaving the PHY's page select register set to something
+ * other than the default of zero, which causes the PHY ID read to
+ * access something other than the intended register.
+ */
+ ret_val = hw->phy.ops.reset(hw);
+ if (ret_val) {
+ hw_dbg("Error resetting the PHY.\n");
+ goto out;
+ }
+
/* Set phy->phy_addr and phy->id. */
ret_val = igb_get_phy_id_82575(hw);
if (ret_val)
--
2.9.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [net-next 07/10] igb: re-assign hw address pointer on reset after PCI error
2017-01-06 10:48 [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 Jeff Kirsher
` (5 preceding siblings ...)
2017-01-06 10:48 ` [net-next 06/10] igb: reset the PHY before reading the PHY ID Jeff Kirsher
@ 2017-01-06 10:48 ` Jeff Kirsher
2017-01-06 10:48 ` [net-next 08/10] igb: close/suspend race in netif_device_detach Jeff Kirsher
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-01-06 10:48 UTC (permalink / raw)
To: davem
Cc: Guilherme G Piccoli, netdev, nhorman, sassmann, jogreene,
guru.anbalagane, Jeff Kirsher
From: Guilherme G Piccoli <gpiccoli@linux.vnet.ibm.com>
Whenever the igb driver detects the result of a read operation returns
a value composed only by F's (like 0xFFFFFFFF), it will detach the
net_device, clear the hw_addr pointer and warn to the user that adapter's
link is lost - those steps happen on igb_rd32().
In case a PCI error happens on Power architecture, there's a recovery
mechanism called EEH, that will reset the PCI slot and call driver's
handlers to reset the adapter and network functionality as well.
We observed that once hw_addr is NULL after the error is detected on
igb_rd32(), it's never assigned back, so in the process of resetting
the network functionality we got a NULL pointer dereference in both
igb_configure_tx_ring() and igb_configure_rx_ring(). In order to avoid
such bug, this patch re-assigns the hw_addr value in the slot_reset
handler.
Reported-by: Anthony H Thai <ahthai@us.ibm.com>
Reported-by: Harsha Thyagaraja <hathyaga@in.ibm.com>
Signed-off-by: Guilherme G Piccoli <gpiccoli@linux.vnet.ibm.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 1e4bd84..82069bc 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -7898,6 +7898,11 @@ static pci_ers_result_t igb_io_slot_reset(struct pci_dev *pdev)
pci_enable_wake(pdev, PCI_D3hot, 0);
pci_enable_wake(pdev, PCI_D3cold, 0);
+ /* In case of PCI error, adapter lose its HW address
+ * so we should re-assign it here.
+ */
+ hw->hw_addr = adapter->io_addr;
+
igb_reset(adapter);
wr32(E1000_WUS, ~0);
result = PCI_ERS_RESULT_RECOVERED;
--
2.9.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [net-next 08/10] igb: close/suspend race in netif_device_detach
2017-01-06 10:48 [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 Jeff Kirsher
` (6 preceding siblings ...)
2017-01-06 10:48 ` [net-next 07/10] igb: re-assign hw address pointer on reset after PCI error Jeff Kirsher
@ 2017-01-06 10:48 ` Jeff Kirsher
2017-01-06 10:48 ` [net-next 09/10] igb: add i211 to i210 PHY workaround Jeff Kirsher
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-01-06 10:48 UTC (permalink / raw)
To: davem
Cc: Todd Fujinaka, netdev, nhorman, sassmann, jogreene,
guru.anbalagane, Jeff Kirsher
From: Todd Fujinaka <todd.fujinaka@intel.com>
Similar to ixgbe, when an interface is part of a namespace it is
possible that igb_close() may be called while __igb_shutdown() is
running which ends up in a double free WARN and/or a BUG in
free_msi_irqs().
Extend the rtnl_lock() to protect the call to netif_device_detach() and
igb_clear_interrupt_scheme() in __igb_shutdown() and check for
netif_device_present() to avoid calling igb_clear_interrupt_scheme() a
second time in igb_close().
Also extend the rtnl lock in igb_resume() to netif_device_attach().
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 82069bc..594604e 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3275,7 +3275,9 @@ static int __igb_close(struct net_device *netdev, bool suspending)
int igb_close(struct net_device *netdev)
{
- return __igb_close(netdev, false);
+ if (netif_device_present(netdev))
+ return __igb_close(netdev, false);
+ return 0;
}
/**
@@ -7564,6 +7566,7 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,
int retval = 0;
#endif
+ rtnl_lock();
netif_device_detach(netdev);
if (netif_running(netdev))
@@ -7572,6 +7575,7 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,
igb_ptp_suspend(adapter);
igb_clear_interrupt_scheme(adapter);
+ rtnl_unlock();
#ifdef CONFIG_PM
retval = pci_save_state(pdev);
@@ -7690,16 +7694,15 @@ static int igb_resume(struct device *dev)
wr32(E1000_WUS, ~0);
- if (netdev->flags & IFF_UP) {
- rtnl_lock();
+ rtnl_lock();
+ if (!err && netif_running(netdev))
err = __igb_open(netdev, true);
- rtnl_unlock();
- if (err)
- return err;
- }
- netif_device_attach(netdev);
- return 0;
+ if (!err)
+ netif_device_attach(netdev);
+ rtnl_unlock();
+
+ return err;
}
static int igb_runtime_idle(struct device *dev)
--
2.9.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [net-next 09/10] igb: add i211 to i210 PHY workaround
2017-01-06 10:48 [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 Jeff Kirsher
` (7 preceding siblings ...)
2017-01-06 10:48 ` [net-next 08/10] igb: close/suspend race in netif_device_detach Jeff Kirsher
@ 2017-01-06 10:48 ` Jeff Kirsher
2017-01-06 10:48 ` [net-next 10/10] igb: Fix hw_dbg logging in igb_update_flash_i210 Jeff Kirsher
2017-01-06 21:05 ` [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 David Miller
10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-01-06 10:48 UTC (permalink / raw)
To: davem
Cc: Todd Fujinaka, netdev, nhorman, sassmann, jogreene,
guru.anbalagane, Jeff Kirsher
From: Todd Fujinaka <todd.fujinaka@intel.com>
i210 and i211 share the same PHY but have different PCI IDs. Don't
forget i211 for any i210 workarounds.
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_phy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c b/drivers/net/ethernet/intel/igb/e1000_phy.c
index 569ee25..2788a54 100644
--- a/drivers/net/ethernet/intel/igb/e1000_phy.c
+++ b/drivers/net/ethernet/intel/igb/e1000_phy.c
@@ -78,7 +78,7 @@ s32 igb_get_phy_id(struct e1000_hw *hw)
u16 phy_id;
/* ensure PHY page selection to fix misconfigured i210 */
- if (hw->mac.type == e1000_i210)
+ if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211))
phy->ops.write_reg(hw, I347AT4_PAGE_SELECT, 0);
ret_val = phy->ops.read_reg(hw, PHY_ID1, &phy_id);
--
2.9.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [net-next 10/10] igb: Fix hw_dbg logging in igb_update_flash_i210
2017-01-06 10:48 [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 Jeff Kirsher
` (8 preceding siblings ...)
2017-01-06 10:48 ` [net-next 09/10] igb: add i211 to i210 PHY workaround Jeff Kirsher
@ 2017-01-06 10:48 ` Jeff Kirsher
2017-01-06 21:05 ` [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 David Miller
10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2017-01-06 10:48 UTC (permalink / raw)
To: davem
Cc: Hannu Lounento, netdev, nhorman, sassmann, jogreene,
guru.anbalagane, Peter Senna Tschudin, Jeff Kirsher
From: Hannu Lounento <hannu.lounento@ge.com>
Fix an if statement with hw_dbg lines where the logic was inverted with
regards to the corresponding return value used in the if statement.
Signed-off-by: Hannu Lounento <hannu.lounento@ge.com>
Signed-off-by: Peter Senna Tschudin <peter.senna@collabora.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_i210.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/e1000_i210.c b/drivers/net/ethernet/intel/igb/e1000_i210.c
index 8aa7987..07d48f2 100644
--- a/drivers/net/ethernet/intel/igb/e1000_i210.c
+++ b/drivers/net/ethernet/intel/igb/e1000_i210.c
@@ -699,9 +699,9 @@ static s32 igb_update_flash_i210(struct e1000_hw *hw)
ret_val = igb_pool_flash_update_done_i210(hw);
if (ret_val)
- hw_dbg("Flash update complete\n");
- else
hw_dbg("Flash update time out\n");
+ else
+ hw_dbg("Flash update complete\n");
out:
return ret_val;
--
2.9.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06
2017-01-06 10:48 [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 Jeff Kirsher
` (9 preceding siblings ...)
2017-01-06 10:48 ` [net-next 10/10] igb: Fix hw_dbg logging in igb_update_flash_i210 Jeff Kirsher
@ 2017-01-06 21:05 ` David Miller
10 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2017-01-06 21:05 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene, guru.anbalagane
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 6 Jan 2017 02:48:42 -0800
> This series contains updates/fixes to igb and e1000e.
Pulled, thanks Jeff.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2017-01-06 21:05 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-06 10:48 [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 Jeff Kirsher
2017-01-06 10:48 ` [net-next 01/10] igb: Realign bad indentation Jeff Kirsher
2017-01-06 10:48 ` [net-next 02/10] e1000e: driver trying to free already-free irq Jeff Kirsher
2017-01-06 10:48 ` [net-next 03/10] igb: correct register comments Jeff Kirsher
2017-01-06 10:48 ` [net-next 04/10] igb: Workaround for igb i210 firmware issue Jeff Kirsher
2017-01-06 10:48 ` [net-next 05/10] igb: use igb_adapter->io_addr instead of e1000_hw->hw_addr Jeff Kirsher
2017-01-06 10:48 ` [net-next 06/10] igb: reset the PHY before reading the PHY ID Jeff Kirsher
2017-01-06 10:48 ` [net-next 07/10] igb: re-assign hw address pointer on reset after PCI error Jeff Kirsher
2017-01-06 10:48 ` [net-next 08/10] igb: close/suspend race in netif_device_detach Jeff Kirsher
2017-01-06 10:48 ` [net-next 09/10] igb: add i211 to i210 PHY workaround Jeff Kirsher
2017-01-06 10:48 ` [net-next 10/10] igb: Fix hw_dbg logging in igb_update_flash_i210 Jeff Kirsher
2017-01-06 21:05 ` [net-next 00/10][pull request] 1GbE Intel Wired LAN Driver Updates 2017-01-06 David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).