]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Nov 2017 09:08:54 +0000 (10:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Nov 2017 09:08:54 +0000 (10:08 +0100)
added patches:
can-c_can-don-t-indicate-triple-sampling-support-for-d_can.patch
can-sun4i-handle-overrun-in-rx-fifo.patch

queue-4.4/can-c_can-don-t-indicate-triple-sampling-support-for-d_can.patch [new file with mode: 0644]
queue-4.4/can-sun4i-handle-overrun-in-rx-fifo.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/can-c_can-don-t-indicate-triple-sampling-support-for-d_can.patch b/queue-4.4/can-c_can-don-t-indicate-triple-sampling-support-for-d_can.patch
new file mode 100644 (file)
index 0000000..dd1e9ca
--- /dev/null
@@ -0,0 +1,45 @@
+From fb5f0b3ef69b95e665e4bbe8a3de7201f09f1071 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Richard=20Sch=C3=BCtz?= <rschuetz@uni-koblenz.de>
+Date: Sun, 29 Oct 2017 13:03:22 +0100
+Subject: can: c_can: don't indicate triple sampling support for D_CAN
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Richard Schütz <rschuetz@uni-koblenz.de>
+
+commit fb5f0b3ef69b95e665e4bbe8a3de7201f09f1071 upstream.
+
+The D_CAN controller doesn't provide a triple sampling mode, so don't set
+the CAN_CTRLMODE_3_SAMPLES flag in ctrlmode_supported. Currently enabling
+triple sampling is a no-op.
+
+Signed-off-by: Richard Schütz <rschuetz@uni-koblenz.de>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/can/c_can/c_can_pci.c      |    1 -
+ drivers/net/can/c_can/c_can_platform.c |    1 -
+ 2 files changed, 2 deletions(-)
+
+--- a/drivers/net/can/c_can/c_can_pci.c
++++ b/drivers/net/can/c_can/c_can_pci.c
+@@ -178,7 +178,6 @@ static int c_can_pci_probe(struct pci_de
+               break;
+       case BOSCH_D_CAN:
+               priv->regs = reg_map_d_can;
+-              priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
+               break;
+       default:
+               ret = -EINVAL;
+--- a/drivers/net/can/c_can/c_can_platform.c
++++ b/drivers/net/can/c_can/c_can_platform.c
+@@ -320,7 +320,6 @@ static int c_can_plat_probe(struct platf
+               break;
+       case BOSCH_D_CAN:
+               priv->regs = reg_map_d_can;
+-              priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
+               priv->read_reg = c_can_plat_read_reg_aligned_to_16bit;
+               priv->write_reg = c_can_plat_write_reg_aligned_to_16bit;
+               priv->read_reg32 = d_can_plat_read_reg32;
diff --git a/queue-4.4/can-sun4i-handle-overrun-in-rx-fifo.patch b/queue-4.4/can-sun4i-handle-overrun-in-rx-fifo.patch
new file mode 100644 (file)
index 0000000..1078ce5
--- /dev/null
@@ -0,0 +1,49 @@
+From 4dcf924c2eda0c47a5c53b7703e3dc65ddaa8920 Mon Sep 17 00:00:00 2001
+From: Gerhard Bertelsmann <info@gerhard-bertelsmann.de>
+Date: Mon, 6 Nov 2017 18:16:56 +0100
+Subject: can: sun4i: handle overrun in RX FIFO
+
+From: Gerhard Bertelsmann <info@gerhard-bertelsmann.de>
+
+commit 4dcf924c2eda0c47a5c53b7703e3dc65ddaa8920 upstream.
+
+SUN4Is CAN IP has a 64 byte deep FIFO buffer. If the buffer is not
+drained fast enough (overrun) it's getting mangled. Already received
+frames are dropped - the data can't be restored.
+
+Signed-off-by: Gerhard Bertelsmann <info@gerhard-bertelsmann.de>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/can/sun4i_can.c |   12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/can/sun4i_can.c
++++ b/drivers/net/can/sun4i_can.c
+@@ -539,6 +539,13 @@ static int sun4i_can_err(struct net_devi
+               }
+               stats->rx_over_errors++;
+               stats->rx_errors++;
++
++              /* reset the CAN IP by entering reset mode
++               * ignoring timeout error
++               */
++              set_reset_mode(dev);
++              set_normal_mode(dev);
++
+               /* clear bit */
+               sun4i_can_write_cmdreg(priv, SUN4I_CMD_CLEAR_OR_FLAG);
+       }
+@@ -653,8 +660,9 @@ static irqreturn_t sun4i_can_interrupt(i
+                       netif_wake_queue(dev);
+                       can_led_event(dev, CAN_LED_EVENT_TX);
+               }
+-              if (isrc & SUN4I_INT_RBUF_VLD) {
+-                      /* receive interrupt */
++              if ((isrc & SUN4I_INT_RBUF_VLD) &&
++                  !(isrc & SUN4I_INT_DATA_OR)) {
++                      /* receive interrupt - don't read if overrun occurred */
+                       while (status & SUN4I_STA_RBUF_RDY) {
+                               /* RX buffer is not empty */
+                               sun4i_can_rx(dev);
index 5b3063ac9c27e6db522d44ede98124acbd92e04a..d5fb382268c3f1a5e8b1d95292b4d5c1e25f3ec0 100644 (file)
@@ -50,3 +50,5 @@ mips-ar7-ensure-that-serial-ports-are-properly-set-up.patch
 input-elan_i2c-add-elan060c-to-the-acpi-table.patch
 drm-vmwgfx-fix-ubuntu-17.10-wayland-black-screen-issue.patch
 rbd-use-gfp_noio-for-parent-stat-and-data-requests.patch
+can-sun4i-handle-overrun-in-rx-fifo.patch
+can-c_can-don-t-indicate-triple-sampling-support-for-d_can.patch