From: Greg Kroah-Hartman Date: Sun, 12 Nov 2017 09:08:54 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v3.18.81~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bfcb5a0ae0084dc66e91efe05b6c8439bd028f6a;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: can-c_can-don-t-indicate-triple-sampling-support-for-d_can.patch can-sun4i-handle-overrun-in-rx-fifo.patch --- 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 index 00000000000..dd1e9caf419 --- /dev/null +++ b/queue-4.4/can-c_can-don-t-indicate-triple-sampling-support-for-d_can.patch @@ -0,0 +1,45 @@ +From fb5f0b3ef69b95e665e4bbe8a3de7201f09f1071 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Richard=20Sch=C3=BCtz?= +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 + +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 +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..1078ce50922 --- /dev/null +++ b/queue-4.4/can-sun4i-handle-overrun-in-rx-fifo.patch @@ -0,0 +1,49 @@ +From 4dcf924c2eda0c47a5c53b7703e3dc65ddaa8920 Mon Sep 17 00:00:00 2001 +From: Gerhard Bertelsmann +Date: Mon, 6 Nov 2017 18:16:56 +0100 +Subject: can: sun4i: handle overrun in RX FIFO + +From: Gerhard Bertelsmann + +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 +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + 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); diff --git a/queue-4.4/series b/queue-4.4/series index 5b3063ac9c2..d5fb382268c 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -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