]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.2-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Oct 2015 00:40:19 +0000 (17:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Oct 2015 00:40:19 +0000 (17:40 -0700)
added patches:
e1000e-fix-tight-loop-implementation-of-systime-read-algorithm.patch
serial-atmel-fix-error-path-of-probe-function.patch

queue-4.2/e1000e-fix-tight-loop-implementation-of-systime-read-algorithm.patch [new file with mode: 0644]
queue-4.2/serial-atmel-fix-error-path-of-probe-function.patch [new file with mode: 0644]
queue-4.2/series

diff --git a/queue-4.2/e1000e-fix-tight-loop-implementation-of-systime-read-algorithm.patch b/queue-4.2/e1000e-fix-tight-loop-implementation-of-systime-read-algorithm.patch
new file mode 100644 (file)
index 0000000..5298a8f
--- /dev/null
@@ -0,0 +1,66 @@
+From 37b12910dd11d9ab969f2c310dc9160b7f3e3405 Mon Sep 17 00:00:00 2001
+From: Raanan Avargil <raanan.avargil@intel.com>
+Date: Sun, 19 Jul 2015 16:33:20 +0300
+Subject: e1000e: Fix tight loop implementation of systime read algorithm
+
+From: Raanan Avargil <raanan.avargil@intel.com>
+
+commit 37b12910dd11d9ab969f2c310dc9160b7f3e3405 upstream.
+
+Change the algorithm. Read systimel twice and check for overflow.
+If there was no overflow, use the first value.
+If there was an overflow, read systimeh again and use the second
+systimel value.
+
+Signed-off-by: Raanan Avargil <raanan.avargil@intel.com>
+Tested-by: Aaron Brown <aaron.f.brown@intel.com>
+Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
+Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/ethernet/intel/e1000e/netdev.c |   31 +++++++++++++++++++----------
+ 1 file changed, 21 insertions(+), 10 deletions(-)
+
+--- a/drivers/net/ethernet/intel/e1000e/netdev.c
++++ b/drivers/net/ethernet/intel/e1000e/netdev.c
+@@ -4280,18 +4280,29 @@ static cycle_t e1000e_cyclecounter_read(
+       struct e1000_adapter *adapter = container_of(cc, struct e1000_adapter,
+                                                    cc);
+       struct e1000_hw *hw = &adapter->hw;
++      u32 systimel_1, systimel_2, systimeh;
+       cycle_t systim, systim_next;
+-      /* SYSTIMH latching upon SYSTIML read does not work well. To fix that
+-       * we don't want to allow overflow of SYSTIML and a change to SYSTIMH
+-       * to occur between reads, so if we read a vale close to overflow, we
+-       * wait for overflow to occur and read both registers when its safe.
++      /* SYSTIMH latching upon SYSTIML read does not work well.
++       * This means that if SYSTIML overflows after we read it but before
++       * we read SYSTIMH, the value of SYSTIMH has been incremented and we
++       * will experience a huge non linear increment in the systime value
++       * to fix that we test for overflow and if true, we re-read systime.
+        */
+-      u32 systim_overflow_latch_fix = 0x3FFFFFFF;
+-
+-      do {
+-              systim = (cycle_t)er32(SYSTIML);
+-      } while (systim > systim_overflow_latch_fix);
+-      systim |= (cycle_t)er32(SYSTIMH) << 32;
++      systimel_1 = er32(SYSTIML);
++      systimeh = er32(SYSTIMH);
++      systimel_2 = er32(SYSTIML);
++      /* Check for overflow. If there was no overflow, use the values */
++      if (systimel_1 < systimel_2) {
++              systim = (cycle_t)systimel_1;
++              systim |= (cycle_t)systimeh << 32;
++      } else {
++              /* There was an overflow, read again SYSTIMH, and use
++               * systimel_2
++               */
++              systimeh = er32(SYSTIMH);
++              systim = (cycle_t)systimel_2;
++              systim |= (cycle_t)systimeh << 32;
++      }
+       if ((hw->mac.type == e1000_82574) || (hw->mac.type == e1000_82583)) {
+               u64 incvalue, time_delta, rem, temp;
diff --git a/queue-4.2/serial-atmel-fix-error-path-of-probe-function.patch b/queue-4.2/serial-atmel-fix-error-path-of-probe-function.patch
new file mode 100644 (file)
index 0000000..bf13dfc
--- /dev/null
@@ -0,0 +1,41 @@
+From 8f1bd8f2ad2358d6a88c115481ff3e69817d1bde Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Wed, 23 Sep 2015 08:57:40 +0200
+Subject: serial: atmel: fix error path of probe function
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+
+commit 8f1bd8f2ad2358d6a88c115481ff3e69817d1bde upstream.
+
+If atmel_init_gpios fails the port has already been marked as busy (in
+line 2629), so this must be undone in the error path.
+
+This bug was introduced because I created the patch that finally
+became 722ccf416ac2 ("serial: atmel: fix error handling when
+mctrl_gpio_init fails") on top of 3.19 which didn't have commit
+6fbb9bdf0f3f ("tty/serial: at91: fix error handling in
+atmel_serial_probe()") yet.
+
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Fixes: 722ccf416ac2 ("serial: atmel: fix error handling when mctrl_gpio_init fails")
+Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/tty/serial/atmel_serial.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/atmel_serial.c
++++ b/drivers/tty/serial/atmel_serial.c
+@@ -2641,7 +2641,7 @@ static int atmel_serial_probe(struct pla
+       ret = atmel_init_gpios(port, &pdev->dev);
+       if (ret < 0) {
+               dev_err(&pdev->dev, "Failed to initialize GPIOs.");
+-              goto err;
++              goto err_clear_bit;
+       }
+       ret = atmel_init_port(port, pdev);
index 289877575b40345321b2f8e0547d1f90c8786f4c..dd0d08deea8138c23d9530c6a255a9949f8a27c3 100644 (file)
@@ -250,3 +250,5 @@ staging-speakup-fix-speakup-r-regression.patch
 tty-fix-stall-caused-by-missing-memory-barrier-in-drivers-tty-n_tty.c.patch
 drivers-tty-require-read-access-for-controlling-terminal.patch
 serial-8250-add-uart_config-entry-for-port_rt2880.patch
+serial-atmel-fix-error-path-of-probe-function.patch
+e1000e-fix-tight-loop-implementation-of-systime-read-algorithm.patch