projects/linux·commit c5dfd654

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

c5dfd654 · Linus Torvalds <[email protected]> · 2015-07-22 14:45:25 -07:00

Pull networking fixes from David Miller:

 1) Don't use shared bluetooth antenna in iwlwifi driver for management
    frames, from Emmanuel Grumbach.

 2) Fix device ID check in ath9k driver, from Felix Fietkau.

 3) Off by one in xen-netback BUG checks, from Dan Carpenter.

 4) Fix IFLA_VF_PORT netlink attribute validation, from Daniel Borkmann.

 5) Fix races in setting peeked bit flag in SKBs during datagram
    receive.  If it's shared we have to clone it otherwise the value can
    easily be corrupted.  Fix from Herbert Xu.

 6) Revert fec clock handling change, causes regressions.  From Fabio
    Estevam.

 7) Fix use after free in fq_codel and sfq packet schedulers, from WANG
    Cong.

 8) ipvlan bug fixes (memory leaks, missing rcu_dereference_bh, etc.)
    from WANG Cong and Konstantin Khlebnikov.

 9) Memory leak in act_bpf packet action, from Alexei Starovoitov.

10) ARM bpf JIT bug fixes from Nicolas Schichan.

11) Fix backwards compat of ANY_LAYOUT in virtio_net driver, from
    Michael S Tsirkin.

12) Destruction of bond with different ARP header types not handled
    correctly, fix from Nikolay Aleksandrov.

13) Revert GRO receive support in ipv6 SIT tunnel driver, causes
    regressions because the GRO packets created cannot be processed
    properly on the GSO side if we forward the frame.  From Herbert Xu.

14) TCCR update race and other fixes to ravb driver from Sergei
    Shtylyov.

15) Fix SKB leaks in caif_queue_rcv_skb(), from Eric Dumazet.

16) Fix panics on packet scheduler filter replace, from Daniel Borkmann.

17) Make sure AF_PACKET sees properly IP headers in defragmented frames
    (via PACKET_FANOUT_FLAG_DEFRAG option), from Edward Hyunkoo Jee.

18) AF_NETLINK cannot hold mutex in RCU callback, fix from Florian
    Westphal.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (84 commits)
  ravb: fix ring memory allocation
  net: phy: dp83867: Fix warning check for setting the internal delay
  openvswitch: allocate nr_node_ids flow_stats instead of num_possible_nodes
  netlink: don't hold mutex in rcu callback when releasing mmapd ring
  ARM: net: fix vlan access instructions in ARM JIT.
  ARM: net: handle negative offsets in BPF JIT.
  ARM: net: fix condition for load_order > 0 when translating load instructions.
  tcp: suppress a division by zero warning
  drivers: net: cpsw: remove tx event processing in rx napi poll
  inet: frags: fix defragmented packet's IP header for af_packet
  net: mvneta: fix refilling for Rx DMA buffers
  stmmac: fix setting of driver data in stmmac_dvr_probe
  sched: cls_flow: fix panic on filter replace
  sched: cls_flower: fix panic on filter replace
  sched: cls_bpf: fix panic on filter replace
  net/mdio: fix mdio_bus_match for c45 PHY
  net: ratelimit warnings about dst entry refcount underflow or overflow
  caif: fix leaks and race in caif_queue_rcv_skb()
  qmi_wwan: add the second QMI/network interface for Sierra Wireless MC7305/MC7355
  ravb: fix race updating TCCR
  ...
Commit
c5dfd654d0ec0a28fe81e7bd4d4fd984a9855e09
Parents
5a5ca73a · d8b48911

Merge commit. Changes below are compared with the first parent: 5a5ca73a.

Changes

79 files changed · +714 −811

FileStatusAddDelContent
arch/arm/net/bpf_jit_32.cmodified+44−13View file
drivers/bluetooth/btbcm.cmodified+5−6View file
drivers/isdn/gigaset/ser-gigaset.cmodified+10−25View file
drivers/net/bonding/bond_main.cmodified+31−3View file
drivers/net/can/at91_can.cmodified+4−4View file
drivers/net/can/bfin_can.cmodified+2−4View file
drivers/net/can/cc770/cc770.cmodified+2−2View file
drivers/net/can/flexcan.cmodified+3−4View file
drivers/net/can/grcan.cmodified+2−1View file
drivers/net/can/sja1000/sja1000.cmodified+2−4View file
drivers/net/can/slcan.cmodified+1−1View file
drivers/net/can/spi/mcp251x.cmodified+8−9View file
drivers/net/can/ti_hecc.cmodified+1−1View file
drivers/net/can/usb/ems_usb.cmodified+2−4View file
drivers/net/can/usb/esd_usb2.cmodified+2−4View file
drivers/net/can/usb/peak_usb/pcan_usb.cmodified+3−4View file
drivers/net/can/usb/peak_usb/pcan_usb_pro.cmodified+2−2View file
drivers/net/can/usb/usb_8dev.cmodified+2−4View file
drivers/net/dsa/bcm_sf2.cmodified+13−2View file
drivers/net/dsa/mv88e6xxx.cmodified+1−1View file
drivers/net/ethernet/freescale/fec_main.cmodified+13−75View file
drivers/net/ethernet/marvell/mvneta.cmodified+10−12View file
drivers/net/ethernet/renesas/ravb_main.cmodified+38−36View file
drivers/net/ethernet/stmicro/stmmac/stmmac_main.cmodified+1−1View file
drivers/net/ethernet/ti/cpsw.cmodified+3−6View file
drivers/net/ethernet/ti/netcp_core.cmodified+1−1View file
drivers/net/ipvlan/ipvlan.hmodified+6−3View file
drivers/net/ipvlan/ipvlan_core.cmodified+2−4View file
drivers/net/ipvlan/ipvlan_main.cmodified+19−23View file
drivers/net/phy/dp83867.cmodified+1−1View file
drivers/net/phy/mdio_bus.cmodified+17−2View file
drivers/net/usb/qmi_wwan.cmodified+1−0View file
drivers/net/virtio_net.cmodified+2−1View file
drivers/net/wireless/ath/ath9k/hw.cmodified+1−0View file
drivers/net/wireless/iwlwifi/iwl-fh.hmodified+6−0View file
drivers/net/wireless/iwlwifi/iwl-nvm-parse.cmodified+5−7View file
drivers/net/wireless/iwlwifi/mvm/fw-api-scan.hmodified+2−1View file
drivers/net/wireless/iwlwifi/mvm/scan.cmodified+3−0View file
drivers/net/wireless/iwlwifi/mvm/sta.cmodified+2−1View file
drivers/net/wireless/iwlwifi/mvm/time-event.cmodified+1−1View file
drivers/net/wireless/iwlwifi/mvm/tx.cmodified+1−1View file
drivers/net/wireless/iwlwifi/pcie/drv.cmodified+3−2View file
drivers/net/wireless/iwlwifi/pcie/internal.hmodified+8−43View file
drivers/net/wireless/iwlwifi/pcie/rx.cmodified+83−331View file
drivers/net/wireless/iwlwifi/pcie/trans.cmodified+29−23View file
drivers/net/xen-netback/netback.cmodified+3−3View file
include/net/cfg80211.hmodified+17−0View file
include/net/ip.hmodified+1−0View file
net/ax25/ax25_subr.cmodified+1−0View file
net/bridge/br_mdb.cmodified+0−1View file
net/bridge/br_multicast.cmodified+30−7View file
net/caif/caif_socket.cmodified+8−11View file
net/core/datagram.cmodified+47−9View file
net/core/dst.cmodified+3−1View file
net/core/rtnetlink.cmodified+7−4View file
net/ipv4/datagram.cmodified+12−4View file
net/ipv4/inet_hashtables.cmodified+5−6View file
net/ipv4/ip_fragment.cmodified+4−2View file
net/ipv4/tcp_input.cmodified+1−2View file
net/ipv6/datagram.cmodified+15−5View file
net/ipv6/ip6_offload.cmodified+0−2View file
net/mac80211/debugfs_netdev.cmodified+1−0View file
net/mac80211/iface.cmodified+14−11View file
net/mac80211/mesh_plink.cmodified+4−1View file
net/mac80211/pm.cmodified+16−0View file
net/mac80211/tdls.cmodified+3−3View file
net/mac80211/tx.cmodified+3−1View file
net/netlink/af_netlink.cmodified+47−32View file
net/openvswitch/flow_table.cmodified+1−1View file
net/sched/act_bpf.cmodified+3−0View file
net/sched/cls_bpf.cmodified+1−1View file
net/sched/cls_flow.cmodified+3−2View file
net/sched/cls_flower.cmodified+1−1View file
net/sched/sch_fq_codel.cmodified+11−2View file
net/sched/sch_sfq.cmodified+1−1View file
net/wireless/chan.cmodified+34−11View file
net/wireless/nl80211.cmodified+8−6View file
net/wireless/reg.cmodified+4−4View file
net/wireless/trace.hmodified+7−4View file

Only the first 600 diff lines are shown. Download the complete patch.

arch/arm/net/bpf_jit_32.c

View file
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
index 4550d24..c011e22 100644
--- a/arch/arm/net/bpf_jit_32.c
+++ b/arch/arm/net/bpf_jit_32.c
@@ -74,32 +74,52 @@ struct jit_ctx {
int bpf_jit_enable __read_mostly;
-static u64 jit_get_skb_b(struct sk_buff *skb, unsigned offset)
+static inline int call_neg_helper(struct sk_buff *skb, int offset, void *ret,
+ unsigned int size)
+{
+ void *ptr = bpf_internal_load_pointer_neg_helper(skb, offset, size);
+
+ if (!ptr)
+ return -EFAULT;
+ memcpy(ret, ptr, size);
+ return 0;
+}
+
+static u64 jit_get_skb_b(struct sk_buff *skb, int offset)
{
u8 ret;
int err;
- err = skb_copy_bits(skb, offset, &ret, 1);
+ if (offset < 0)
+ err = call_neg_helper(skb, offset, &ret, 1);
+ else
+ err = skb_copy_bits(skb, offset, &ret, 1);
return (u64)err << 32 | ret;
}
-static u64 jit_get_skb_h(struct sk_buff *skb, unsigned offset)
+static u64 jit_get_skb_h(struct sk_buff *skb, int offset)
{
u16 ret;
int err;
- err = skb_copy_bits(skb, offset, &ret, 2);
+ if (offset < 0)
+ err = call_neg_helper(skb, offset, &ret, 2);
+ else
+ err = skb_copy_bits(skb, offset, &ret, 2);
return (u64)err << 32 | ntohs(ret);
}
-static u64 jit_get_skb_w(struct sk_buff *skb, unsigned offset)
+static u64 jit_get_skb_w(struct sk_buff *skb, int offset)
{
u32 ret;
int err;
- err = skb_copy_bits(skb, offset, &ret, 4);
+ if (offset < 0)
+ err = call_neg_helper(skb, offset, &ret, 4);
+ else
+ err = skb_copy_bits(skb, offset, &ret, 4);
return (u64)err << 32 | ntohl(ret);
}
@@ -536,9 +556,6 @@ static int build_body(struct jit_ctx *ctx)
case BPF_LD | BPF_B | BPF_ABS:
load_order = 0;
load:
- /* the interpreter will deal with the negative K */
- if ((int)k < 0)
- return -ENOTSUPP;
emit_mov_i(r_off, k, ctx);
load_common:
ctx->seen |= SEEN_DATA | SEEN_CALL;
@@ -547,12 +564,24 @@ load_common:
emit(ARM_SUB_I(r_scratch, r_skb_hl,
1 << load_order), ctx);
emit(ARM_CMP_R(r_scratch, r_off), ctx);
- condt = ARM_COND_HS;
+ condt = ARM_COND_GE;
} else {
emit(ARM_CMP_R(r_skb_hl, r_off), ctx);
condt = ARM_COND_HI;
}
+ /*
+ * test for negative offset, only if we are
+ * currently scheduled to take the fast
+ * path. this will update the flags so that
+ * the slowpath instruction are ignored if the
+ * offset is negative.
+ *
+ * for loard_order == 0 the HI condition will
+ * make loads at offset 0 take the slow path too.
+ */
+ _emit(condt, ARM_CMP_I(r_off, 0), ctx);
+
_emit(condt, ARM_ADD_R(r_scratch, r_off, r_skb_data),
ctx);
@@ -860,9 +889,11 @@ b_epilogue:
off = offsetof(struct sk_buff, vlan_tci);
emit(ARM_LDRH_I(r_A, r_skb, off), ctx);
if (code == (BPF_ANC | SKF_AD_VLAN_TAG))
- OP_IMM3(ARM_AND, r_A, r_A, VLAN_VID_MASK, ctx);
- else
- OP_IMM3(ARM_AND, r_A, r_A, VLAN_TAG_PRESENT, ctx);
+ OP_IMM3(ARM_AND, r_A, r_A, ~VLAN_TAG_PRESENT, ctx);
+ else {
+ OP_IMM3(ARM_LSR, r_A, r_A, 12, ctx);
+ OP_IMM3(ARM_AND, r_A, r_A, 0x1, ctx);
+ }
break;
case BPF_ANC | SKF_AD_QUEUE:
ctx->seen |= SEEN_SKB;

drivers/bluetooth/btbcm.c

View file
diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
index 1e1a432..9ceb8ac 100644
--- a/drivers/bluetooth/btbcm.c
+++ b/drivers/bluetooth/btbcm.c
@@ -472,12 +472,11 @@ int btbcm_setup_apple(struct hci_dev *hdev)
/* Read Verbose Config Version Info */
skb = btbcm_read_verbose_config(hdev);
- if (IS_ERR(skb))
- return PTR_ERR(skb);
-
- BT_INFO("%s: BCM: chip id %u build %4.4u", hdev->name, skb->data[1],
- get_unaligned_le16(skb->data + 5));
- kfree_skb(skb);
+ if (!IS_ERR(skb)) {
+ BT_INFO("%s: BCM: chip id %u build %4.4u", hdev->name, skb->data[1],
+ get_unaligned_le16(skb->data + 5));
+ kfree_skb(skb);
+ }
set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);

drivers/isdn/gigaset/ser-gigaset.c

View file
diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
index 8c91fd5..375be50 100644
--- a/drivers/isdn/gigaset/ser-gigaset.c
+++ b/drivers/isdn/gigaset/ser-gigaset.c
@@ -524,9 +524,18 @@ gigaset_tty_open(struct tty_struct *tty)
cs->hw.ser->tty = tty;
atomic_set(&cs->hw.ser->refcnt, 1);
init_completion(&cs->hw.ser->dead_cmp);
-
tty->disc_data = cs;
+ /* Set the amount of data we're willing to receive per call
+ * from the hardware driver to half of the input buffer size
+ * to leave some reserve.
+ * Note: We don't do flow control towards the hardware driver.
+ * If more data is received than will fit into the input buffer,
+ * it will be dropped and an error will be logged. This should
+ * never happen as the device is slow and the buffer size ample.
+ */
+ tty->receive_room = RBUFSIZE/2;
+
/* OK.. Initialization of the datastructures and the HW is done.. Now
* startup system and notify the LL that we are ready to run
*/
@@ -598,28 +607,6 @@ static int gigaset_tty_hangup(struct tty_struct *tty)
}
/*
- * Read on the tty.
- * Unused, received data goes only to the Gigaset driver.
- */
-static ssize_t
-gigaset_tty_read(struct tty_struct *tty, struct file *file,
- unsigned char __user *buf, size_t count)
-{
- return -EAGAIN;
-}
-
-/*
- * Write on the tty.
- * Unused, transmit data comes only from the Gigaset driver.
- */
-static ssize_t
-gigaset_tty_write(struct tty_struct *tty, struct file *file,
- const unsigned char *buf, size_t count)
-{
- return -EAGAIN;
-}
-
-/*
* Ioctl on the tty.
* Called in process context only.
* May be re-entered by multiple ioctl calling threads.
@@ -752,8 +739,6 @@ static struct tty_ldisc_ops gigaset_ldisc = {
.open = gigaset_tty_open,
.close = gigaset_tty_close,
.hangup = gigaset_tty_hangup,
- .read = gigaset_tty_read,
- .write = gigaset_tty_write,
.ioctl = gigaset_tty_ioctl,
.receive_buf = gigaset_tty_receive,
.write_wakeup = gigaset_tty_wakeup,

drivers/net/bonding/bond_main.c

View file
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 317a494..e1ccefc 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -625,6 +625,23 @@ static void bond_set_dev_addr(struct net_device *bond_dev,
call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev);
}
+static struct slave *bond_get_old_active(struct bonding *bond,
+ struct slave *new_active)
+{
+ struct slave *slave;
+ struct list_head *iter;
+
+ bond_for_each_slave(bond, slave, iter) {
+ if (slave == new_active)
+ continue;
+
+ if (ether_addr_equal(bond->dev->dev_addr, slave->dev->dev_addr))
+ return slave;
+ }
+
+ return NULL;
+}
+
/* bond_do_fail_over_mac
*
* Perform special MAC address swapping for fail_over_mac settings
@@ -652,6 +669,9 @@ static void bond_do_fail_over_mac(struct bonding *bond,
if (!new_active)
return;
+ if (!old_active)
+ old_active = bond_get_old_active(bond, new_active);
+
if (old_active) {
ether_addr_copy(tmp_mac, new_active->dev->dev_addr);
ether_addr_copy(saddr.sa_data,
@@ -1725,9 +1745,16 @@ err_free:
err_undo_flags:
/* Enslave of first slave has failed and we need to fix master's mac */
- if (!bond_has_slaves(bond) &&
- ether_addr_equal_64bits(bond_dev->dev_addr, slave_dev->dev_addr))
- eth_hw_addr_random(bond_dev);
+ if (!bond_has_slaves(bond)) {
+ if (ether_addr_equal_64bits(bond_dev->dev_addr,
+ slave_dev->dev_addr))
+ eth_hw_addr_random(bond_dev);
+ if (bond_dev->type != ARPHRD_ETHER) {
+ ether_setup(bond_dev);
+ bond_dev->flags |= IFF_MASTER;
+ bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
+ }
+ }
return res;
}
@@ -1916,6 +1943,7 @@ static int bond_release_and_destroy(struct net_device *bond_dev,
bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
netdev_info(bond_dev, "Destroying bond %s\n",
bond_dev->name);
+ bond_remove_proc_entry(bond);
unregister_netdevice(bond_dev);
}
return ret;

drivers/net/can/at91_can.c

View file
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index f4e40aa..945c095 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -577,10 +577,10 @@ static void at91_rx_overflow_err(struct net_device *dev)
cf->can_id |= CAN_ERR_CRTL;
cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
- netif_receive_skb(skb);
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_receive_skb(skb);
}
/**
@@ -642,10 +642,10 @@ static void at91_read_msg(struct net_device *dev, unsigned int mb)
}
at91_read_mb(dev, mb, cf);
- netif_receive_skb(skb);
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_receive_skb(skb);
can_led_event(dev, CAN_LED_EVENT_RX);
}
@@ -802,10 +802,10 @@ static int at91_poll_err(struct net_device *dev, int quota, u32 reg_sr)
return 0;
at91_poll_err_frame(dev, cf, reg_sr);
- netif_receive_skb(skb);
dev->stats.rx_packets++;
dev->stats.rx_bytes += cf->can_dlc;
+ netif_receive_skb(skb);
return 1;
}
@@ -1067,10 +1067,10 @@ static void at91_irq_err(struct net_device *dev)
return;
at91_irq_err_state(dev, cf, new_state);
- netif_rx(skb);
dev->stats.rx_packets++;
dev->stats.rx_bytes += cf->can_dlc;
+ netif_rx(skb);
priv->can.state = new_state;
}

drivers/net/can/bfin_can.c

View file
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index 27ad312..57dadd5 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -424,10 +424,9 @@ static void bfin_can_rx(struct net_device *dev, u16 isrc)
cf->data[6 - i] = (6 - i) < cf->can_dlc ? (val >> 8) : 0;
}
- netif_rx(skb);
-
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_rx(skb);
}
static int bfin_can_err(struct net_device *dev, u16 isrc, u16 status)
@@ -508,10 +507,9 @@ static int bfin_can_err(struct net_device *dev, u16 isrc, u16 status)
priv->can.state = state;
- netif_rx(skb);
-
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_rx(skb);
return 0;
}

drivers/net/can/cc770/cc770.c

View file
diff --git a/drivers/net/can/cc770/cc770.c b/drivers/net/can/cc770/cc770.c
index c11d449..70a8cbb 100644
--- a/drivers/net/can/cc770/cc770.c
+++ b/drivers/net/can/cc770/cc770.c
@@ -504,10 +504,10 @@ static void cc770_rx(struct net_device *dev, unsigned int mo, u8 ctrl1)
for (i = 0; i < cf->can_dlc; i++)
cf->data[i] = cc770_read_reg(priv, msgobj[mo].data[i]);
}
- netif_rx(skb);
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_rx(skb);
}
static int cc770_err(struct net_device *dev, u8 status)
@@ -584,10 +584,10 @@ static int cc770_err(struct net_device *dev, u8 status)
}
}
- netif_rx(skb);
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_rx(skb);
return 0;
}

drivers/net/can/flexcan.c

View file
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 6201c5a..b1e8d72 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -577,10 +577,10 @@ static int flexcan_poll_bus_err(struct net_device *dev, u32 reg_esr)
return 0;
do_bus_err(dev, cf, reg_esr);
- netif_receive_skb(skb);
dev->stats.rx_packets++;
dev->stats.rx_bytes += cf->can_dlc;
+ netif_receive_skb(skb);
return 1;
}
@@ -622,10 +622,9 @@ static int flexcan_poll_state(struct net_device *dev, u32 reg_esr)
if (unlikely(new_state == CAN_STATE_BUS_OFF))
can_bus_off(dev);
- netif_receive_skb(skb);
-
dev->stats.rx_packets++;
dev->stats.rx_bytes += cf->can_dlc;
+ netif_receive_skb(skb);
return 1;
}
@@ -670,10 +669,10 @@ static int flexcan_read_frame(struct net_device *dev)
}
flexcan_read_fifo(dev, cf);
- netif_receive_skb(skb);
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_receive_skb(skb);
can_led_event(dev, CAN_LED_EVENT_RX);

drivers/net/can/grcan.c

View file
diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c
index e3d7e22..db9538d 100644
--- a/drivers/net/can/grcan.c
+++ b/drivers/net/can/grcan.c
@@ -1216,11 +1216,12 @@ static int grcan_receive(struct net_device *dev, int budget)
cf->data[i] = (u8)(slot[j] >> shift);
}
}
- netif_receive_skb(skb);
/* Update statistics and read pointer */
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_receive_skb(skb);
+
rd = grcan_ring_add(rd, GRCAN_MSG_SIZE, dma->rx.size);
}

drivers/net/can/sja1000/sja1000.c

View file
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 32bd7f4..7b92e91 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -377,10 +377,9 @@ static void sja1000_rx(struct net_device *dev)
/* release receive buffer */
sja1000_write_cmdreg(priv, CMD_RRB);
- netif_rx(skb);
-
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_rx(skb);
can_led_event(dev, CAN_LED_EVENT_RX);
}
@@ -484,10 +483,9 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
can_bus_off(dev);
}
- netif_rx(skb);
-
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_rx(skb);
return 0;
}

drivers/net/can/slcan.c

View file
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index a23a7af..9a3f15c 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -218,10 +218,10 @@ static void slc_bump(struct slcan *sl)
memcpy(skb_put(skb, sizeof(struct can_frame)),
&cf, sizeof(struct can_frame));
- netif_rx_ni(skb);
sl->dev->stats.rx_packets++;
sl->dev->stats.rx_bytes += cf.can_dlc;
+ netif_rx_ni(skb);
}
/* parse tty input stream */

drivers/net/can/spi/mcp251x.c

View file
diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index c1a95a3..b7e83c2 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -1086,8 +1086,8 @@ static int mcp251x_can_probe(struct spi_device *spi)
if (ret)
goto out_clk;
- priv->power = devm_regulator_get(&spi->dev, "vdd");
- priv->transceiver = devm_regulator_get(&spi->dev, "xceiver");
+ priv->power = devm_regulator_get_optional(&spi->dev, "vdd");
+ priv->transceiver = devm_regulator_get_optional(&spi->dev, "xceiver");
if ((PTR_ERR(priv->power) == -EPROBE_DEFER) ||
(PTR_ERR(priv->transceiver) == -EPROBE_DEFER)) {
ret = -EPROBE_DEFER;
@@ -1222,17 +1222,16 @@ static int __maybe_unused mcp251x_can_resume(struct device *dev)
struct spi_device *spi = to_spi_device(dev);
struct mcp251x_priv *priv = spi_get_drvdata(spi);
- if (priv->after_suspend & AFTER_SUSPEND_POWER) {
+ if (priv->after_suspend & AFTER_SUSPEND_POWER)
mcp251x_power_enable(priv->power, 1);
+
+ if (priv->after_suspend & AFTER_SUSPEND_UP) {
+ mcp251x_power_enable(priv->transceiver, 1);
queue_work(priv->wq, &priv->restart_work);
} else {
- if (priv->after_suspend & AFTER_SUSPEND_UP) {
- mcp251x_power_enable(priv->transceiver, 1);
- queue_work(priv->wq, &priv->restart_work);
- } else {
- priv->after_suspend = 0;
- }
+ priv->after_suspend = 0;
}
+
priv->force_quit = 0;
enable_irq(spi->irq);
return 0;

drivers/net/can/ti_hecc.c

View file
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index e95a9e1..cf345cb 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -747,9 +747,9 @@ static int ti_hecc_error(struct net_device *ndev, int int_status,
}
}
- netif_rx(skb);
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_rx(skb);
return 0;
}

drivers/net/can/usb/ems_usb.c

View file
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index 866bac0..2d39038 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -324,10 +324,9 @@ static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg)
cf->data[i] = msg->msg.can_msg.msg[i];
}
- netif_rx(skb);
-
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_rx(skb);
}
static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg)
@@ -400,10 +399,9 @@ static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg)
stats->rx_errors++;
}
- netif_rx(skb);
-
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_rx(skb);
}
/*

drivers/net/can/usb/esd_usb2.c

View file
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index 411c1af..0e5a449 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -301,13 +301,12 @@ static void esd_usb2_rx_event(struct esd_usb2_net_priv *priv,
cf->data[7] = rxerr;
}
- netif_rx(skb);
-
priv->bec.txerr = txerr;
priv->bec.rxerr = rxerr;
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_rx(skb);
}
}
@@ -347,10 +346,9 @@ static void esd_usb2_rx_can_msg(struct esd_usb2_net_priv *priv,
cf->data[i] = msg->msg.rx.data[i];
}
- netif_rx(skb);
-
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
+ netif_rx(skb);
}
return;

drivers/net/can/usb/peak_usb/pcan_usb.c

View file
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c
index 72427f2..6b94007 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb.c
@@ -526,9 +526,9 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n,
hwts->hwtstamp = timeval_to_ktime(tv);
}
- netif_rx(skb);
mc->netdev->stats.rx_packets++;
mc->netdev->stats.rx_bytes += cf->can_dlc;
+ netif_rx(skb);

This diff is incomplete. Download the complete patch.

drivers/net/can/usb/peak_usb/pcan_usb_pro.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/can/usb/usb_8dev.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/dsa/bcm_sf2.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/dsa/mv88e6xxx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/freescale/fec_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/marvell/mvneta.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/renesas/ravb_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/ti/cpsw.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/ti/netcp_core.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ipvlan/ipvlan.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ipvlan/ipvlan_core.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ipvlan/ipvlan_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/phy/dp83867.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/phy/mdio_bus.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/usb/qmi_wwan.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/virtio_net.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/ath/ath9k/hw.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/iwl-fh.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/iwl-nvm-parse.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/scan.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/sta.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/time-event.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/tx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/pcie/drv.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/pcie/internal.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/pcie/rx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/pcie/trans.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/xen-netback/netback.c

View file

This diff is incomplete. Download the complete patch.

include/net/cfg80211.h

View file

This diff is incomplete. Download the complete patch.

include/net/ip.h

View file

This diff is incomplete. Download the complete patch.

net/ax25/ax25_subr.c

View file

This diff is incomplete. Download the complete patch.

net/bridge/br_mdb.c

View file

This diff is incomplete. Download the complete patch.

net/bridge/br_multicast.c

View file

This diff is incomplete. Download the complete patch.

net/caif/caif_socket.c

View file

This diff is incomplete. Download the complete patch.

net/core/datagram.c

View file

This diff is incomplete. Download the complete patch.

net/core/dst.c

View file

This diff is incomplete. Download the complete patch.

net/core/rtnetlink.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/datagram.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/inet_hashtables.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/ip_fragment.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_input.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/datagram.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/ip6_offload.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/debugfs_netdev.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/iface.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/mesh_plink.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/pm.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/tdls.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/tx.c

View file

This diff is incomplete. Download the complete patch.

net/netlink/af_netlink.c

View file

This diff is incomplete. Download the complete patch.

net/openvswitch/flow_table.c

View file

This diff is incomplete. Download the complete patch.

net/sched/act_bpf.c

View file

This diff is incomplete. Download the complete patch.

net/sched/cls_bpf.c

View file

This diff is incomplete. Download the complete patch.

net/sched/cls_flow.c

View file

This diff is incomplete. Download the complete patch.

net/sched/cls_flower.c

View file

This diff is incomplete. Download the complete patch.

net/sched/sch_fq_codel.c

View file

This diff is incomplete. Download the complete patch.

net/sched/sch_sfq.c

View file

This diff is incomplete. Download the complete patch.

net/wireless/chan.c

View file

This diff is incomplete. Download the complete patch.

net/wireless/nl80211.c

View file

This diff is incomplete. Download the complete patch.

net/wireless/reg.c

View file

This diff is incomplete. Download the complete patch.

net/wireless/trace.h

View file

This diff is incomplete. Download the complete patch.