From: Greg Kroah-Hartman Date: Tue, 30 Jun 2015 21:07:58 +0000 (-0700) Subject: 4.1-stable patches X-Git-Tag: v3.10.83~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d722d86cbddfbe6442cbb548a548344d1e3e441a;p=thirdparty%2Fkernel%2Fstable-queue.git 4.1-stable patches added patches: can-fix-loss-of-can-frames-in-raw_rcv.patch --- diff --git a/queue-4.1/can-fix-loss-of-can-frames-in-raw_rcv.patch b/queue-4.1/can-fix-loss-of-can-frames-in-raw_rcv.patch new file mode 100644 index 00000000000..ba857e91cdf --- /dev/null +++ b/queue-4.1/can-fix-loss-of-can-frames-in-raw_rcv.patch @@ -0,0 +1,104 @@ +From 36c01245eb8046c16eee6431e7dbfbb302635fa8 Mon Sep 17 00:00:00 2001 +From: Oliver Hartkopp +Date: Sun, 21 Jun 2015 18:50:44 +0200 +Subject: can: fix loss of CAN frames in raw_rcv + +From: Oliver Hartkopp + +commit 36c01245eb8046c16eee6431e7dbfbb302635fa8 upstream. + +As reported by Manfred Schlaegl here + + http://marc.info/?l=linux-netdev&m=143482089824232&w=2 + +commit 514ac99c64b "can: fix multiple delivery of a single CAN frame for +overlapping CAN filters" requires the skb->tstamp to be set to check for +identical CAN skbs. + +As net timestamping is influenced by several players (netstamp_needed and +netdev_tstamp_prequeue) Manfred missed a proper timestamp which leads to +CAN frame loss. + +As skb timestamping became now mandatory for CAN related skbs this patch +makes sure that received CAN skbs always have a proper timestamp set. +Maybe there's a better solution in the future but this patch fixes the +CAN frame loss so far. + +Reported-by: Manfred Schlaegl +Signed-off-by: Oliver Hartkopp +Signed-off-by: Marc Kleine-Budde +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/can/dev.c | 5 +++++ + drivers/net/can/slcan.c | 1 + + drivers/net/can/vcan.c | 3 +++ + net/can/af_can.c | 6 +++++- + 4 files changed, 14 insertions(+), 1 deletion(-) + +--- a/drivers/net/can/dev.c ++++ b/drivers/net/can/dev.c +@@ -440,6 +440,9 @@ unsigned int can_get_echo_skb(struct net + struct can_frame *cf = (struct can_frame *)skb->data; + u8 dlc = cf->can_dlc; + ++ if (!(skb->tstamp.tv64)) ++ __net_timestamp(skb); ++ + netif_rx(priv->echo_skb[idx]); + priv->echo_skb[idx] = NULL; + +@@ -575,6 +578,7 @@ struct sk_buff *alloc_can_skb(struct net + if (unlikely(!skb)) + return NULL; + ++ __net_timestamp(skb); + skb->protocol = htons(ETH_P_CAN); + skb->pkt_type = PACKET_BROADCAST; + skb->ip_summed = CHECKSUM_UNNECESSARY; +@@ -603,6 +607,7 @@ struct sk_buff *alloc_canfd_skb(struct n + if (unlikely(!skb)) + return NULL; + ++ __net_timestamp(skb); + skb->protocol = htons(ETH_P_CANFD); + skb->pkt_type = PACKET_BROADCAST; + skb->ip_summed = CHECKSUM_UNNECESSARY; +--- a/drivers/net/can/slcan.c ++++ b/drivers/net/can/slcan.c +@@ -207,6 +207,7 @@ static void slc_bump(struct slcan *sl) + if (!skb) + return; + ++ __net_timestamp(skb); + skb->dev = sl->dev; + skb->protocol = htons(ETH_P_CAN); + skb->pkt_type = PACKET_BROADCAST; +--- a/drivers/net/can/vcan.c ++++ b/drivers/net/can/vcan.c +@@ -78,6 +78,9 @@ static void vcan_rx(struct sk_buff *skb, + skb->dev = dev; + skb->ip_summed = CHECKSUM_UNNECESSARY; + ++ if (!(skb->tstamp.tv64)) ++ __net_timestamp(skb); ++ + netif_rx_ni(skb); + } + +--- a/net/can/af_can.c ++++ b/net/can/af_can.c +@@ -310,8 +310,12 @@ int can_send(struct sk_buff *skb, int lo + return err; + } + +- if (newskb) ++ if (newskb) { ++ if (!(newskb->tstamp.tv64)) ++ __net_timestamp(newskb); ++ + netif_rx_ni(newskb); ++ } + + /* update statistics */ + can_stats.tx_frames++; diff --git a/queue-4.1/series b/queue-4.1/series index 70d0679db72..5c18328d31e 100644 --- a/queue-4.1/series +++ b/queue-4.1/series @@ -1,3 +1,4 @@ arm-dts-sunxi-adjust-touchscreen-compatible-for-sun5i-and-later.patch arm-clk-imx6q-refine-sata-s-parent.patch kvm-nsvm-check-for-nrips-support-before-updating-control-field.patch +can-fix-loss-of-can-frames-in-raw_rcv.patch