aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-04-04 20:42:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-04 20:42:38 -0400
commitf9ca6a561d40115696a54f16085c4edb17effc74 (patch)
treefc1eae6489ac8792d3903e269a1685628023175b
parent9eb31227cbccd3a37da0f42604f1ab5fc556bc53 (diff)
parent87248d31d1055b56e01a62d9320b4e118bc84e0e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "This fixes some fallout from the net-next merge the other day, plus some non-merge-window-related bug fixes: 1) Fix sparse warnings in bcmgenet, systemport, b53, and mt7530 (Florian Fainelli) 2) pptp does a bogus dst_release() on a route we have a single refcount on, and attached to a socket, which needs that refcount (Eric Dumazet) 3) UDP connected sockets on ipv6 can race with route update handling, resulting in a pre-PMTU update route still stuck on the socket and thus continuing to get ICMPV6_PKT_TOOBIG errors. We end up never seeing the updated route. (Alexey Kodanev) 4) Missing list initializer(s) in TIPC (Jon Maloy) 5) Connect phy early to prevent crashes in lan78xx driver (Alexander Graf) 6) Fix build with modular NVMEM (Arnd Bergmann) 7) netdevsim canot mark nsim_devlink_net_ops and nsim_fib_net_ops as __net_initdata, as these are references from module unload unconditionally (Arnd Bergmann)" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (23 commits) netdevsim: remove incorrect __net_initdata annotations sfc: remove ctpio_dmabuf_start from stats inet: frags: fix ip6frag_low_thresh boundary tipc: Fix namespace violation in tipc_sk_fill_sock_diag net: avoid unneeded atomic operation in ip*_append_data() nvmem: disallow modular CONFIG_NVMEM net: hns3: fix length overflow when CONFIG_ARM64_64K_PAGES nfp: use full 40 bits of the NSP buffer address lan78xx: Connect phy early nfp: add a separate counter for packets with CHECKSUM_COMPLETE tipc: Fix missing list initializations in struct tipc_subscription ipv6: udp: set dst cache for a connected sk if current not valid ipv6: udp: convert 'connected' to bool type in udpv6_sendmsg() ipv6: allow to cache dst for a connected sk in ip6_sk_dst_lookup_flow() ipv6: add a wrapper for ip6_dst_store() with flowi6 checks net: phy: marvell10g: add thermal hwmon device pptp: remove a buggy dst release in pptp_connect() net: dsa: mt7530: Use NULL instead of plain integer net: dsa: b53: Fix sparse warnings in b53_mmap.c af_unix: remove redundant lockdep class ...
-rw-r--r--drivers/net/dsa/b53/b53_mmap.c33
-rw-r--r--drivers/net/dsa/mt7530.c6
-rw-r--r--drivers/net/ethernet/broadcom/bcmsysport.c11
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet.c11
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3_enet.h2
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_net.h4
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_net_common.c2
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c16
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c9
-rw-r--r--drivers/net/ethernet/sfc/ef10.c2
-rw-r--r--drivers/net/ethernet/sfc/nic.h1
-rw-r--r--drivers/net/netdevsim/devlink.c2
-rw-r--r--drivers/net/netdevsim/fib.c2
-rw-r--r--drivers/net/phy/marvell10g.c184
-rw-r--r--drivers/net/ppp/pptp.c1
-rw-r--r--drivers/net/usb/lan78xx.c34
-rw-r--r--drivers/nvmem/Kconfig2
-rw-r--r--include/net/ip6_route.h3
-rw-r--r--include/net/ipv6.h3
-rw-r--r--net/ieee802154/6lowpan/reassembly.c2
-rw-r--r--net/ipv4/ip_fragment.c5
-rw-r--r--net/ipv4/ip_output.c3
-rw-r--r--net/ipv6/datagram.c9
-rw-r--r--net/ipv6/ip6_output.c18
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c2
-rw-r--r--net/ipv6/ping.c2
-rw-r--r--net/ipv6/reassembly.c2
-rw-r--r--net/ipv6/route.c17
-rw-r--r--net/ipv6/udp.c31
-rw-r--r--net/rxrpc/input.c6
-rw-r--r--net/rxrpc/protocol.h6
-rw-r--r--net/tipc/socket.c3
-rw-r--r--net/tipc/subscr.c2
-rw-r--r--net/unix/af_unix.c10
34 files changed, 326 insertions, 120 deletions
diff --git a/drivers/net/dsa/b53/b53_mmap.c b/drivers/net/dsa/b53/b53_mmap.c
index ef63d24fef81..c628d0980c0b 100644
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -30,7 +30,8 @@ struct b53_mmap_priv {
30 30
31static int b53_mmap_read8(struct b53_device *dev, u8 page, u8 reg, u8 *val) 31static int b53_mmap_read8(struct b53_device *dev, u8 page, u8 reg, u8 *val)
32{ 32{
33 u8 __iomem *regs = dev->priv; 33 struct b53_mmap_priv *priv = dev->priv;
34 void __iomem *regs = priv->regs;
34 35
35 *val = readb(regs + (page << 8) + reg); 36 *val = readb(regs + (page << 8) + reg);
36 37
@@ -39,7 +40,8 @@ static int b53_mmap_read8(struct b53_device *dev, u8 page, u8 reg, u8 *val)
39 40
40static int b53_mmap_read16(struct b53_device *dev, u8 page, u8 reg, u16 *val) 41static int b53_mmap_read16(struct b53_device *dev, u8 page, u8 reg, u16 *val)
41{ 42{
42 u8 __iomem *regs = dev->priv; 43 struct b53_mmap_priv *priv = dev->priv;
44 void __iomem *regs = priv->regs;
43 45
44 if (WARN_ON(reg % 2)) 46 if (WARN_ON(reg % 2))
45 return -EINVAL; 47 return -EINVAL;
@@ -54,7 +56,8 @@ static int b53_mmap_read16(struct b53_device *dev, u8 page, u8 reg, u16 *val)
54 56
55static int b53_mmap_read32(struct b53_device *dev, u8 page, u8 reg, u32 *val) 57static int b53_mmap_read32(struct b53_device *dev, u8 page, u8 reg, u32 *val)
56{ 58{
57 u8 __iomem *regs = dev->priv; 59 struct b53_mmap_priv *priv = dev->priv;
60 void __iomem *regs = priv->regs;
58 61
59 if (WARN_ON(reg % 4)) 62 if (WARN_ON(reg % 4))
60 return -EINVAL; 63 return -EINVAL;
@@ -69,7 +72,8 @@ static int b53_mmap_read32(struct b53_device *dev, u8 page, u8 reg, u32 *val)
69 72
70static int b53_mmap_read48(struct b53_device *dev, u8 page, u8 reg, u64 *val) 73static int b53_mmap_read48(struct b53_device *dev, u8 page, u8 reg, u64 *val)
71{ 74{
72 u8 __iomem *regs = dev->priv; 75 struct b53_mmap_priv *priv = dev->priv;
76 void __iomem *regs = priv->regs;
73 77
74 if (WARN_ON(reg % 2)) 78 if (WARN_ON(reg % 2))
75 return -EINVAL; 79 return -EINVAL;
@@ -107,7 +111,8 @@ static int b53_mmap_read48(struct b53_device *dev, u8 page, u8 reg, u64 *val)
107 111
108static int b53_mmap_read64(struct b53_device *dev, u8 page, u8 reg, u64 *val) 112static int b53_mmap_read64(struct b53_device *dev, u8 page, u8 reg, u64 *val)
109{ 113{
110 u8 __iomem *regs = dev->priv; 114 struct b53_mmap_priv *priv = dev->priv;
115 void __iomem *regs = priv->regs;
111 u32 hi, lo; 116 u32 hi, lo;
112 117
113 if (WARN_ON(reg % 4)) 118 if (WARN_ON(reg % 4))
@@ -128,7 +133,8 @@ static int b53_mmap_read64(struct b53_device *dev, u8 page, u8 reg, u64 *val)
128 133
129static int b53_mmap_write8(struct b53_device *dev, u8 page, u8 reg, u8 value) 134static int b53_mmap_write8(struct b53_device *dev, u8 page, u8 reg, u8 value)
130{ 135{
131 u8 __iomem *regs = dev->priv; 136 struct b53_mmap_priv *priv = dev->priv;
137 void __iomem *regs = priv->regs;
132 138
133 writeb(value, regs + (page << 8) + reg); 139 writeb(value, regs + (page << 8) + reg);
134 140
@@ -138,7 +144,8 @@ static int b53_mmap_write8(struct b53_device *dev, u8 page, u8 reg, u8 value)
138static int b53_mmap_write16(struct b53_device *dev, u8 page, u8 reg, 144static int b53_mmap_write16(struct b53_device *dev, u8 page, u8 reg,
139 u16 value) 145 u16 value)
140{ 146{
141 u8 __iomem *regs = dev->priv; 147 struct b53_mmap_priv *priv = dev->priv;
148 void __iomem *regs = priv->regs;
142 149
143 if (WARN_ON(reg % 2)) 150 if (WARN_ON(reg % 2))
144 return -EINVAL; 151 return -EINVAL;
@@ -154,7 +161,8 @@ static int b53_mmap_write16(struct b53_device *dev, u8 page, u8 reg,
154static int b53_mmap_write32(struct b53_device *dev, u8 page, u8 reg, 161static int b53_mmap_write32(struct b53_device *dev, u8 page, u8 reg,
155 u32 value) 162 u32 value)
156{ 163{
157 u8 __iomem *regs = dev->priv; 164 struct b53_mmap_priv *priv = dev->priv;
165 void __iomem *regs = priv->regs;
158 166
159 if (WARN_ON(reg % 4)) 167 if (WARN_ON(reg % 4))
160 return -EINVAL; 168 return -EINVAL;
@@ -223,12 +231,19 @@ static const struct b53_io_ops b53_mmap_ops = {
223static int b53_mmap_probe(struct platform_device *pdev) 231static int b53_mmap_probe(struct platform_device *pdev)
224{ 232{
225 struct b53_platform_data *pdata = pdev->dev.platform_data; 233 struct b53_platform_data *pdata = pdev->dev.platform_data;
234 struct b53_mmap_priv *priv;
226 struct b53_device *dev; 235 struct b53_device *dev;
227 236
228 if (!pdata) 237 if (!pdata)
229 return -EINVAL; 238 return -EINVAL;
230 239
231 dev = b53_switch_alloc(&pdev->dev, &b53_mmap_ops, pdata->regs); 240 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
241 if (!priv)
242 return -ENOMEM;
243
244 priv->regs = pdata->regs;
245
246 dev = b53_switch_alloc(&pdev->dev, &b53_mmap_ops, priv);
232 if (!dev) 247 if (!dev)
233 return -ENOMEM; 248 return -ENOMEM;
234 249
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index d244c41898dd..80a4dbc3a499 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -917,7 +917,7 @@ mt7530_port_fdb_add(struct dsa_switch *ds, int port,
917 917
918 mutex_lock(&priv->reg_mutex); 918 mutex_lock(&priv->reg_mutex);
919 mt7530_fdb_write(priv, vid, port_mask, addr, -1, STATIC_ENT); 919 mt7530_fdb_write(priv, vid, port_mask, addr, -1, STATIC_ENT);
920 ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, 0); 920 ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, NULL);
921 mutex_unlock(&priv->reg_mutex); 921 mutex_unlock(&priv->reg_mutex);
922 922
923 return ret; 923 return ret;
@@ -933,7 +933,7 @@ mt7530_port_fdb_del(struct dsa_switch *ds, int port,
933 933
934 mutex_lock(&priv->reg_mutex); 934 mutex_lock(&priv->reg_mutex);
935 mt7530_fdb_write(priv, vid, port_mask, addr, -1, STATIC_EMP); 935 mt7530_fdb_write(priv, vid, port_mask, addr, -1, STATIC_EMP);
936 ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, 0); 936 ret = mt7530_fdb_cmd(priv, MT7530_FDB_WRITE, NULL);
937 mutex_unlock(&priv->reg_mutex); 937 mutex_unlock(&priv->reg_mutex);
938 938
939 return ret; 939 return ret;
@@ -1293,7 +1293,7 @@ mt7530_setup(struct dsa_switch *ds)
1293 } 1293 }
1294 1294
1295 /* Flush the FDB table */ 1295 /* Flush the FDB table */
1296 ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, 0); 1296 ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL);
1297 if (ret < 0) 1297 if (ret < 0)
1298 return ret; 1298 return ret;
1299 1299
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 4a75b1de22e0..f9a3c1a76d5d 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -1192,7 +1192,7 @@ static struct sk_buff *bcm_sysport_insert_tsb(struct sk_buff *skb,
1192 u32 csum_info; 1192 u32 csum_info;
1193 u8 ip_proto; 1193 u8 ip_proto;
1194 u16 csum_start; 1194 u16 csum_start;
1195 u16 ip_ver; 1195 __be16 ip_ver;
1196 1196
1197 /* Re-allocate SKB if needed */ 1197 /* Re-allocate SKB if needed */
1198 if (unlikely(skb_headroom(skb) < sizeof(*tsb))) { 1198 if (unlikely(skb_headroom(skb) < sizeof(*tsb))) {
@@ -1211,12 +1211,12 @@ static struct sk_buff *bcm_sysport_insert_tsb(struct sk_buff *skb,
1211 memset(tsb, 0, sizeof(*tsb)); 1211 memset(tsb, 0, sizeof(*tsb));
1212 1212
1213 if (skb->ip_summed == CHECKSUM_PARTIAL) { 1213 if (skb->ip_summed == CHECKSUM_PARTIAL) {
1214 ip_ver = htons(skb->protocol); 1214 ip_ver = skb->protocol;
1215 switch (ip_ver) { 1215 switch (ip_ver) {
1216 case ETH_P_IP: 1216 case htons(ETH_P_IP):
1217 ip_proto = ip_hdr(skb)->protocol; 1217 ip_proto = ip_hdr(skb)->protocol;
1218 break; 1218 break;
1219 case ETH_P_IPV6: 1219 case htons(ETH_P_IPV6):
1220 ip_proto = ipv6_hdr(skb)->nexthdr; 1220 ip_proto = ipv6_hdr(skb)->nexthdr;
1221 break; 1221 break;
1222 default: 1222 default:
@@ -1230,7 +1230,8 @@ static struct sk_buff *bcm_sysport_insert_tsb(struct sk_buff *skb,
1230 1230
1231 if (ip_proto == IPPROTO_TCP || ip_proto == IPPROTO_UDP) { 1231 if (ip_proto == IPPROTO_TCP || ip_proto == IPPROTO_UDP) {
1232 csum_info |= L4_LENGTH_VALID; 1232 csum_info |= L4_LENGTH_VALID;
1233 if (ip_proto == IPPROTO_UDP && ip_ver == ETH_P_IP) 1233 if (ip_proto == IPPROTO_UDP &&
1234 ip_ver == htons(ETH_P_IP))
1234 csum_info |= L4_UDP; 1235 csum_info |= L4_UDP;
1235 } else { 1236 } else {
1236 csum_info = 0; 1237 csum_info = 0;
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 264fb37dd341..0445f2c0c629 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -1489,7 +1489,7 @@ static struct sk_buff *bcmgenet_put_tx_csum(struct net_device *dev,
1489 struct sk_buff *new_skb; 1489 struct sk_buff *new_skb;
1490 u16 offset; 1490 u16 offset;
1491 u8 ip_proto; 1491 u8 ip_proto;
1492 u16 ip_ver; 1492 __be16 ip_ver;
1493 u32 tx_csum_info; 1493 u32 tx_csum_info;
1494 1494
1495 if (unlikely(skb_headroom(skb) < sizeof(*status))) { 1495 if (unlikely(skb_headroom(skb) < sizeof(*status))) {
@@ -1509,12 +1509,12 @@ static struct sk_buff *bcmgenet_put_tx_csum(struct net_device *dev,
1509 status = (struct status_64 *)skb->data; 1509 status = (struct status_64 *)skb->data;
1510 1510
1511 if (skb->ip_summed == CHECKSUM_PARTIAL) { 1511 if (skb->ip_summed == CHECKSUM_PARTIAL) {
1512 ip_ver = htons(skb->protocol); 1512 ip_ver = skb->protocol;
1513 switch (ip_ver) { 1513 switch (ip_ver) {
1514 case ETH_P_IP: 1514 case htons(ETH_P_IP):
1515 ip_proto = ip_hdr(skb)->protocol; 1515 ip_proto = ip_hdr(skb)->protocol;
1516 break; 1516 break;
1517 case ETH_P_IPV6: 1517 case htons(ETH_P_IPV6):
1518 ip_proto = ipv6_hdr(skb)->nexthdr; 1518 ip_proto = ipv6_hdr(skb)->nexthdr;
1519 break; 1519 break;
1520 default: 1520 default:
@@ -1530,7 +1530,8 @@ static struct sk_buff *bcmgenet_put_tx_csum(struct net_device *dev,
1530 */ 1530 */
1531 if (ip_proto == IPPROTO_TCP || ip_proto == IPPROTO_UDP) { 1531 if (ip_proto == IPPROTO_TCP || ip_proto == IPPROTO_UDP) {
1532 tx_csum_info |= STATUS_TX_CSUM_LV; 1532 tx_csum_info |= STATUS_TX_CSUM_LV;
1533 if (ip_proto == IPPROTO_UDP && ip_ver == ETH_P_IP) 1533 if (ip_proto == IPPROTO_UDP &&
1534 ip_ver == htons(ETH_P_IP))
1534 tx_csum_info |= STATUS_TX_CSUM_PROTO_UDP; 1535 tx_csum_info |= STATUS_TX_CSUM_PROTO_UDP;
1535 } else { 1536 } else {
1536 tx_csum_info = 0; 1537 tx_csum_info = 0;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
index 9e4cfbbf8dcd..98cdbd3a1163 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
@@ -288,7 +288,7 @@ struct hns3_desc_cb {
288 u16 page_offset; 288 u16 page_offset;
289 u16 reuse_flag; 289 u16 reuse_flag;
290 290
291 u16 length; /* length of the buffer */ 291 u32 length; /* length of the buffer */
292 292
293 /* desc type, used by the ring user to mark the type of the priv data */ 293 /* desc type, used by the ring user to mark the type of the priv data */
294 u16 type; 294 u16 type;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net.h b/drivers/net/ethernet/netronome/nfp/nfp_net.h
index 787df47ec430..bd7d8ae31e17 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net.h
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net.h
@@ -391,6 +391,7 @@ struct nfp_net_rx_ring {
391 * @rx_drops: Number of packets dropped on RX due to lack of resources 391 * @rx_drops: Number of packets dropped on RX due to lack of resources
392 * @hw_csum_rx_ok: Counter of packets where the HW checksum was OK 392 * @hw_csum_rx_ok: Counter of packets where the HW checksum was OK
393 * @hw_csum_rx_inner_ok: Counter of packets where the inner HW checksum was OK 393 * @hw_csum_rx_inner_ok: Counter of packets where the inner HW checksum was OK
394 * @hw_csum_rx_complete: Counter of packets with CHECKSUM_COMPLETE reported
394 * @hw_csum_rx_error: Counter of packets with bad checksums 395 * @hw_csum_rx_error: Counter of packets with bad checksums
395 * @tx_sync: Seqlock for atomic updates of TX stats 396 * @tx_sync: Seqlock for atomic updates of TX stats
396 * @tx_pkts: Number of Transmitted packets 397 * @tx_pkts: Number of Transmitted packets
@@ -434,7 +435,7 @@ struct nfp_net_r_vector {
434 u64 rx_drops; 435 u64 rx_drops;
435 u64 hw_csum_rx_ok; 436 u64 hw_csum_rx_ok;
436 u64 hw_csum_rx_inner_ok; 437 u64 hw_csum_rx_inner_ok;
437 u64 hw_csum_rx_error; 438 u64 hw_csum_rx_complete;
438 439
439 struct nfp_net_tx_ring *xdp_ring; 440 struct nfp_net_tx_ring *xdp_ring;
440 441
@@ -446,6 +447,7 @@ struct nfp_net_r_vector {
446 u64 tx_gather; 447 u64 tx_gather;
447 u64 tx_lso; 448 u64 tx_lso;
448 449
450 u64 hw_csum_rx_error;
449 u64 rx_replace_buf_alloc_fail; 451 u64 rx_replace_buf_alloc_fail;
450 u64 tx_errors; 452 u64 tx_errors;
451 u64 tx_busy; 453 u64 tx_busy;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 43a9c207a049..1eb6549f2a54 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -1406,7 +1406,7 @@ static void nfp_net_rx_csum(struct nfp_net_dp *dp,
1406 skb->ip_summed = meta->csum_type; 1406 skb->ip_summed = meta->csum_type;
1407 skb->csum = meta->csum; 1407 skb->csum = meta->csum;
1408 u64_stats_update_begin(&r_vec->rx_sync); 1408 u64_stats_update_begin(&r_vec->rx_sync);
1409 r_vec->hw_csum_rx_ok++; 1409 r_vec->hw_csum_rx_complete++;
1410 u64_stats_update_end(&r_vec->rx_sync); 1410 u64_stats_update_end(&r_vec->rx_sync);
1411 return; 1411 return;
1412 } 1412 }
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
index e1dae0616f52..c9016419bfa0 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
@@ -179,7 +179,7 @@ static const struct nfp_et_stat nfp_mac_et_stats[] = {
179 179
180#define NN_ET_GLOBAL_STATS_LEN ARRAY_SIZE(nfp_net_et_stats) 180#define NN_ET_GLOBAL_STATS_LEN ARRAY_SIZE(nfp_net_et_stats)
181#define NN_ET_SWITCH_STATS_LEN 9 181#define NN_ET_SWITCH_STATS_LEN 9
182#define NN_RVEC_GATHER_STATS 8 182#define NN_RVEC_GATHER_STATS 9
183#define NN_RVEC_PER_Q_STATS 3 183#define NN_RVEC_PER_Q_STATS 3
184 184
185static void nfp_net_get_nspinfo(struct nfp_app *app, char *version) 185static void nfp_net_get_nspinfo(struct nfp_app *app, char *version)
@@ -468,6 +468,7 @@ static u8 *nfp_vnic_get_sw_stats_strings(struct net_device *netdev, u8 *data)
468 468
469 data = nfp_pr_et(data, "hw_rx_csum_ok"); 469 data = nfp_pr_et(data, "hw_rx_csum_ok");
470 data = nfp_pr_et(data, "hw_rx_csum_inner_ok"); 470 data = nfp_pr_et(data, "hw_rx_csum_inner_ok");
471 data = nfp_pr_et(data, "hw_rx_csum_complete");
471 data = nfp_pr_et(data, "hw_rx_csum_err"); 472 data = nfp_pr_et(data, "hw_rx_csum_err");
472 data = nfp_pr_et(data, "rx_replace_buf_alloc_fail"); 473 data = nfp_pr_et(data, "rx_replace_buf_alloc_fail");
473 data = nfp_pr_et(data, "hw_tx_csum"); 474 data = nfp_pr_et(data, "hw_tx_csum");
@@ -493,18 +494,19 @@ static u64 *nfp_vnic_get_sw_stats(struct net_device *netdev, u64 *data)
493 data[0] = nn->r_vecs[i].rx_pkts; 494 data[0] = nn->r_vecs[i].rx_pkts;
494 tmp[0] = nn->r_vecs[i].hw_csum_rx_ok; 495 tmp[0] = nn->r_vecs[i].hw_csum_rx_ok;
495 tmp[1] = nn->r_vecs[i].hw_csum_rx_inner_ok; 496 tmp[1] = nn->r_vecs[i].hw_csum_rx_inner_ok;
496 tmp[2] = nn->r_vecs[i].hw_csum_rx_error; 497 tmp[2] = nn->r_vecs[i].hw_csum_rx_complete;
497 tmp[3] = nn->r_vecs[i].rx_replace_buf_alloc_fail; 498 tmp[3] = nn->r_vecs[i].hw_csum_rx_error;
499 tmp[4] = nn->r_vecs[i].rx_replace_buf_alloc_fail;
498 } while (u64_stats_fetch_retry(&nn->r_vecs[i].rx_sync, start)); 500 } while (u64_stats_fetch_retry(&nn->r_vecs[i].rx_sync, start));
499 501
500 do { 502 do {
501 start = u64_stats_fetch_begin(&nn->r_vecs[i].tx_sync); 503 start = u64_stats_fetch_begin(&nn->r_vecs[i].tx_sync);
502 data[1] = nn->r_vecs[i].tx_pkts; 504 data[1] = nn->r_vecs[i].tx_pkts;
503 data[2] = nn->r_vecs[i].tx_busy; 505 data[2] = nn->r_vecs[i].tx_busy;
504 tmp[4] = nn->r_vecs[i].hw_csum_tx; 506 tmp[5] = nn->r_vecs[i].hw_csum_tx;
505 tmp[5] = nn->r_vecs[i].hw_csum_tx_inner; 507 tmp[6] = nn->r_vecs[i].hw_csum_tx_inner;
506 tmp[6] = nn->r_vecs[i].tx_gather; 508 tmp[7] = nn->r_vecs[i].tx_gather;
507 tmp[7] = nn->r_vecs[i].tx_lso; 509 tmp[8] = nn->r_vecs[i].tx_lso;
508 } while (u64_stats_fetch_retry(&nn->r_vecs[i].tx_sync, start)); 510 } while (u64_stats_fetch_retry(&nn->r_vecs[i].tx_sync, start));
509 511
510 data += NN_RVEC_PER_Q_STATS; 512 data += NN_RVEC_PER_Q_STATS;
diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c
index 39abac678b71..99bb679a9801 100644
--- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c
@@ -71,10 +71,11 @@
71/* CPP address to retrieve the data from */ 71/* CPP address to retrieve the data from */
72#define NSP_BUFFER 0x10 72#define NSP_BUFFER 0x10
73#define NSP_BUFFER_CPP GENMASK_ULL(63, 40) 73#define NSP_BUFFER_CPP GENMASK_ULL(63, 40)
74#define NSP_BUFFER_PCIE GENMASK_ULL(39, 38) 74#define NSP_BUFFER_ADDRESS GENMASK_ULL(39, 0)
75#define NSP_BUFFER_ADDRESS GENMASK_ULL(37, 0)
76 75
77#define NSP_DFLT_BUFFER 0x18 76#define NSP_DFLT_BUFFER 0x18
77#define NSP_DFLT_BUFFER_CPP GENMASK_ULL(63, 40)
78#define NSP_DFLT_BUFFER_ADDRESS GENMASK_ULL(39, 0)
78 79
79#define NSP_DFLT_BUFFER_CONFIG 0x20 80#define NSP_DFLT_BUFFER_CONFIG 0x20
80#define NSP_DFLT_BUFFER_SIZE_MB GENMASK_ULL(7, 0) 81#define NSP_DFLT_BUFFER_SIZE_MB GENMASK_ULL(7, 0)
@@ -427,8 +428,8 @@ __nfp_nsp_command_buf(struct nfp_nsp *nsp, u16 code, u32 option,
427 if (err < 0) 428 if (err < 0)
428 return err; 429 return err;
429 430
430 cpp_id = FIELD_GET(NSP_BUFFER_CPP, reg) << 8; 431 cpp_id = FIELD_GET(NSP_DFLT_BUFFER_CPP, reg) << 8;
431 cpp_buf = FIELD_GET(NSP_BUFFER_ADDRESS, reg); 432 cpp_buf = FIELD_GET(NSP_DFLT_BUFFER_ADDRESS, reg);
432 433
433 if (in_buf && in_size) { 434 if (in_buf && in_size) {
434 err = nfp_cpp_write(cpp, cpp_id, cpp_buf, in_buf, in_size); 435 err = nfp_cpp_write(cpp, cpp_id, cpp_buf, in_buf, in_size);
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index c4c45c94da77..50daad0a1482 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -1666,7 +1666,6 @@ static const struct efx_hw_stat_desc efx_ef10_stat_desc[EF10_STAT_COUNT] = {
1666 EF10_DMA_STAT(fec_corrected_symbols_lane1, FEC_CORRECTED_SYMBOLS_LANE1), 1666 EF10_DMA_STAT(fec_corrected_symbols_lane1, FEC_CORRECTED_SYMBOLS_LANE1),
1667 EF10_DMA_STAT(fec_corrected_symbols_lane2, FEC_CORRECTED_SYMBOLS_LANE2), 1667 EF10_DMA_STAT(fec_corrected_symbols_lane2, FEC_CORRECTED_SYMBOLS_LANE2),
1668 EF10_DMA_STAT(fec_corrected_symbols_lane3, FEC_CORRECTED_SYMBOLS_LANE3), 1668 EF10_DMA_STAT(fec_corrected_symbols_lane3, FEC_CORRECTED_SYMBOLS_LANE3),
1669 EF10_DMA_STAT(ctpio_dmabuf_start, CTPIO_DMABUF_START),
1670 EF10_DMA_STAT(ctpio_vi_busy_fallback, CTPIO_VI_BUSY_FALLBACK), 1669 EF10_DMA_STAT(ctpio_vi_busy_fallback, CTPIO_VI_BUSY_FALLBACK),
1671 EF10_DMA_STAT(ctpio_long_write_success, CTPIO_LONG_WRITE_SUCCESS), 1670 EF10_DMA_STAT(ctpio_long_write_success, CTPIO_LONG_WRITE_SUCCESS),
1672 EF10_DMA_STAT(ctpio_missing_dbell_fail, CTPIO_MISSING_DBELL_FAIL), 1671 EF10_DMA_STAT(ctpio_missing_dbell_fail, CTPIO_MISSING_DBELL_FAIL),
@@ -1777,7 +1776,6 @@ static const struct efx_hw_stat_desc efx_ef10_stat_desc[EF10_STAT_COUNT] = {
1777 * These bits are in the second u64 of the raw mask. 1776 * These bits are in the second u64 of the raw mask.
1778 */ 1777 */
1779#define EF10_CTPIO_STAT_MASK ( \ 1778#define EF10_CTPIO_STAT_MASK ( \
1780 (1ULL << (EF10_STAT_ctpio_dmabuf_start - 64)) | \
1781 (1ULL << (EF10_STAT_ctpio_vi_busy_fallback - 64)) | \ 1779 (1ULL << (EF10_STAT_ctpio_vi_busy_fallback - 64)) | \
1782 (1ULL << (EF10_STAT_ctpio_long_write_success - 64)) | \ 1780 (1ULL << (EF10_STAT_ctpio_long_write_success - 64)) | \
1783 (1ULL << (EF10_STAT_ctpio_missing_dbell_fail - 64)) | \ 1781 (1ULL << (EF10_STAT_ctpio_missing_dbell_fail - 64)) | \
diff --git a/drivers/net/ethernet/sfc/nic.h b/drivers/net/ethernet/sfc/nic.h
index 5640034bda10..5cca0556b47f 100644
--- a/drivers/net/ethernet/sfc/nic.h
+++ b/drivers/net/ethernet/sfc/nic.h
@@ -332,7 +332,6 @@ enum {
332 EF10_STAT_fec_corrected_symbols_lane1, 332 EF10_STAT_fec_corrected_symbols_lane1,
333 EF10_STAT_fec_corrected_symbols_lane2, 333 EF10_STAT_fec_corrected_symbols_lane2,
334 EF10_STAT_fec_corrected_symbols_lane3, 334 EF10_STAT_fec_corrected_symbols_lane3,
335 EF10_STAT_ctpio_dmabuf_start,
336 EF10_STAT_ctpio_vi_busy_fallback, 335 EF10_STAT_ctpio_vi_busy_fallback,
337 EF10_STAT_ctpio_long_write_success, 336 EF10_STAT_ctpio_long_write_success,
338 EF10_STAT_ctpio_missing_dbell_fail, 337 EF10_STAT_ctpio_missing_dbell_fail,
diff --git a/drivers/net/netdevsim/devlink.c b/drivers/net/netdevsim/devlink.c
index 27ae05c5fdaf..1dba47936456 100644
--- a/drivers/net/netdevsim/devlink.c
+++ b/drivers/net/netdevsim/devlink.c
@@ -267,7 +267,7 @@ static int __net_init nsim_devlink_netns_init(struct net *net)
267 return 0; 267 return 0;
268} 268}
269 269
270static struct pernet_operations nsim_devlink_net_ops __net_initdata = { 270static struct pernet_operations nsim_devlink_net_ops = {
271 .init = nsim_devlink_netns_init, 271 .init = nsim_devlink_netns_init,
272 .id = &nsim_devlink_id, 272 .id = &nsim_devlink_id,
273 .size = sizeof(bool), 273 .size = sizeof(bool),
diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c
index 0d105bafa261..9bfe9e151e13 100644
--- a/drivers/net/netdevsim/fib.c
+++ b/drivers/net/netdevsim/fib.c
@@ -230,7 +230,7 @@ static int __net_init nsim_fib_netns_init(struct net *net)
230 return 0; 230 return 0;
231} 231}
232 232
233static struct pernet_operations nsim_fib_net_ops __net_initdata = { 233static struct pernet_operations nsim_fib_net_ops = {
234 .init = nsim_fib_netns_init, 234 .init = nsim_fib_netns_init,
235 .id = &nsim_fib_net_id, 235 .id = &nsim_fib_net_id,
236 .size = sizeof(struct nsim_fib_data), 236 .size = sizeof(struct nsim_fib_data),
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 9564916d2d7b..f77a2d9e7f9d 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -21,8 +21,10 @@
21 * If both the fiber and copper ports are connected, the first to gain 21 * If both the fiber and copper ports are connected, the first to gain
22 * link takes priority and the other port is completely locked out. 22 * link takes priority and the other port is completely locked out.
23 */ 23 */
24#include <linux/phy.h> 24#include <linux/ctype.h>
25#include <linux/hwmon.h>
25#include <linux/marvell_phy.h> 26#include <linux/marvell_phy.h>
27#include <linux/phy.h>
26 28
27enum { 29enum {
28 MV_PCS_BASE_T = 0x0000, 30 MV_PCS_BASE_T = 0x0000,
@@ -40,6 +42,19 @@ enum {
40 */ 42 */
41 MV_AN_CTRL1000 = 0x8000, /* 1000base-T control register */ 43 MV_AN_CTRL1000 = 0x8000, /* 1000base-T control register */
42 MV_AN_STAT1000 = 0x8001, /* 1000base-T status register */ 44 MV_AN_STAT1000 = 0x8001, /* 1000base-T status register */
45
46 /* Vendor2 MMD registers */
47 MV_V2_TEMP_CTRL = 0xf08a,
48 MV_V2_TEMP_CTRL_MASK = 0xc000,
49 MV_V2_TEMP_CTRL_SAMPLE = 0x0000,
50 MV_V2_TEMP_CTRL_DISABLE = 0xc000,
51 MV_V2_TEMP = 0xf08c,
52 MV_V2_TEMP_UNKNOWN = 0x9600, /* unknown function */
53};
54
55struct mv3310_priv {
56 struct device *hwmon_dev;
57 char *hwmon_name;
43}; 58};
44 59
45static int mv3310_modify(struct phy_device *phydev, int devad, u16 reg, 60static int mv3310_modify(struct phy_device *phydev, int devad, u16 reg,
@@ -60,17 +75,180 @@ static int mv3310_modify(struct phy_device *phydev, int devad, u16 reg,
60 return ret < 0 ? ret : 1; 75 return ret < 0 ? ret : 1;
61} 76}
62 77
78#ifdef CONFIG_HWMON
79static umode_t mv3310_hwmon_is_visible(const void *data,
80 enum hwmon_sensor_types type,
81 u32 attr, int channel)
82{
83 if (type == hwmon_chip && attr == hwmon_chip_update_interval)
84 return 0444;
85 if (type == hwmon_temp && attr == hwmon_temp_input)
86 return 0444;
87 return 0;
88}
89
90static int mv3310_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
91 u32 attr, int channel, long *value)
92{
93 struct phy_device *phydev = dev_get_drvdata(dev);
94 int temp;
95
96 if (type == hwmon_chip && attr == hwmon_chip_update_interval) {
97 *value = MSEC_PER_SEC;
98 return 0;
99 }
100
101 if (type == hwmon_temp && attr == hwmon_temp_input) {
102 temp = phy_read_mmd(phydev, MDIO_MMD_VEND2, MV_V2_TEMP);
103 if (temp < 0)
104 return temp;
105
106 *value = ((temp & 0xff) - 75) * 1000;
107
108 return 0;
109 }
110
111 return -EOPNOTSUPP;
112}
113
114static const struct hwmon_ops mv3310_hwmon_ops = {
115 .is_visible = mv3310_hwmon_is_visible,
116 .read = mv3310_hwmon_read,
117};
118
119static u32 mv3310_hwmon_chip_config[] = {
120 HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL,
121 0,
122};
123
124static const struct hwmon_channel_info mv3310_hwmon_chip = {
125 .type = hwmon_chip,
126 .config = mv3310_hwmon_chip_config,
127};
128
129static u32 mv3310_hwmon_temp_config[] = {
130 HWMON_T_INPUT,
131 0,
132};
133
134static const struct hwmon_channel_info mv3310_hwmon_temp = {
135 .type = hwmon_temp,
136 .config = mv3310_hwmon_temp_config,
137};
138
139static const struct hwmon_channel_info *mv3310_hwmon_info[] = {
140 &mv3310_hwmon_chip,
141 &mv3310_hwmon_temp,
142 NULL,
143};
144
145static const struct hwmon_chip_info mv3310_hwmon_chip_info = {
146 .ops = &mv3310_hwmon_ops,
147 .info = mv3310_hwmon_info,
148};
149
150static int mv3310_hwmon_config(struct phy_device *phydev, bool enable)
151{
152 u16 val;
153 int ret;
154
155 ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, MV_V2_TEMP,
156 MV_V2_TEMP_UNKNOWN);
157 if (ret < 0)
158 return ret;
159
160 val = enable ? MV_V2_TEMP_CTRL_SAMPLE : MV_V2_TEMP_CTRL_DISABLE;
161 ret = mv3310_modify(phydev, MDIO_MMD_VEND2, MV_V2_TEMP_CTRL,
162 MV_V2_TEMP_CTRL_MASK, val);
163
164 return ret < 0 ? ret : 0;
165}
166
167static void mv3310_hwmon_disable(void *data)
168{
169 struct phy_device *phydev = data;
170
171 mv3310_hwmon_config(phydev, false);
172}
173
174static int mv3310_hwmon_probe(struct phy_device *phydev)
175{
176 struct device *dev = &phydev->mdio.dev;
177 struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
178 int i, j, ret;
179
180 priv->hwmon_name = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL);
181 if (!priv->hwmon_name)
182 return -ENODEV;
183
184 for (i = j = 0; priv->hwmon_name[i]; i++) {
185 if (isalnum(priv->hwmon_name[i])) {
186 if (i != j)
187 priv->hwmon_name[j] = priv->hwmon_name[i];
188 j++;
189 }
190 }
191 priv->hwmon_name[j] = '\0';
192
193 ret = mv3310_hwmon_config(phydev, true);
194 if (ret)
195 return ret;
196
197 ret = devm_add_action_or_reset(dev, mv3310_hwmon_disable, phydev);
198 if (ret)
199 return ret;
200
201 priv->hwmon_dev = devm_hwmon_device_register_with_info(dev,
202 priv->hwmon_name, phydev,
203 &mv3310_hwmon_chip_info, NULL);
204
205 return PTR_ERR_OR_ZERO(priv->hwmon_dev);
206}
207#else
208static inline int mv3310_hwmon_config(struct phy_device *phydev, bool enable)
209{
210 return 0;
211}
212
213static int mv3310_hwmon_probe(struct phy_device *phydev)
214{
215 return 0;
216}
217#endif
218
63static int mv3310_probe(struct phy_device *phydev) 219static int mv3310_probe(struct phy_device *phydev)
64{ 220{
221 struct mv3310_priv *priv;
65 u32 mmd_mask = MDIO_DEVS_PMAPMD | MDIO_DEVS_AN; 222 u32 mmd_mask = MDIO_DEVS_PMAPMD | MDIO_DEVS_AN;
223 int ret;
66 224
67 if (!phydev->is_c45 || 225 if (!phydev->is_c45 ||
68 (phydev->c45_ids.devices_in_package & mmd_mask) != mmd_mask) 226 (phydev->c45_ids.devices_in_package & mmd_mask) != mmd_mask)
69 return -ENODEV; 227 return -ENODEV;
70 228
229 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL);
230 if (!priv)
231 return -ENOMEM;
232
233 dev_set_drvdata(&phydev->mdio.dev, priv);
234
235 ret = mv3310_hwmon_probe(phydev);
236 if (ret)
237 return ret;
238
239 return 0;
240}
241
242static int mv3310_suspend(struct phy_device *phydev)
243{
71 return 0; 244 return 0;
72} 245}
73 246
247static int mv3310_resume(struct phy_device *phydev)
248{
249 return mv3310_hwmon_config(phydev, true);
250}
251
74static int mv3310_config_init(struct phy_device *phydev) 252static int mv3310_config_init(struct phy_device *phydev)
75{ 253{
76 __ETHTOOL_DECLARE_LINK_MODE_MASK(supported) = { 0, }; 254 __ETHTOOL_DECLARE_LINK_MODE_MASK(supported) = { 0, };
@@ -367,9 +545,11 @@ static struct phy_driver mv3310_drivers[] = {
367 SUPPORTED_FIBRE | 545 SUPPORTED_FIBRE |
368 SUPPORTED_10000baseT_Full | 546 SUPPORTED_10000baseT_Full |
369 SUPPORTED_Backplane, 547 SUPPORTED_Backplane,
370 .probe = mv3310_probe,
371 .soft_reset = gen10g_no_soft_reset, 548 .soft_reset = gen10g_no_soft_reset,
372 .config_init = mv3310_config_init, 549 .config_init = mv3310_config_init,
550 .probe = mv3310_probe,
551 .suspend = mv3310_suspend,
552 .resume = mv3310_resume,
373 .config_aneg = mv3310_config_aneg, 553 .config_aneg = mv3310_config_aneg,
374 .aneg_done = mv3310_aneg_done, 554 .aneg_done = mv3310_aneg_done,
375 .read_status = mv3310_read_status, 555 .read_status = mv3310_read_status,
diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index 8249d46a7844..c4267ecefd85 100644
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -464,7 +464,6 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr,
464 po->chan.mtu = dst_mtu(&rt->dst); 464 po->chan.mtu = dst_mtu(&rt->dst);
465 if (!po->chan.mtu) 465 if (!po->chan.mtu)
466 po->chan.mtu = PPP_MRU; 466 po->chan.mtu = PPP_MRU;
467 ip_rt_put(rt);
468 po->chan.mtu -= PPTP_HEADER_OVERHEAD; 467 po->chan.mtu -= PPTP_HEADER_OVERHEAD;
469 468
470 po->chan.hdrlen = 2 + sizeof(struct pptp_gre_header); 469 po->chan.hdrlen = 2 + sizeof(struct pptp_gre_header);
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index 55a78eb96961..aff105f5f58c 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2082,10 +2082,6 @@ static int lan78xx_phy_init(struct lan78xx_net *dev)
2082 2082
2083 dev->fc_autoneg = phydev->autoneg; 2083 dev->fc_autoneg = phydev->autoneg;
2084 2084
2085 phy_start(phydev);
2086
2087 netif_dbg(dev, ifup, dev->net, "phy initialised successfully");
2088
2089 return 0; 2085 return 0;
2090 2086
2091error: 2087error:
@@ -2522,9 +2518,9 @@ static int lan78xx_open(struct net_device *net)
2522 if (ret < 0) 2518 if (ret < 0)
2523 goto done; 2519 goto done;
2524 2520
2525 ret = lan78xx_phy_init(dev); 2521 phy_start(net->phydev);
2526 if (ret < 0) 2522
2527 goto done; 2523 netif_dbg(dev, ifup, dev->net, "phy initialised successfully");
2528 2524
2529 /* for Link Check */ 2525 /* for Link Check */
2530 if (dev->urb_intr) { 2526 if (dev->urb_intr) {
@@ -2585,13 +2581,8 @@ static int lan78xx_stop(struct net_device *net)
2585 if (timer_pending(&dev->stat_monitor)) 2581 if (timer_pending(&dev->stat_monitor))
2586 del_timer_sync(&dev->stat_monitor); 2582 del_timer_sync(&dev->stat_monitor);
2587 2583
2588 phy_unregister_fixup_for_uid(PHY_KSZ9031RNX, 0xfffffff0); 2584 if (net->phydev)
2589 phy_unregister_fixup_for_uid(PHY_LAN8835, 0xfffffff0); 2585 phy_stop(net->phydev);
2590
2591 phy_stop(net->phydev);
2592 phy_disconnect(net->phydev);
2593
2594 net->phydev = NULL;
2595 2586
2596 clear_bit(EVENT_DEV_OPEN, &dev->flags); 2587 clear_bit(EVENT_DEV_OPEN, &dev->flags);
2597 netif_stop_queue(net); 2588 netif_stop_queue(net);
@@ -3506,8 +3497,13 @@ static void lan78xx_disconnect(struct usb_interface *intf)
3506 return; 3497 return;
3507 3498
3508 udev = interface_to_usbdev(intf); 3499 udev = interface_to_usbdev(intf);
3509
3510 net = dev->net; 3500 net = dev->net;
3501
3502 phy_unregister_fixup_for_uid(PHY_KSZ9031RNX, 0xfffffff0);
3503 phy_unregister_fixup_for_uid(PHY_LAN8835, 0xfffffff0);
3504
3505 phy_disconnect(net->phydev);
3506
3511 unregister_netdev(net); 3507 unregister_netdev(net);
3512 3508
3513 cancel_delayed_work_sync(&dev->wq); 3509 cancel_delayed_work_sync(&dev->wq);
@@ -3663,8 +3659,14 @@ static int lan78xx_probe(struct usb_interface *intf,
3663 pm_runtime_set_autosuspend_delay(&udev->dev, 3659 pm_runtime_set_autosuspend_delay(&udev->dev,
3664 DEFAULT_AUTOSUSPEND_DELAY); 3660 DEFAULT_AUTOSUSPEND_DELAY);
3665 3661
3662 ret = lan78xx_phy_init(dev);
3663 if (ret < 0)
3664 goto out4;
3665
3666 return 0; 3666 return 0;
3667 3667
3668out4:
3669 unregister_netdev(netdev);
3668out3: 3670out3:
3669 lan78xx_unbind(dev, intf); 3671 lan78xx_unbind(dev, intf);
3670out2: 3672out2:
@@ -4012,7 +4014,7 @@ static int lan78xx_reset_resume(struct usb_interface *intf)
4012 4014
4013 lan78xx_reset(dev); 4015 lan78xx_reset(dev);
4014 4016
4015 lan78xx_phy_init(dev); 4017 phy_start(dev->net->phydev);
4016 4018
4017 return lan78xx_resume(intf); 4019 return lan78xx_resume(intf);
4018} 4020}
diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig
index ff505af064ba..55cf64ee7f7b 100644
--- a/drivers/nvmem/Kconfig
+++ b/drivers/nvmem/Kconfig
@@ -1,5 +1,5 @@
1menuconfig NVMEM 1menuconfig NVMEM
2 tristate "NVMEM Support" 2 bool "NVMEM Support"
3 help 3 help
4 Support for NVMEM(Non Volatile Memory) devices like EEPROM, EFUSES... 4 Support for NVMEM(Non Volatile Memory) devices like EEPROM, EFUSES...
5 5
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 0084013d6bed..08b132381984 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -214,6 +214,9 @@ static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
214#endif 214#endif
215} 215}
216 216
217void ip6_sk_dst_store_flow(struct sock *sk, struct dst_entry *dst,
218 const struct flowi6 *fl6);
219
217static inline bool ipv6_unicast_destination(const struct sk_buff *skb) 220static inline bool ipv6_unicast_destination(const struct sk_buff *skb)
218{ 221{
219 struct rt6_info *rt = (struct rt6_info *) skb_dst(skb); 222 struct rt6_info *rt = (struct rt6_info *) skb_dst(skb);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 9b6e7f51b1d4..836f31af1369 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -965,7 +965,8 @@ int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst,
965struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6, 965struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6,
966 const struct in6_addr *final_dst); 966 const struct in6_addr *final_dst);
967struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, 967struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
968 const struct in6_addr *final_dst); 968 const struct in6_addr *final_dst,
969 bool connected);
969struct dst_entry *ip6_blackhole_route(struct net *net, 970struct dst_entry *ip6_blackhole_route(struct net *net,
970 struct dst_entry *orig_dst); 971 struct dst_entry *orig_dst);
971 972
diff --git a/net/ieee802154/6lowpan/reassembly.c b/net/ieee802154/6lowpan/reassembly.c
index 44f148a6bb57..1790b65944b3 100644
--- a/net/ieee802154/6lowpan/reassembly.c
+++ b/net/ieee802154/6lowpan/reassembly.c
@@ -411,7 +411,6 @@ err:
411} 411}
412 412
413#ifdef CONFIG_SYSCTL 413#ifdef CONFIG_SYSCTL
414static long zero;
415 414
416static struct ctl_table lowpan_frags_ns_ctl_table[] = { 415static struct ctl_table lowpan_frags_ns_ctl_table[] = {
417 { 416 {
@@ -428,7 +427,6 @@ static struct ctl_table lowpan_frags_ns_ctl_table[] = {
428 .maxlen = sizeof(unsigned long), 427 .maxlen = sizeof(unsigned long),
429 .mode = 0644, 428 .mode = 0644,
430 .proc_handler = proc_doulongvec_minmax, 429 .proc_handler = proc_doulongvec_minmax,
431 .extra1 = &zero,
432 .extra2 = &init_net.ieee802154_lowpan.frags.high_thresh 430 .extra2 = &init_net.ieee802154_lowpan.frags.high_thresh
433 }, 431 },
434 { 432 {
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 994fa70a910f..8e9528ebaa8e 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -667,7 +667,7 @@ struct sk_buff *ip_check_defrag(struct net *net, struct sk_buff *skb, u32 user)
667EXPORT_SYMBOL(ip_check_defrag); 667EXPORT_SYMBOL(ip_check_defrag);
668 668
669#ifdef CONFIG_SYSCTL 669#ifdef CONFIG_SYSCTL
670static long zero; 670static int dist_min;
671 671
672static struct ctl_table ip4_frags_ns_ctl_table[] = { 672static struct ctl_table ip4_frags_ns_ctl_table[] = {
673 { 673 {
@@ -684,7 +684,6 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = {
684 .maxlen = sizeof(unsigned long), 684 .maxlen = sizeof(unsigned long),
685 .mode = 0644, 685 .mode = 0644,
686 .proc_handler = proc_doulongvec_minmax, 686 .proc_handler = proc_doulongvec_minmax,
687 .extra1 = &zero,
688 .extra2 = &init_net.ipv4.frags.high_thresh 687 .extra2 = &init_net.ipv4.frags.high_thresh
689 }, 688 },
690 { 689 {
@@ -700,7 +699,7 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = {
700 .maxlen = sizeof(int), 699 .maxlen = sizeof(int),
701 .mode = 0644, 700 .mode = 0644,
702 .proc_handler = proc_dointvec_minmax, 701 .proc_handler = proc_dointvec_minmax,
703 .extra1 = &zero 702 .extra1 = &dist_min,
704 }, 703 },
705 { } 704 { }
706}; 705};
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 94cacae76aca..4c11b810a447 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1090,7 +1090,8 @@ alloc_new_skb:
1090 length -= copy; 1090 length -= copy;
1091 } 1091 }
1092 1092
1093 refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc); 1093 if (wmem_alloc_delta)
1094 refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc);
1094 return 0; 1095 return 0;
1095 1096
1096error_efault: 1097error_efault:
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 88bc2ef7c7a8..a02ad100f0d7 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -106,14 +106,7 @@ int ip6_datagram_dst_update(struct sock *sk, bool fix_sk_saddr)
106 } 106 }
107 } 107 }
108 108
109 ip6_dst_store(sk, dst, 109 ip6_sk_dst_store_flow(sk, dst, &fl6);
110 ipv6_addr_equal(&fl6.daddr, &sk->sk_v6_daddr) ?
111 &sk->sk_v6_daddr : NULL,
112#ifdef CONFIG_IPV6_SUBTREES
113 ipv6_addr_equal(&fl6.saddr, &np->saddr) ?
114 &np->saddr :
115#endif
116 NULL);
117 110
118out: 111out:
119 fl6_sock_release(flowlabel); 112 fl6_sock_release(flowlabel);
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index e6eaa4dd9f60..b8ee50e94af3 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1105,23 +1105,32 @@ EXPORT_SYMBOL_GPL(ip6_dst_lookup_flow);
1105 * @sk: socket which provides the dst cache and route info 1105 * @sk: socket which provides the dst cache and route info
1106 * @fl6: flow to lookup 1106 * @fl6: flow to lookup
1107 * @final_dst: final destination address for ipsec lookup 1107 * @final_dst: final destination address for ipsec lookup
1108 * @connected: whether @sk is connected or not
1108 * 1109 *
1109 * This function performs a route lookup on the given flow with the 1110 * This function performs a route lookup on the given flow with the
1110 * possibility of using the cached route in the socket if it is valid. 1111 * possibility of using the cached route in the socket if it is valid.
1111 * It will take the socket dst lock when operating on the dst cache. 1112 * It will take the socket dst lock when operating on the dst cache.
1112 * As a result, this function can only be used in process context. 1113 * As a result, this function can only be used in process context.
1113 * 1114 *
1115 * In addition, for a connected socket, cache the dst in the socket
1116 * if the current cache is not valid.
1117 *
1114 * It returns a valid dst pointer on success, or a pointer encoded 1118 * It returns a valid dst pointer on success, or a pointer encoded
1115 * error code. 1119 * error code.
1116 */ 1120 */
1117struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, 1121struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
1118 const struct in6_addr *final_dst) 1122 const struct in6_addr *final_dst,
1123 bool connected)
1119{ 1124{
1120 struct dst_entry *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie); 1125 struct dst_entry *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie);
1121 1126
1122 dst = ip6_sk_dst_check(sk, dst, fl6); 1127 dst = ip6_sk_dst_check(sk, dst, fl6);
1123 if (!dst) 1128 if (dst)
1124 dst = ip6_dst_lookup_flow(sk, fl6, final_dst); 1129 return dst;
1130
1131 dst = ip6_dst_lookup_flow(sk, fl6, final_dst);
1132 if (connected && !IS_ERR(dst))
1133 ip6_sk_dst_store_flow(sk, dst_clone(dst), fl6);
1125 1134
1126 return dst; 1135 return dst;
1127} 1136}
@@ -1536,7 +1545,8 @@ alloc_new_skb:
1536 length -= copy; 1545 length -= copy;
1537 } 1546 }
1538 1547
1539 refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc); 1548 if (wmem_alloc_delta)
1549 refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc);
1540 return 0; 1550 return 0;
1541 1551
1542error_efault: 1552error_efault:
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 3622aac343ae..5e0332014c17 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -55,7 +55,6 @@ static const char nf_frags_cache_name[] = "nf-frags";
55static struct inet_frags nf_frags; 55static struct inet_frags nf_frags;
56 56
57#ifdef CONFIG_SYSCTL 57#ifdef CONFIG_SYSCTL
58static long zero;
59 58
60static struct ctl_table nf_ct_frag6_sysctl_table[] = { 59static struct ctl_table nf_ct_frag6_sysctl_table[] = {
61 { 60 {
@@ -71,7 +70,6 @@ static struct ctl_table nf_ct_frag6_sysctl_table[] = {
71 .maxlen = sizeof(unsigned long), 70 .maxlen = sizeof(unsigned long),
72 .mode = 0644, 71 .mode = 0644,
73 .proc_handler = proc_doulongvec_minmax, 72 .proc_handler = proc_doulongvec_minmax,
74 .extra1 = &zero,
75 .extra2 = &init_net.nf_frag.frags.high_thresh 73 .extra2 = &init_net.nf_frag.frags.high_thresh
76 }, 74 },
77 { 75 {
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index d12c55dad7d1..746eeae7f581 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -121,7 +121,7 @@ static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
121 ipc6.tclass = np->tclass; 121 ipc6.tclass = np->tclass;
122 fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel); 122 fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel);
123 123
124 dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr); 124 dst = ip6_sk_dst_lookup_flow(sk, &fl6, daddr, false);
125 if (IS_ERR(dst)) 125 if (IS_ERR(dst))
126 return PTR_ERR(dst); 126 return PTR_ERR(dst);
127 rt = (struct rt6_info *) dst; 127 rt = (struct rt6_info *) dst;
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 70e4a578b2fb..4979610287e2 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -548,7 +548,6 @@ static const struct inet6_protocol frag_protocol = {
548}; 548};
549 549
550#ifdef CONFIG_SYSCTL 550#ifdef CONFIG_SYSCTL
551static int zero;
552 551
553static struct ctl_table ip6_frags_ns_ctl_table[] = { 552static struct ctl_table ip6_frags_ns_ctl_table[] = {
554 { 553 {
@@ -565,7 +564,6 @@ static struct ctl_table ip6_frags_ns_ctl_table[] = {
565 .maxlen = sizeof(unsigned long), 564 .maxlen = sizeof(unsigned long),
566 .mode = 0644, 565 .mode = 0644,
567 .proc_handler = proc_doulongvec_minmax, 566 .proc_handler = proc_doulongvec_minmax,
568 .extra1 = &zero,
569 .extra2 = &init_net.ipv6.frags.high_thresh 567 .extra2 = &init_net.ipv6.frags.high_thresh
570 }, 568 },
571 { 569 {
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f239f91d2efb..49b954d6d0fa 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2229,6 +2229,23 @@ void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, __be32 mtu)
2229} 2229}
2230EXPORT_SYMBOL_GPL(ip6_sk_update_pmtu); 2230EXPORT_SYMBOL_GPL(ip6_sk_update_pmtu);
2231 2231
2232void ip6_sk_dst_store_flow(struct sock *sk, struct dst_entry *dst,
2233 const struct flowi6 *fl6)
2234{
2235#ifdef CONFIG_IPV6_SUBTREES
2236 struct ipv6_pinfo *np = inet6_sk(sk);
2237#endif
2238
2239 ip6_dst_store(sk, dst,
2240 ipv6_addr_equal(&fl6->daddr, &sk->sk_v6_daddr) ?
2241 &sk->sk_v6_daddr : NULL,
2242#ifdef CONFIG_IPV6_SUBTREES
2243 ipv6_addr_equal(&fl6->saddr, &np->saddr) ?
2244 &np->saddr :
2245#endif
2246 NULL);
2247}
2248
2232/* Handle redirects */ 2249/* Handle redirects */
2233struct ip6rd_flowi { 2250struct ip6rd_flowi {
2234 struct flowi6 fl6; 2251 struct flowi6 fl6;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 6861ed479469..4ec76a87aeb8 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1116,10 +1116,10 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
1116 struct dst_entry *dst; 1116 struct dst_entry *dst;
1117 struct ipcm6_cookie ipc6; 1117 struct ipcm6_cookie ipc6;
1118 int addr_len = msg->msg_namelen; 1118 int addr_len = msg->msg_namelen;
1119 bool connected = false;
1119 int ulen = len; 1120 int ulen = len;
1120 int corkreq = up->corkflag || msg->msg_flags&MSG_MORE; 1121 int corkreq = up->corkflag || msg->msg_flags&MSG_MORE;
1121 int err; 1122 int err;
1122 int connected = 0;
1123 int is_udplite = IS_UDPLITE(sk); 1123 int is_udplite = IS_UDPLITE(sk);
1124 int (*getfrag)(void *, char *, int, int, int, struct sk_buff *); 1124 int (*getfrag)(void *, char *, int, int, int, struct sk_buff *);
1125 struct sockcm_cookie sockc; 1125 struct sockcm_cookie sockc;
@@ -1241,7 +1241,7 @@ do_udp_sendmsg:
1241 fl6.fl6_dport = inet->inet_dport; 1241 fl6.fl6_dport = inet->inet_dport;
1242 daddr = &sk->sk_v6_daddr; 1242 daddr = &sk->sk_v6_daddr;
1243 fl6.flowlabel = np->flow_label; 1243 fl6.flowlabel = np->flow_label;
1244 connected = 1; 1244 connected = true;
1245 } 1245 }
1246 1246
1247 if (!fl6.flowi6_oif) 1247 if (!fl6.flowi6_oif)
@@ -1271,7 +1271,7 @@ do_udp_sendmsg:
1271 } 1271 }
1272 if (!(opt->opt_nflen|opt->opt_flen)) 1272 if (!(opt->opt_nflen|opt->opt_flen))
1273 opt = NULL; 1273 opt = NULL;
1274 connected = 0; 1274 connected = false;
1275 } 1275 }
1276 if (!opt) { 1276 if (!opt) {
1277 opt = txopt_get(np); 1277 opt = txopt_get(np);
@@ -1293,11 +1293,11 @@ do_udp_sendmsg:
1293 1293
1294 final_p = fl6_update_dst(&fl6, opt, &final); 1294 final_p = fl6_update_dst(&fl6, opt, &final);
1295 if (final_p) 1295 if (final_p)
1296 connected = 0; 1296 connected = false;
1297 1297
1298 if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr)) { 1298 if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr)) {
1299 fl6.flowi6_oif = np->mcast_oif; 1299 fl6.flowi6_oif = np->mcast_oif;
1300 connected = 0; 1300 connected = false;
1301 } else if (!fl6.flowi6_oif) 1301 } else if (!fl6.flowi6_oif)
1302 fl6.flowi6_oif = np->ucast_oif; 1302 fl6.flowi6_oif = np->ucast_oif;
1303 1303
@@ -1308,7 +1308,7 @@ do_udp_sendmsg:
1308 1308
1309 fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel); 1309 fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel);
1310 1310
1311 dst = ip6_sk_dst_lookup_flow(sk, &fl6, final_p); 1311 dst = ip6_sk_dst_lookup_flow(sk, &fl6, final_p, connected);
1312 if (IS_ERR(dst)) { 1312 if (IS_ERR(dst)) {
1313 err = PTR_ERR(dst); 1313 err = PTR_ERR(dst);
1314 dst = NULL; 1314 dst = NULL;
@@ -1333,7 +1333,7 @@ back_from_confirm:
1333 err = PTR_ERR(skb); 1333 err = PTR_ERR(skb);
1334 if (!IS_ERR_OR_NULL(skb)) 1334 if (!IS_ERR_OR_NULL(skb))
1335 err = udp_v6_send_skb(skb, &fl6); 1335 err = udp_v6_send_skb(skb, &fl6);
1336 goto release_dst; 1336 goto out;
1337 } 1337 }
1338 1338
1339 lock_sock(sk); 1339 lock_sock(sk);
@@ -1367,23 +1367,6 @@ do_append_data:
1367 err = np->recverr ? net_xmit_errno(err) : 0; 1367 err = np->recverr ? net_xmit_errno(err) : 0;
1368 release_sock(sk); 1368 release_sock(sk);
1369 1369
1370release_dst:
1371 if (dst) {
1372 if (connected) {
1373 ip6_dst_store(sk, dst,
1374 ipv6_addr_equal(&fl6.daddr, &sk->sk_v6_daddr) ?
1375 &sk->sk_v6_daddr : NULL,
1376#ifdef CONFIG_IPV6_SUBTREES
1377 ipv6_addr_equal(&fl6.saddr, &np->saddr) ?
1378 &np->saddr :
1379#endif
1380 NULL);
1381 } else {
1382 dst_release(dst);
1383 }
1384 dst = NULL;
1385 }
1386
1387out: 1370out:
1388 dst_release(dst); 1371 dst_release(dst);
1389 fl6_sock_release(flowlabel); 1372 fl6_sock_release(flowlabel);
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index 21800e6f5019..0410d2277ca2 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -1200,6 +1200,12 @@ void rxrpc_data_ready(struct sock *udp_sk)
1200 !rxrpc_validate_jumbo(skb)) 1200 !rxrpc_validate_jumbo(skb))
1201 goto bad_message; 1201 goto bad_message;
1202 break; 1202 break;
1203
1204 /* Packet types 9-11 should just be ignored. */
1205 case RXRPC_PACKET_TYPE_PARAMS:
1206 case RXRPC_PACKET_TYPE_10:
1207 case RXRPC_PACKET_TYPE_11:
1208 goto discard;
1203 } 1209 }
1204 1210
1205 rcu_read_lock(); 1211 rcu_read_lock();
diff --git a/net/rxrpc/protocol.h b/net/rxrpc/protocol.h
index 4bddcf3face3..93da73bf7098 100644
--- a/net/rxrpc/protocol.h
+++ b/net/rxrpc/protocol.h
@@ -46,6 +46,9 @@ struct rxrpc_wire_header {
46#define RXRPC_PACKET_TYPE_CHALLENGE 6 /* connection security challenge (SRVR->CLNT) */ 46#define RXRPC_PACKET_TYPE_CHALLENGE 6 /* connection security challenge (SRVR->CLNT) */
47#define RXRPC_PACKET_TYPE_RESPONSE 7 /* connection secutity response (CLNT->SRVR) */ 47#define RXRPC_PACKET_TYPE_RESPONSE 7 /* connection secutity response (CLNT->SRVR) */
48#define RXRPC_PACKET_TYPE_DEBUG 8 /* debug info request */ 48#define RXRPC_PACKET_TYPE_DEBUG 8 /* debug info request */
49#define RXRPC_PACKET_TYPE_PARAMS 9 /* Parameter negotiation (unspec'd, ignore) */
50#define RXRPC_PACKET_TYPE_10 10 /* Ignored */
51#define RXRPC_PACKET_TYPE_11 11 /* Ignored */
49#define RXRPC_PACKET_TYPE_VERSION 13 /* version string request */ 52#define RXRPC_PACKET_TYPE_VERSION 13 /* version string request */
50#define RXRPC_N_PACKET_TYPES 14 /* number of packet types (incl type 0) */ 53#define RXRPC_N_PACKET_TYPES 14 /* number of packet types (incl type 0) */
51 54
@@ -78,6 +81,9 @@ struct rxrpc_wire_header {
78 (1 << RXRPC_PACKET_TYPE_CHALLENGE) | \ 81 (1 << RXRPC_PACKET_TYPE_CHALLENGE) | \
79 (1 << RXRPC_PACKET_TYPE_RESPONSE) | \ 82 (1 << RXRPC_PACKET_TYPE_RESPONSE) | \
80 /*(1 << RXRPC_PACKET_TYPE_DEBUG) | */ \ 83 /*(1 << RXRPC_PACKET_TYPE_DEBUG) | */ \
84 (1 << RXRPC_PACKET_TYPE_PARAMS) | \
85 (1 << RXRPC_PACKET_TYPE_10) | \
86 (1 << RXRPC_PACKET_TYPE_11) | \
81 (1 << RXRPC_PACKET_TYPE_VERSION)) 87 (1 << RXRPC_PACKET_TYPE_VERSION))
82 88
83/*****************************************************************************/ 89/*****************************************************************************/
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 3e5eba30865e..cee6674a3bf4 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -3280,7 +3280,8 @@ int tipc_sk_fill_sock_diag(struct sk_buff *skb, struct tipc_sock *tsk,
3280 nla_put_u32(skb, TIPC_NLA_SOCK_TIPC_STATE, (u32)sk->sk_state) || 3280 nla_put_u32(skb, TIPC_NLA_SOCK_TIPC_STATE, (u32)sk->sk_state) ||
3281 nla_put_u32(skb, TIPC_NLA_SOCK_INO, sock_i_ino(sk)) || 3281 nla_put_u32(skb, TIPC_NLA_SOCK_INO, sock_i_ino(sk)) ||
3282 nla_put_u32(skb, TIPC_NLA_SOCK_UID, 3282 nla_put_u32(skb, TIPC_NLA_SOCK_UID,
3283 from_kuid_munged(sk_user_ns(sk), sock_i_uid(sk))) || 3283 from_kuid_munged(sk_user_ns(NETLINK_CB(skb).sk),
3284 sock_i_uid(sk))) ||
3284 nla_put_u64_64bit(skb, TIPC_NLA_SOCK_COOKIE, 3285 nla_put_u64_64bit(skb, TIPC_NLA_SOCK_COOKIE,
3285 tipc_diag_gen_cookie(sk), 3286 tipc_diag_gen_cookie(sk),
3286 TIPC_NLA_SOCK_PAD)) 3287 TIPC_NLA_SOCK_PAD))
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 6925a989569b..b7d80bc5f4ab 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -145,6 +145,8 @@ struct tipc_subscription *tipc_sub_subscribe(struct net *net,
145 pr_warn("Subscription rejected, no memory\n"); 145 pr_warn("Subscription rejected, no memory\n");
146 return NULL; 146 return NULL;
147 } 147 }
148 INIT_LIST_HEAD(&sub->service_list);
149 INIT_LIST_HEAD(&sub->sub_list);
148 sub->net = net; 150 sub->net = net;
149 sub->conid = conid; 151 sub->conid = conid;
150 sub->inactive = false; 152 sub->inactive = false;
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index aded82da1aea..68bb70a62afe 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -745,14 +745,6 @@ static struct proto unix_proto = {
745 .obj_size = sizeof(struct unix_sock), 745 .obj_size = sizeof(struct unix_sock),
746}; 746};
747 747
748/*
749 * AF_UNIX sockets do not interact with hardware, hence they
750 * dont trigger interrupts - so it's safe for them to have
751 * bh-unsafe locking for their sk_receive_queue.lock. Split off
752 * this special lock-class by reinitializing the spinlock key:
753 */
754static struct lock_class_key af_unix_sk_receive_queue_lock_key;
755
756static struct sock *unix_create1(struct net *net, struct socket *sock, int kern) 748static struct sock *unix_create1(struct net *net, struct socket *sock, int kern)
757{ 749{
758 struct sock *sk = NULL; 750 struct sock *sk = NULL;
@@ -767,8 +759,6 @@ static struct sock *unix_create1(struct net *net, struct socket *sock, int kern)
767 goto out; 759 goto out;
768 760
769 sock_init_data(sock, sk); 761 sock_init_data(sock, sk);
770 lockdep_set_class(&sk->sk_receive_queue.lock,
771 &af_unix_sk_receive_queue_lock_key);
772 762
773 sk->sk_allocation = GFP_KERNEL_ACCOUNT; 763 sk->sk_allocation = GFP_KERNEL_ACCOUNT;
774 sk->sk_write_space = unix_write_space; 764 sk->sk_write_space = unix_write_space;