From: Greg Kroah-Hartman Date: Mon, 24 Sep 2018 11:11:23 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v3.18.123~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=914b18e33c95d318c92249829c98709b41a3f53c;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: asoc-samsung-fix-invalid-argument-when-devm_gpiod_get-is-called.patch asoc-samsung-i2s-fix-error-handling-path-in-i2s_set_sysclk.patch drm-i915-apply-the-gtt-write-flush-for-all-llc-machines.patch e1000e-avoid-missed-interrupts-following-icr-read.patch e1000e-fix-check_for_link-return-value-with-autoneg-off.patch e1000e-fix-link-check-race-condition.patch e1000e-fix-queue-interrupt-re-raising-in-other-interrupt.patch e1000e-remove-other-from-eiac.patch earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch mei-bus-type-promotion-bug-in-mei_nfc_if_version.patch net-ipv6-prevent-use-after-free-in-ip6_route_mpath_notify.patch partial-revert-e1000e-avoid-receiver-overrun-interrupt-bursts.patch revert-e1000e-separate-signaling-for-link-check-link-up.patch --- diff --git a/queue-4.14/asoc-samsung-fix-invalid-argument-when-devm_gpiod_get-is-called.patch b/queue-4.14/asoc-samsung-fix-invalid-argument-when-devm_gpiod_get-is-called.patch new file mode 100644 index 00000000000..d4bca489421 --- /dev/null +++ b/queue-4.14/asoc-samsung-fix-invalid-argument-when-devm_gpiod_get-is-called.patch @@ -0,0 +1,40 @@ +From 975b6a93088e83a41ba2f0dec2f086678fdb2a7a Mon Sep 17 00:00:00 2001 +From: Jaechul Lee +Date: Wed, 6 Sep 2017 10:04:15 +0900 +Subject: ASoC: samsung: Fix invalid argument when devm_gpiod_get is called + +From: Jaechul Lee + +commit 975b6a93088e83a41ba2f0dec2f086678fdb2a7a upstream. + +devm_gpiod_get is called with GPIOF_OUT_INIT_LOW but the function doesn't +allow the parameters. Unluckily, GPIOF_OUT_INIT_LOW is same value as +GPIOD_ASIS and gpio direction isn't set properly. + +Muted stream comes up when I try recording some sounds on TM2. mic-bias +gpiod state can't be changed because the gpiod is created with the invalid +parameter. The gpio should be set GPIOD_OUT_HIGH. + +Fixes: 1bfbc260a5b4 ("ASoC: samsung: Add machine driver for Exynos5433 based TM2 board") +Signed-off-by: Jaechul Lee +Reviewed-by: Krzysztof Kozlowski +Signed-off-by: Mark Brown +Signed-off-by: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/samsung/tm2_wm5110.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/sound/soc/samsung/tm2_wm5110.c ++++ b/sound/soc/samsung/tm2_wm5110.c +@@ -436,8 +436,7 @@ static int tm2_probe(struct platform_dev + snd_soc_card_set_drvdata(card, priv); + card->dev = dev; + +- priv->gpio_mic_bias = devm_gpiod_get(dev, "mic-bias", +- GPIOF_OUT_INIT_LOW); ++ priv->gpio_mic_bias = devm_gpiod_get(dev, "mic-bias", GPIOD_OUT_HIGH); + if (IS_ERR(priv->gpio_mic_bias)) { + dev_err(dev, "Failed to get mic bias gpio\n"); + return PTR_ERR(priv->gpio_mic_bias); diff --git a/queue-4.14/asoc-samsung-i2s-fix-error-handling-path-in-i2s_set_sysclk.patch b/queue-4.14/asoc-samsung-i2s-fix-error-handling-path-in-i2s_set_sysclk.patch new file mode 100644 index 00000000000..a9e2ab76678 --- /dev/null +++ b/queue-4.14/asoc-samsung-i2s-fix-error-handling-path-in-i2s_set_sysclk.patch @@ -0,0 +1,37 @@ +From 6431a7e36652517df82855ee79c8240001812a55 Mon Sep 17 00:00:00 2001 +From: Christophe Jaillet +Date: Sun, 3 Sep 2017 14:29:02 +0200 +Subject: ASoC: samsung: i2s: Fix error handling path in i2s_set_sysclk() + +From: Christophe Jaillet + +commit 6431a7e36652517df82855ee79c8240001812a55 upstream. + +If 'clk_prepare_enable()' fails, we must 'put' the corresponding clock. +Othewise, there is a resource leak. + +Fixes: f5c97c7b0438 ("ASoC: samsung: i2s: Handle return value of clk_prepare_enable.") +Signed-off-by: Christophe JAILLET +Signed-off-by: Mark Brown +Signed-off-by: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/samsung/i2s.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/sound/soc/samsung/i2s.c ++++ b/sound/soc/samsung/i2s.c +@@ -552,8 +552,11 @@ static int i2s_set_sysclk(struct snd_soc + } + + ret = clk_prepare_enable(i2s->op_clk); +- if (ret) ++ if (ret) { ++ clk_put(i2s->op_clk); ++ i2s->op_clk = NULL; + goto err; ++ } + i2s->rclk_srcrate = clk_get_rate(i2s->op_clk); + + /* Over-ride the other's */ diff --git a/queue-4.14/drm-i915-apply-the-gtt-write-flush-for-all-llc-machines.patch b/queue-4.14/drm-i915-apply-the-gtt-write-flush-for-all-llc-machines.patch new file mode 100644 index 00000000000..bfb6dcba093 --- /dev/null +++ b/queue-4.14/drm-i915-apply-the-gtt-write-flush-for-all-llc-machines.patch @@ -0,0 +1,45 @@ +From c5ba5b24657e473b1c64b0a614b168a635a2c935 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Thu, 7 Sep 2017 19:45:20 +0100 +Subject: drm/i915: Apply the GTT write flush for all !llc machines +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Chris Wilson + +commit c5ba5b24657e473b1c64b0a614b168a635a2c935 upstream. + +We also see the delayed GTT write issue on i915g/i915gm, so let's +presume that it is a universal problem for all !llc machines, and that we +just haven't yet noticed on g33, gen4 and gen5 machines. + +v2: Use a register that exists on all platforms + +Testcase: igt/gem_mmap_gtt/coherency # i915gm +References: https://bugs.freedesktop.org/show_bug.cgi?id=102577 +Signed-off-by: Chris Wilson +Cc: Ville Syrjälä +Link: https://patchwork.freedesktop.org/patch/msgid/20170907184520.5032-1-chris@chris-wilson.co.uk +Reviewed-by: Ville Syrjälä +Signed-off-by: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/i915/i915_gem.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -687,10 +687,10 @@ flush_write_domain(struct drm_i915_gem_o + + switch (obj->base.write_domain) { + case I915_GEM_DOMAIN_GTT: +- if (INTEL_GEN(dev_priv) >= 6 && !HAS_LLC(dev_priv)) { ++ if (!HAS_LLC(dev_priv)) { + intel_runtime_pm_get(dev_priv); + spin_lock_irq(&dev_priv->uncore.lock); +- POSTING_READ_FW(RING_ACTHD(dev_priv->engine[RCS]->mmio_base)); ++ POSTING_READ_FW(RING_HEAD(dev_priv->engine[RCS]->mmio_base)); + spin_unlock_irq(&dev_priv->uncore.lock); + intel_runtime_pm_put(dev_priv); + } diff --git a/queue-4.14/e1000e-avoid-missed-interrupts-following-icr-read.patch b/queue-4.14/e1000e-avoid-missed-interrupts-following-icr-read.patch new file mode 100644 index 00000000000..73f1fbb1d0f --- /dev/null +++ b/queue-4.14/e1000e-avoid-missed-interrupts-following-icr-read.patch @@ -0,0 +1,124 @@ +From 116f4a640b3197401bc93b8adc6c35040308ceff Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Thu, 8 Feb 2018 15:47:14 +0900 +Subject: e1000e: Avoid missed interrupts following ICR read + +From: Benjamin Poirier + +commit 116f4a640b3197401bc93b8adc6c35040308ceff upstream. + +The 82574 specification update errata 12 states that interrupts may be +missed if ICR is read while INT_ASSERTED is not set. Avoid that problem by +setting all bits related to events that can trigger the Other interrupt in +IMS. + +The Other interrupt is raised for such events regardless of whether or not +they are set in IMS. However, only when they are set is the INT_ASSERTED +bit also set in ICR. + +By doing this, we ensure that INT_ASSERTED is always set when we read ICR +in e1000_msix_other() and steer clear of the errata. This also ensures that +ICR will automatically be cleared on read, therefore we no longer need to +clear bits explicitly. + +Signed-off-by: Benjamin Poirier +Acked-by: Alexander Duyck +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Cc: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/intel/e1000e/defines.h | 21 ++++++++++++++++++++- + drivers/net/ethernet/intel/e1000e/netdev.c | 11 ++++------- + 2 files changed, 24 insertions(+), 8 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/defines.h ++++ b/drivers/net/ethernet/intel/e1000e/defines.h +@@ -400,6 +400,10 @@ + #define E1000_ICR_RXDMT0 0x00000010 /* Rx desc min. threshold (0) */ + #define E1000_ICR_RXO 0x00000040 /* Receiver Overrun */ + #define E1000_ICR_RXT0 0x00000080 /* Rx timer intr (ring 0) */ ++#define E1000_ICR_MDAC 0x00000200 /* MDIO Access Complete */ ++#define E1000_ICR_SRPD 0x00010000 /* Small Receive Packet Detected */ ++#define E1000_ICR_ACK 0x00020000 /* Receive ACK Frame Detected */ ++#define E1000_ICR_MNG 0x00040000 /* Manageability Event Detected */ + #define E1000_ICR_ECCER 0x00400000 /* Uncorrectable ECC Error */ + /* If this bit asserted, the driver should claim the interrupt */ + #define E1000_ICR_INT_ASSERTED 0x80000000 +@@ -407,7 +411,7 @@ + #define E1000_ICR_RXQ1 0x00200000 /* Rx Queue 1 Interrupt */ + #define E1000_ICR_TXQ0 0x00400000 /* Tx Queue 0 Interrupt */ + #define E1000_ICR_TXQ1 0x00800000 /* Tx Queue 1 Interrupt */ +-#define E1000_ICR_OTHER 0x01000000 /* Other Interrupts */ ++#define E1000_ICR_OTHER 0x01000000 /* Other Interrupt */ + + /* PBA ECC Register */ + #define E1000_PBA_ECC_COUNTER_MASK 0xFFF00000 /* ECC counter mask */ +@@ -431,12 +435,27 @@ + E1000_IMS_RXSEQ | \ + E1000_IMS_LSC) + ++/* These are all of the events related to the OTHER interrupt. ++ */ ++#define IMS_OTHER_MASK ( \ ++ E1000_IMS_LSC | \ ++ E1000_IMS_RXO | \ ++ E1000_IMS_MDAC | \ ++ E1000_IMS_SRPD | \ ++ E1000_IMS_ACK | \ ++ E1000_IMS_MNG) ++ + /* Interrupt Mask Set */ + #define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ + #define E1000_IMS_LSC E1000_ICR_LSC /* Link Status Change */ + #define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* Rx sequence error */ + #define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* Rx desc min. threshold */ ++#define E1000_IMS_RXO E1000_ICR_RXO /* Receiver Overrun */ + #define E1000_IMS_RXT0 E1000_ICR_RXT0 /* Rx timer intr */ ++#define E1000_IMS_MDAC E1000_ICR_MDAC /* MDIO Access Complete */ ++#define E1000_IMS_SRPD E1000_ICR_SRPD /* Small Receive Packet */ ++#define E1000_IMS_ACK E1000_ICR_ACK /* Receive ACK Frame Detected */ ++#define E1000_IMS_MNG E1000_ICR_MNG /* Manageability Event */ + #define E1000_IMS_ECCER E1000_ICR_ECCER /* Uncorrectable ECC Error */ + #define E1000_IMS_RXQ0 E1000_ICR_RXQ0 /* Rx Queue 0 Interrupt */ + #define E1000_IMS_RXQ1 E1000_ICR_RXQ1 /* Rx Queue 1 Interrupt */ +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -1910,16 +1910,12 @@ static irqreturn_t e1000_msix_other(int + struct net_device *netdev = data; + struct e1000_adapter *adapter = netdev_priv(netdev); + struct e1000_hw *hw = &adapter->hw; +- u32 icr; +- +- icr = er32(ICR); +- ew32(ICR, E1000_ICR_OTHER); ++ u32 icr = er32(ICR); + + if (icr & adapter->eiac_mask) + ew32(ICS, (icr & adapter->eiac_mask)); + + if (icr & E1000_ICR_LSC) { +- ew32(ICR, E1000_ICR_LSC); + hw->mac.get_link_status = true; + /* guard against interrupt when we're going down */ + if (!test_bit(__E1000_DOWN, &adapter->state)) +@@ -1927,7 +1923,7 @@ static irqreturn_t e1000_msix_other(int + } + + if (!test_bit(__E1000_DOWN, &adapter->state)) +- ew32(IMS, E1000_IMS_OTHER); ++ ew32(IMS, E1000_IMS_OTHER | IMS_OTHER_MASK); + + return IRQ_HANDLED; + } +@@ -2254,7 +2250,8 @@ static void e1000_irq_enable(struct e100 + + if (adapter->msix_entries) { + ew32(EIAC_82574, adapter->eiac_mask & E1000_EIAC_MASK_82574); +- ew32(IMS, adapter->eiac_mask | E1000_IMS_OTHER | E1000_IMS_LSC); ++ ew32(IMS, adapter->eiac_mask | E1000_IMS_OTHER | ++ IMS_OTHER_MASK); + } else if (hw->mac.type >= e1000_pch_lpt) { + ew32(IMS, IMS_ENABLE_MASK | E1000_IMS_ECCER); + } else { diff --git a/queue-4.14/e1000e-fix-check_for_link-return-value-with-autoneg-off.patch b/queue-4.14/e1000e-fix-check_for_link-return-value-with-autoneg-off.patch new file mode 100644 index 00000000000..7a3c2207c39 --- /dev/null +++ b/queue-4.14/e1000e-fix-check_for_link-return-value-with-autoneg-off.patch @@ -0,0 +1,49 @@ +From 4e7dc08e57c95673d2edaba8983c3de4dd1f65f5 Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Tue, 20 Feb 2018 15:12:00 +0900 +Subject: e1000e: Fix check_for_link return value with autoneg off + +From: Benjamin Poirier + +commit 4e7dc08e57c95673d2edaba8983c3de4dd1f65f5 upstream. + +When autoneg is off, the .check_for_link callback functions clear the +get_link_status flag and systematically return a "pseudo-error". This means +that the link is not detected as up until the next execution of the +e1000_watchdog_task() 2 seconds later. + +Fixes: 19110cfbb34d ("e1000e: Separate signaling for link check/link up") +Signed-off-by: Benjamin Poirier +Acked-by: Sasha Neftin +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Cc: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/intel/e1000e/ich8lan.c | 2 +- + drivers/net/ethernet/intel/e1000e/mac.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c ++++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c +@@ -1598,7 +1598,7 @@ static s32 e1000_check_for_copper_link_i + * we have already determined whether we have link or not. + */ + if (!mac->autoneg) +- return -E1000_ERR_CONFIG; ++ return 1; + + /* Auto-Neg is enabled. Auto Speed Detection takes care + * of MAC speed/duplex configuration. So we only need to +--- a/drivers/net/ethernet/intel/e1000e/mac.c ++++ b/drivers/net/ethernet/intel/e1000e/mac.c +@@ -443,7 +443,7 @@ s32 e1000e_check_for_copper_link(struct + * we have already determined whether we have link or not. + */ + if (!mac->autoneg) +- return -E1000_ERR_CONFIG; ++ return 1; + + /* Auto-Neg is enabled. Auto Speed Detection takes care + * of MAC speed/duplex configuration. So we only need to diff --git a/queue-4.14/e1000e-fix-link-check-race-condition.patch b/queue-4.14/e1000e-fix-link-check-race-condition.patch new file mode 100644 index 00000000000..b501400e13a --- /dev/null +++ b/queue-4.14/e1000e-fix-link-check-race-condition.patch @@ -0,0 +1,206 @@ +From e2710dbf0dc1e37d85368e2404049dadda848d5a Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Tue, 6 Mar 2018 10:55:53 +0900 +Subject: e1000e: Fix link check race condition + +From: Benjamin Poirier + +commit e2710dbf0dc1e37d85368e2404049dadda848d5a upstream. + +Alex reported the following race condition: + +/* link goes up... interrupt... schedule watchdog */ +\ e1000_watchdog_task + \ e1000e_has_link + \ hw->mac.ops.check_for_link() === e1000e_check_for_copper_link + \ e1000e_phy_has_link_generic(..., &link) + link = true + + /* link goes down... interrupt */ + \ e1000_msix_other + hw->mac.get_link_status = true + + /* link is up */ + mac->get_link_status = false + + link_active = true + /* link_active is true, wrongly, and stays so because + * get_link_status is false */ + +Avoid this problem by making sure that we don't set get_link_status = false +after having checked the link. + +It seems this problem has been present since the introduction of e1000e. + +Link: https://lkml.org/lkml/2018/1/29/338 +Reported-by: Alexander Duyck +Signed-off-by: Benjamin Poirier +Acked-by: Alexander Duyck +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Cc: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/intel/e1000e/ich8lan.c | 31 +++++++++++++++------------- + drivers/net/ethernet/intel/e1000e/mac.c | 14 ++++++------ + 2 files changed, 24 insertions(+), 21 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c ++++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c +@@ -1383,6 +1383,7 @@ static s32 e1000_check_for_copper_link_i + */ + if (!mac->get_link_status) + return 0; ++ mac->get_link_status = false; + + /* First we want to see if the MII Status Register reports + * link. If so, then we want to get the current speed/duplex +@@ -1390,12 +1391,12 @@ static s32 e1000_check_for_copper_link_i + */ + ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); + if (ret_val) +- return ret_val; ++ goto out; + + if (hw->mac.type == e1000_pchlan) { + ret_val = e1000_k1_gig_workaround_hv(hw, link); + if (ret_val) +- return ret_val; ++ goto out; + } + + /* When connected at 10Mbps half-duplex, some parts are excessively +@@ -1428,7 +1429,7 @@ static s32 e1000_check_for_copper_link_i + + ret_val = hw->phy.ops.acquire(hw); + if (ret_val) +- return ret_val; ++ goto out; + + if (hw->mac.type == e1000_pch2lan) + emi_addr = I82579_RX_CONFIG; +@@ -1450,7 +1451,7 @@ static s32 e1000_check_for_copper_link_i + hw->phy.ops.release(hw); + + if (ret_val) +- return ret_val; ++ goto out; + + if (hw->mac.type >= e1000_pch_spt) { + u16 data; +@@ -1459,14 +1460,14 @@ static s32 e1000_check_for_copper_link_i + if (speed == SPEED_1000) { + ret_val = hw->phy.ops.acquire(hw); + if (ret_val) +- return ret_val; ++ goto out; + + ret_val = e1e_rphy_locked(hw, + PHY_REG(776, 20), + &data); + if (ret_val) { + hw->phy.ops.release(hw); +- return ret_val; ++ goto out; + } + + ptr_gap = (data & (0x3FF << 2)) >> 2; +@@ -1480,18 +1481,18 @@ static s32 e1000_check_for_copper_link_i + } + hw->phy.ops.release(hw); + if (ret_val) +- return ret_val; ++ goto out; + } else { + ret_val = hw->phy.ops.acquire(hw); + if (ret_val) +- return ret_val; ++ goto out; + + ret_val = e1e_wphy_locked(hw, + PHY_REG(776, 20), + 0xC023); + hw->phy.ops.release(hw); + if (ret_val) +- return ret_val; ++ goto out; + + } + } +@@ -1518,7 +1519,7 @@ static s32 e1000_check_for_copper_link_i + (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_V3)) { + ret_val = e1000_k1_workaround_lpt_lp(hw, link); + if (ret_val) +- return ret_val; ++ goto out; + } + if (hw->mac.type >= e1000_pch_lpt) { + /* Set platform power management values for +@@ -1526,7 +1527,7 @@ static s32 e1000_check_for_copper_link_i + */ + ret_val = e1000_platform_pm_pch_lpt(hw, link); + if (ret_val) +- return ret_val; ++ goto out; + } + + /* Clear link partner's EEE ability */ +@@ -1549,9 +1550,7 @@ static s32 e1000_check_for_copper_link_i + } + + if (!link) +- return 0; /* No link detected */ +- +- mac->get_link_status = false; ++ goto out; + + switch (hw->mac.type) { + case e1000_pch2lan: +@@ -1617,6 +1616,10 @@ static s32 e1000_check_for_copper_link_i + e_dbg("Error configuring flow control\n"); + + return ret_val; ++ ++out: ++ mac->get_link_status = true; ++ return ret_val; + } + + static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) +--- a/drivers/net/ethernet/intel/e1000e/mac.c ++++ b/drivers/net/ethernet/intel/e1000e/mac.c +@@ -424,19 +424,15 @@ s32 e1000e_check_for_copper_link(struct + */ + if (!mac->get_link_status) + return 0; ++ mac->get_link_status = false; + + /* First we want to see if the MII Status Register reports + * link. If so, then we want to get the current speed/duplex + * of the PHY. + */ + ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link); +- if (ret_val) +- return ret_val; +- +- if (!link) +- return 0; /* No link detected */ +- +- mac->get_link_status = false; ++ if (ret_val || !link) ++ goto out; + + /* Check if there was DownShift, must be checked + * immediately after link-up +@@ -465,6 +461,10 @@ s32 e1000e_check_for_copper_link(struct + e_dbg("Error configuring flow control\n"); + + return ret_val; ++ ++out: ++ mac->get_link_status = true; ++ return ret_val; + } + + /** diff --git a/queue-4.14/e1000e-fix-queue-interrupt-re-raising-in-other-interrupt.patch b/queue-4.14/e1000e-fix-queue-interrupt-re-raising-in-other-interrupt.patch new file mode 100644 index 00000000000..46d31cb3961 --- /dev/null +++ b/queue-4.14/e1000e-fix-queue-interrupt-re-raising-in-other-interrupt.patch @@ -0,0 +1,42 @@ +From 361a954e6a7215de11a6179ad9bdc07d7e394b04 Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Thu, 8 Feb 2018 15:47:13 +0900 +Subject: e1000e: Fix queue interrupt re-raising in Other interrupt + +From: Benjamin Poirier + +commit 361a954e6a7215de11a6179ad9bdc07d7e394b04 upstream. + +Restores the ICS write for Rx/Tx queue interrupts which was present before +commit 16ecba59bc33 ("e1000e: Do not read ICR in Other interrupt", v4.5-rc1) +but was not restored in commit 4aea7a5c5e94 +("e1000e: Avoid receiver overrun interrupt bursts", v4.15-rc1). + +This re-raises the queue interrupts in case the txq or rxq bits were set in +ICR and the Other interrupt handler read and cleared ICR before the queue +interrupt was raised. + +Fixes: 4aea7a5c5e94 ("e1000e: Avoid receiver overrun interrupt bursts") +Signed-off-by: Benjamin Poirier +Acked-by: Alexander Duyck +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Cc: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/intel/e1000e/netdev.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -1915,6 +1915,9 @@ static irqreturn_t e1000_msix_other(int + icr = er32(ICR); + ew32(ICR, E1000_ICR_OTHER); + ++ if (icr & adapter->eiac_mask) ++ ew32(ICS, (icr & adapter->eiac_mask)); ++ + if (icr & E1000_ICR_LSC) { + ew32(ICR, E1000_ICR_LSC); + hw->mac.get_link_status = true; diff --git a/queue-4.14/e1000e-remove-other-from-eiac.patch b/queue-4.14/e1000e-remove-other-from-eiac.patch new file mode 100644 index 00000000000..2c2780da532 --- /dev/null +++ b/queue-4.14/e1000e-remove-other-from-eiac.patch @@ -0,0 +1,59 @@ +From 745d0bd3af99ccc8c5f5822f808cd133eadad6ac Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Wed, 31 Jan 2018 16:26:27 +0900 +Subject: e1000e: Remove Other from EIAC + +From: Benjamin Poirier + +commit 745d0bd3af99ccc8c5f5822f808cd133eadad6ac upstream. + +It was reported that emulated e1000e devices in vmware esxi 6.5 Build +7526125 do not link up after commit 4aea7a5c5e94 ("e1000e: Avoid receiver +overrun interrupt bursts", v4.15-rc1). Some tracing shows that after +e1000e_trigger_lsc() is called, ICR reads out as 0x0 in e1000_msix_other() +on emulated e1000e devices. In comparison, on real e1000e 82574 hardware, +icr=0x80000004 (_INT_ASSERTED | _LSC) in the same situation. + +Some experimentation showed that this flaw in vmware e1000e emulation can +be worked around by not setting Other in EIAC. This is how it was before +16ecba59bc33 ("e1000e: Do not read ICR in Other interrupt", v4.5-rc1). + +Fixes: 4aea7a5c5e94 ("e1000e: Avoid receiver overrun interrupt bursts") +Signed-off-by: Benjamin Poirier +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Cc: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/intel/e1000e/netdev.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -1914,6 +1914,8 @@ static irqreturn_t e1000_msix_other(int + bool enable = true; + + icr = er32(ICR); ++ ew32(ICR, E1000_ICR_OTHER); ++ + if (icr & E1000_ICR_RXO) { + ew32(ICR, E1000_ICR_RXO); + enable = false; +@@ -2036,7 +2038,6 @@ static void e1000_configure_msix(struct + hw->hw_addr + E1000_EITR_82574(vector)); + else + writel(1, hw->hw_addr + E1000_EITR_82574(vector)); +- adapter->eiac_mask |= E1000_IMS_OTHER; + + /* Cause Tx interrupts on every write back */ + ivar |= BIT(31); +@@ -2261,7 +2262,7 @@ static void e1000_irq_enable(struct e100 + + if (adapter->msix_entries) { + ew32(EIAC_82574, adapter->eiac_mask & E1000_EIAC_MASK_82574); +- ew32(IMS, adapter->eiac_mask | E1000_IMS_LSC); ++ ew32(IMS, adapter->eiac_mask | E1000_IMS_OTHER | E1000_IMS_LSC); + } else if (hw->mac.type >= e1000_pch_lpt) { + ew32(IMS, IMS_ENABLE_MASK | E1000_IMS_ECCER); + } else { diff --git a/queue-4.14/earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch b/queue-4.14/earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch new file mode 100644 index 00000000000..1b98958af4b --- /dev/null +++ b/queue-4.14/earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch @@ -0,0 +1,45 @@ +From 814453adea7d081ad8917aa0f32d6a14165a3563 Mon Sep 17 00:00:00 2001 +From: Michal Simek +Date: Tue, 10 Apr 2018 15:32:28 +0200 +Subject: earlycon: Initialize port->uartclk based on clock-frequency property + +From: Michal Simek + +commit 814453adea7d081ad8917aa0f32d6a14165a3563 upstream. + +On DT based platforms when current-speed property is present baudrate +is setup. Also port->uartclk is initialized to bogus BASE_BAUD * 16 +value. Drivers like uartps/ns16550 contain logic when baudrate and +uartclk is used for baudrate calculation. + +The patch is reading optional clock-frequency property to replace bogus +BASE_BAUD * 16 calculation to have proper baudrate calculation. + +[-stable comment: commit 31cb9a8575ca ("earlycon: initialise baud field + of earlycon device structure") has changed 8250_early.c behavior which + now tries to setup UART speed. Ignoring clock-frequency results in + wrong value of calculated divisor & malformed early console output.] + +Fixes: 31cb9a8575ca ("earlycon: initialise baud field of earlycon device structure") +Signed-off-by: Michal Simek +[rmilecki: add -stable comment and Fixes tag] +Signed-off-by: Rafał Miłecki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/earlycon.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/tty/serial/earlycon.c ++++ b/drivers/tty/serial/earlycon.c +@@ -289,6 +289,10 @@ int __init of_setup_earlycon(const struc + if (val) + early_console_dev.baud = be32_to_cpu(*val); + ++ val = of_get_flat_dt_prop(node, "clock-frequency", NULL); ++ if (val) ++ port->uartclk = be32_to_cpu(*val); ++ + if (options) { + early_console_dev.baud = simple_strtoul(options, NULL, 0); + strlcpy(early_console_dev.options, options, diff --git a/queue-4.14/earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch b/queue-4.14/earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch new file mode 100644 index 00000000000..a4df913840b --- /dev/null +++ b/queue-4.14/earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch @@ -0,0 +1,40 @@ +From 182ead3e418a20328b73152b8e81fc8b4cac3b0b Mon Sep 17 00:00:00 2001 +From: Michal Simek +Date: Wed, 25 Apr 2018 15:48:42 +0200 +Subject: earlycon: Remove hardcoded port->uartclk initialization in of_setup_earlycon + +From: Michal Simek + +commit 182ead3e418a20328b73152b8e81fc8b4cac3b0b upstream. + +There is no reason to initialize uartclk to BASE_BAUD * 16 for DT based +systems. + +[-stable comment: commit 31cb9a8575ca ("earlycon: initialise baud field + of earlycon device structure") has changed 8250_early.c behavior which + now tries to setup UART speed. + Already-backported upstream commit 0ff3ab701963 ("serial: 8250_early: + Only set divisor if valid clk & baud") handles properly uartclk not + being set but it still requires backporting fix for wrong uartclk val. + This fixes malformed early console output on arch-es with BASE_BAUD.] + +Fixes: 31cb9a8575ca ("earlycon: initialise baud field of earlycon device structure") +Signed-off-by: Michal Simek +Tested-by: Matt Redfearn +[rmilecki: add -stable comment and Fixes tag] +Signed-off-by: Rafał Miłecki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/earlycon.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/tty/serial/earlycon.c ++++ b/drivers/tty/serial/earlycon.c +@@ -254,7 +254,6 @@ int __init of_setup_earlycon(const struc + return -ENXIO; + } + port->mapbase = addr; +- port->uartclk = BASE_BAUD * 16; + + val = of_get_flat_dt_prop(node, "reg-offset", NULL); + if (val) diff --git a/queue-4.14/mei-bus-type-promotion-bug-in-mei_nfc_if_version.patch b/queue-4.14/mei-bus-type-promotion-bug-in-mei_nfc_if_version.patch new file mode 100644 index 00000000000..283b77412d8 --- /dev/null +++ b/queue-4.14/mei-bus-type-promotion-bug-in-mei_nfc_if_version.patch @@ -0,0 +1,37 @@ +From b40b3e9358fbafff6a4ba0f4b9658f6617146f9c Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 11 Jul 2018 15:29:31 +0300 +Subject: mei: bus: type promotion bug in mei_nfc_if_version() + +From: Dan Carpenter + +commit b40b3e9358fbafff6a4ba0f4b9658f6617146f9c upstream. + +We accidentally removed the check for negative returns +without considering the issue of type promotion. +The "if_version_length" variable is type size_t so if __mei_cl_recv() +returns a negative then "bytes_recv" is type promoted +to a high positive value and treated as success. + +Cc: +Fixes: 582ab27a063a ("mei: bus: fix received data size check in NFC fixup") +Signed-off-by: Dan Carpenter +Signed-off-by: Tomas Winkler +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/misc/mei/bus-fixup.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/misc/mei/bus-fixup.c ++++ b/drivers/misc/mei/bus-fixup.c +@@ -267,7 +267,7 @@ static int mei_nfc_if_version(struct mei + + ret = 0; + bytes_recv = __mei_cl_recv(cl, (u8 *)reply, if_version_length, 0); +- if (bytes_recv < if_version_length) { ++ if (bytes_recv < 0 || bytes_recv < if_version_length) { + dev_err(bus->dev, "Could not read IF version\n"); + ret = -EIO; + goto err; diff --git a/queue-4.14/net-ipv6-prevent-use-after-free-in-ip6_route_mpath_notify.patch b/queue-4.14/net-ipv6-prevent-use-after-free-in-ip6_route_mpath_notify.patch new file mode 100644 index 00000000000..257c62a9f44 --- /dev/null +++ b/queue-4.14/net-ipv6-prevent-use-after-free-in-ip6_route_mpath_notify.patch @@ -0,0 +1,110 @@ +From f7225172f25aaf0dfd9ad65f05be8da5d6108b12 Mon Sep 17 00:00:00 2001 +From: David Ahern +Date: Mon, 4 Jun 2018 13:41:42 -0700 +Subject: net/ipv6: prevent use after free in ip6_route_mpath_notify + +From: David Ahern + +commit f7225172f25aaf0dfd9ad65f05be8da5d6108b12 upstream. + +syzbot reported a use-after-free: + +BUG: KASAN: use-after-free in ip6_route_mpath_notify+0xe9/0x100 net/ipv6/route.c:4180 +Read of size 4 at addr ffff8801bf789cf0 by task syz-executor756/4555 + +CPU: 1 PID: 4555 Comm: syz-executor756 Not tainted 4.17.0-rc7+ #78 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 +Call Trace: + __dump_stack lib/dump_stack.c:77 [inline] + dump_stack+0x1b9/0x294 lib/dump_stack.c:113 + print_address_description+0x6c/0x20b mm/kasan/report.c:256 + kasan_report_error mm/kasan/report.c:354 [inline] + kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412 + __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 + ip6_route_mpath_notify+0xe9/0x100 net/ipv6/route.c:4180 + ip6_route_multipath_add+0x615/0x1910 net/ipv6/route.c:4303 + inet6_rtm_newroute+0xe3/0x160 net/ipv6/route.c:4391 + ... + +Allocated by task 4555: + save_stack+0x43/0xd0 mm/kasan/kasan.c:448 + set_track mm/kasan/kasan.c:460 [inline] + kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553 + kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 + kmem_cache_alloc+0x12e/0x760 mm/slab.c:3554 + dst_alloc+0xbb/0x1d0 net/core/dst.c:104 + __ip6_dst_alloc+0x35/0xa0 net/ipv6/route.c:361 + ip6_dst_alloc+0x29/0xb0 net/ipv6/route.c:376 + ip6_route_info_create+0x4d4/0x3a30 net/ipv6/route.c:2834 + ip6_route_multipath_add+0xc7e/0x1910 net/ipv6/route.c:4240 + inet6_rtm_newroute+0xe3/0x160 net/ipv6/route.c:4391 + ... + +Freed by task 4555: + save_stack+0x43/0xd0 mm/kasan/kasan.c:448 + set_track mm/kasan/kasan.c:460 [inline] + __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521 + kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 + __cache_free mm/slab.c:3498 [inline] + kmem_cache_free+0x86/0x2d0 mm/slab.c:3756 + dst_destroy+0x267/0x3c0 net/core/dst.c:140 + dst_release_immediate+0x71/0x9e net/core/dst.c:205 + fib6_add+0xa40/0x1650 net/ipv6/ip6_fib.c:1305 + __ip6_ins_rt+0x6c/0x90 net/ipv6/route.c:1011 + ip6_route_multipath_add+0x513/0x1910 net/ipv6/route.c:4267 + inet6_rtm_newroute+0xe3/0x160 net/ipv6/route.c:4391 + ... + +The problem is that rt_last can point to a deleted route if the insert +fails. + +One reproducer is to insert a route and then add a multipath route that +has a duplicate nexthop.e.g,: + $ ip -6 ro add vrf red 2001:db8:101::/64 nexthop via 2001:db8:1::2 + $ ip -6 ro append vrf red 2001:db8:101::/64 nexthop via 2001:db8:1::4 nexthop via 2001:db8:1::2 + +Fix by not setting rt_last until the it is verified the insert succeeded. + +Backport Note: +- Upstream has replaced rt6_info usage with fib6_info in 8d1c802b281 +("net/ipv6: Flip FIB entries to fib6_info") +- fib6_info_release was introduced upstream in 93531c674315 +("net/ipv6: separate handling of FIB entries from dst based routes"), +but is not present in stable kernels; 4.14.y relies on dst_release/ +ip6_rt_put/dst_release_immediate. + +Fixes: 3b1137fe7482 ("net: ipv6: Change notifications for multipath add to RTA_MULTIPATH") +Cc: Eric Dumazet +Reported-by: syzbot +Signed-off-by: David Ahern +Reviewed-by: Eric Dumazet +Signed-off-by: David S. Miller +Signed-off-by: Zubin Mithra +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/route.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/net/ipv6/route.c ++++ b/net/ipv6/route.c +@@ -3239,11 +3239,16 @@ static int ip6_route_multipath_add(struc + + err_nh = NULL; + list_for_each_entry(nh, &rt6_nh_list, next) { +- rt_last = nh->rt6_info; + err = __ip6_ins_rt(nh->rt6_info, info, &nh->mxc, extack); +- /* save reference to first route for notification */ +- if (!rt_notif && !err) +- rt_notif = nh->rt6_info; ++ ++ if (!err) { ++ /* save reference to last route successfully inserted */ ++ rt_last = nh->rt6_info; ++ ++ /* save reference to first route for notification */ ++ if (!rt_notif) ++ rt_notif = nh->rt6_info; ++ } + + /* nh->rt6_info is used or freed at this point, reset to NULL*/ + nh->rt6_info = NULL; diff --git a/queue-4.14/partial-revert-e1000e-avoid-receiver-overrun-interrupt-bursts.patch b/queue-4.14/partial-revert-e1000e-avoid-receiver-overrun-interrupt-bursts.patch new file mode 100644 index 00000000000..5f57f9ca937 --- /dev/null +++ b/queue-4.14/partial-revert-e1000e-avoid-receiver-overrun-interrupt-bursts.patch @@ -0,0 +1,76 @@ +From 1f0ea19722ef9dfa229a9540f70b8d1c34a98a6a Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Thu, 8 Feb 2018 15:47:12 +0900 +Subject: Partial revert "e1000e: Avoid receiver overrun interrupt bursts" + +From: Benjamin Poirier + +commit 1f0ea19722ef9dfa229a9540f70b8d1c34a98a6a upstream. + +This partially reverts commit 4aea7a5c5e940c1723add439f4088844cd26196d. + +We keep the fix for the first part of the problem (1) described in the log +of that commit, that is to read ICR in the other interrupt handler. We +remove the fix for the second part of the problem (2), Other interrupt +throttling. + +Bursts of "Other" interrupts may once again occur during rxo (receive +overflow) traffic conditions. This is deemed acceptable in the interest of +avoiding unforeseen fallout from changes that are not strictly necessary. +As discussed, the e1000e driver should be in "maintenance mode". + +Link: https://www.spinics.net/lists/netdev/msg480675.html +Signed-off-by: Benjamin Poirier +Acked-by: Alexander Duyck +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Cc: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/intel/e1000e/netdev.c | 16 ++-------------- + 1 file changed, 2 insertions(+), 14 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -1911,21 +1911,10 @@ static irqreturn_t e1000_msix_other(int + struct e1000_adapter *adapter = netdev_priv(netdev); + struct e1000_hw *hw = &adapter->hw; + u32 icr; +- bool enable = true; + + icr = er32(ICR); + ew32(ICR, E1000_ICR_OTHER); + +- if (icr & E1000_ICR_RXO) { +- ew32(ICR, E1000_ICR_RXO); +- enable = false; +- /* napi poll will re-enable Other, make sure it runs */ +- if (napi_schedule_prep(&adapter->napi)) { +- adapter->total_rx_bytes = 0; +- adapter->total_rx_packets = 0; +- __napi_schedule(&adapter->napi); +- } +- } + if (icr & E1000_ICR_LSC) { + ew32(ICR, E1000_ICR_LSC); + hw->mac.get_link_status = true; +@@ -1934,7 +1923,7 @@ static irqreturn_t e1000_msix_other(int + mod_timer(&adapter->watchdog_timer, jiffies + 1); + } + +- if (enable && !test_bit(__E1000_DOWN, &adapter->state)) ++ if (!test_bit(__E1000_DOWN, &adapter->state)) + ew32(IMS, E1000_IMS_OTHER); + + return IRQ_HANDLED; +@@ -2704,8 +2693,7 @@ static int e1000e_poll(struct napi_struc + napi_complete_done(napi, work_done); + if (!test_bit(__E1000_DOWN, &adapter->state)) { + if (adapter->msix_entries) +- ew32(IMS, adapter->rx_ring->ims_val | +- E1000_IMS_OTHER); ++ ew32(IMS, adapter->rx_ring->ims_val); + else + e1000_irq_enable(adapter); + } diff --git a/queue-4.14/revert-e1000e-separate-signaling-for-link-check-link-up.patch b/queue-4.14/revert-e1000e-separate-signaling-for-link-check-link-up.patch new file mode 100644 index 00000000000..596fb2861f6 --- /dev/null +++ b/queue-4.14/revert-e1000e-separate-signaling-for-link-check-link-up.patch @@ -0,0 +1,143 @@ +From 3016e0a0c91246e55418825ba9aae271be267522 Mon Sep 17 00:00:00 2001 +From: Benjamin Poirier +Date: Tue, 6 Mar 2018 10:55:52 +0900 +Subject: Revert "e1000e: Separate signaling for link check/link up" + +From: Benjamin Poirier + +commit 3016e0a0c91246e55418825ba9aae271be267522 upstream. + +This reverts commit 19110cfbb34d4af0cdfe14cd243f3b09dc95b013. +This reverts commit 4110e02eb45ea447ec6f5459c9934de0a273fb91. +This reverts commit d3604515c9eda464a92e8e67aae82dfe07fe3c98. + +Commit 19110cfbb34d ("e1000e: Separate signaling for link check/link up") +changed what happens to the link status when there is an error which +happens after "get_link_status = false" in the copper check_for_link +callbacks. Previously, such an error would be ignored and the link +considered up. After that commit, any error implies that the link is down. + +Revert commit 19110cfbb34d ("e1000e: Separate signaling for link check/link +up") and its followups. After reverting, the race condition described in +the log of commit 19110cfbb34d is reintroduced. It may still be triggered +by LSC events but this should keep the link down in case the link is +electrically unstable, as discussed. The race may no longer be +triggered by RXO events because commit 4aea7a5c5e94 ("e1000e: Avoid +receiver overrun interrupt bursts") restored reading icr in the Other +handler. + +Link: https://lkml.org/lkml/2018/3/1/789 +Signed-off-by: Benjamin Poirier +Acked-by: Alexander Duyck +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher +Cc: Ben Hutchings +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/intel/e1000e/ich8lan.c | 13 ++++--------- + drivers/net/ethernet/intel/e1000e/mac.c | 13 ++++--------- + drivers/net/ethernet/intel/e1000e/netdev.c | 2 +- + 3 files changed, 9 insertions(+), 19 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c ++++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c +@@ -1367,9 +1367,6 @@ out: + * Checks to see of the link status of the hardware has changed. If a + * change in link status has been detected, then we read the PHY registers + * to get the current speed/duplex if link exists. +- * +- * Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link +- * up). + **/ + static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) + { +@@ -1385,7 +1382,7 @@ static s32 e1000_check_for_copper_link_i + * Change or Rx Sequence Error interrupt. + */ + if (!mac->get_link_status) +- return 1; ++ return 0; + + /* First we want to see if the MII Status Register reports + * link. If so, then we want to get the current speed/duplex +@@ -1602,7 +1599,7 @@ static s32 e1000_check_for_copper_link_i + * we have already determined whether we have link or not. + */ + if (!mac->autoneg) +- return 1; ++ return -E1000_ERR_CONFIG; + + /* Auto-Neg is enabled. Auto Speed Detection takes care + * of MAC speed/duplex configuration. So we only need to +@@ -1616,12 +1613,10 @@ static s32 e1000_check_for_copper_link_i + * different link partner. + */ + ret_val = e1000e_config_fc_after_link_up(hw); +- if (ret_val) { ++ if (ret_val) + e_dbg("Error configuring flow control\n"); +- return ret_val; +- } + +- return 1; ++ return ret_val; + } + + static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) +--- a/drivers/net/ethernet/intel/e1000e/mac.c ++++ b/drivers/net/ethernet/intel/e1000e/mac.c +@@ -410,9 +410,6 @@ void e1000e_clear_hw_cntrs_base(struct e + * Checks to see of the link status of the hardware has changed. If a + * change in link status has been detected, then we read the PHY registers + * to get the current speed/duplex if link exists. +- * +- * Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link +- * up). + **/ + s32 e1000e_check_for_copper_link(struct e1000_hw *hw) + { +@@ -426,7 +423,7 @@ s32 e1000e_check_for_copper_link(struct + * Change or Rx Sequence Error interrupt. + */ + if (!mac->get_link_status) +- return 1; ++ return 0; + + /* First we want to see if the MII Status Register reports + * link. If so, then we want to get the current speed/duplex +@@ -450,7 +447,7 @@ s32 e1000e_check_for_copper_link(struct + * we have already determined whether we have link or not. + */ + if (!mac->autoneg) +- return 1; ++ return -E1000_ERR_CONFIG; + + /* Auto-Neg is enabled. Auto Speed Detection takes care + * of MAC speed/duplex configuration. So we only need to +@@ -464,12 +461,10 @@ s32 e1000e_check_for_copper_link(struct + * different link partner. + */ + ret_val = e1000e_config_fc_after_link_up(hw); +- if (ret_val) { ++ if (ret_val) + e_dbg("Error configuring flow control\n"); +- return ret_val; +- } + +- return 1; ++ return ret_val; + } + + /** +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -5089,7 +5089,7 @@ static bool e1000e_has_link(struct e1000 + case e1000_media_type_copper: + if (hw->mac.get_link_status) { + ret_val = hw->mac.ops.check_for_link(hw); +- link_active = ret_val > 0; ++ link_active = !hw->mac.get_link_status; + } else { + link_active = true; + } diff --git a/queue-4.14/series b/queue-4.14/series index 6d52d4c0649..cd85ad8001e 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -157,3 +157,17 @@ gpiolib-respect-error-code-of-get_direction.patch pinctrl-msm-fix-msm_config_group_get-to-be-compliant.patch pinctrl-qcom-spmi-gpio-fix-pmic_gpio_config_get-to-be-compliant.patch clk-tegra-bpmp-don-t-crash-when-a-clock-fails-to-register.patch +mei-bus-type-promotion-bug-in-mei_nfc_if_version.patch +earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch +earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch +asoc-samsung-i2s-fix-error-handling-path-in-i2s_set_sysclk.patch +asoc-samsung-fix-invalid-argument-when-devm_gpiod_get-is-called.patch +drm-i915-apply-the-gtt-write-flush-for-all-llc-machines.patch +net-ipv6-prevent-use-after-free-in-ip6_route_mpath_notify.patch +e1000e-remove-other-from-eiac.patch +partial-revert-e1000e-avoid-receiver-overrun-interrupt-bursts.patch +e1000e-fix-queue-interrupt-re-raising-in-other-interrupt.patch +e1000e-avoid-missed-interrupts-following-icr-read.patch +revert-e1000e-separate-signaling-for-link-check-link-up.patch +e1000e-fix-link-check-race-condition.patch +e1000e-fix-check_for_link-return-value-with-autoneg-off.patch