Skip to content

Commit d06faf0

Browse files
committed
Merge remote-tracking branch 'stable/linux-4.4.y' into rpi-4.4.y
2 parents 6d6d3e9 + 4686ea2 commit d06faf0

File tree

22 files changed

+141
-55
lines changed

22 files changed

+141
-55
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 46
3+
SUBLEVEL = 47
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

drivers/net/ethernet/broadcom/bcmsysport.c

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -732,11 +732,8 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv,
732732
unsigned int c_index, last_c_index, last_tx_cn, num_tx_cbs;
733733
unsigned int pkts_compl = 0, bytes_compl = 0;
734734
struct bcm_sysport_cb *cb;
735-
struct netdev_queue *txq;
736735
u32 hw_ind;
737736

738-
txq = netdev_get_tx_queue(ndev, ring->index);
739-
740737
/* Compute how many descriptors have been processed since last call */
741738
hw_ind = tdma_readl(priv, TDMA_DESC_RING_PROD_CONS_INDEX(ring->index));
742739
c_index = (hw_ind >> RING_CONS_INDEX_SHIFT) & RING_CONS_INDEX_MASK;
@@ -767,9 +764,6 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv,
767764

768765
ring->c_index = c_index;
769766

770-
if (netif_tx_queue_stopped(txq) && pkts_compl)
771-
netif_tx_wake_queue(txq);
772-
773767
netif_dbg(priv, tx_done, ndev,
774768
"ring=%d c_index=%d pkts_compl=%d, bytes_compl=%d\n",
775769
ring->index, ring->c_index, pkts_compl, bytes_compl);
@@ -781,16 +775,33 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv,
781775
static unsigned int bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv,
782776
struct bcm_sysport_tx_ring *ring)
783777
{
778+
struct netdev_queue *txq;
784779
unsigned int released;
785780
unsigned long flags;
786781

782+
txq = netdev_get_tx_queue(priv->netdev, ring->index);
783+
787784
spin_lock_irqsave(&ring->lock, flags);
788785
released = __bcm_sysport_tx_reclaim(priv, ring);
786+
if (released)
787+
netif_tx_wake_queue(txq);
788+
789789
spin_unlock_irqrestore(&ring->lock, flags);
790790

791791
return released;
792792
}
793793

794+
/* Locked version of the per-ring TX reclaim, but does not wake the queue */
795+
static void bcm_sysport_tx_clean(struct bcm_sysport_priv *priv,
796+
struct bcm_sysport_tx_ring *ring)
797+
{
798+
unsigned long flags;
799+
800+
spin_lock_irqsave(&ring->lock, flags);
801+
__bcm_sysport_tx_reclaim(priv, ring);
802+
spin_unlock_irqrestore(&ring->lock, flags);
803+
}
804+
794805
static int bcm_sysport_tx_poll(struct napi_struct *napi, int budget)
795806
{
796807
struct bcm_sysport_tx_ring *ring =
@@ -1275,7 +1286,7 @@ static void bcm_sysport_fini_tx_ring(struct bcm_sysport_priv *priv,
12751286
napi_disable(&ring->napi);
12761287
netif_napi_del(&ring->napi);
12771288

1278-
bcm_sysport_tx_reclaim(priv, ring);
1289+
bcm_sysport_tx_clean(priv, ring);
12791290

12801291
kfree(ring->cbs);
12811292
ring->cbs = NULL;

drivers/net/ethernet/mellanox/mlxsw/pci.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,21 +206,21 @@ MLXSW_ITEM32(pci, eqe, owner, 0x0C, 0, 1);
206206
/* pci_eqe_cmd_token
207207
* Command completion event - token
208208
*/
209-
MLXSW_ITEM32(pci, eqe, cmd_token, 0x08, 16, 16);
209+
MLXSW_ITEM32(pci, eqe, cmd_token, 0x00, 16, 16);
210210

211211
/* pci_eqe_cmd_status
212212
* Command completion event - status
213213
*/
214-
MLXSW_ITEM32(pci, eqe, cmd_status, 0x08, 0, 8);
214+
MLXSW_ITEM32(pci, eqe, cmd_status, 0x00, 0, 8);
215215

216216
/* pci_eqe_cmd_out_param_h
217217
* Command completion event - output parameter - higher part
218218
*/
219-
MLXSW_ITEM32(pci, eqe, cmd_out_param_h, 0x0C, 0, 32);
219+
MLXSW_ITEM32(pci, eqe, cmd_out_param_h, 0x04, 0, 32);
220220

221221
/* pci_eqe_cmd_out_param_l
222222
* Command completion event - output parameter - lower part
223223
*/
224-
MLXSW_ITEM32(pci, eqe, cmd_out_param_l, 0x10, 0, 32);
224+
MLXSW_ITEM32(pci, eqe, cmd_out_param_l, 0x08, 0, 32);
225225

226226
#endif

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ static netdev_tx_t mlxsw_sp_port_xmit(struct sk_buff *skb,
390390
dev_kfree_skb_any(skb_orig);
391391
return NETDEV_TX_OK;
392392
}
393+
dev_consume_skb_any(skb_orig);
393394
}
394395

395396
if (eth_skb_pad(skb)) {

drivers/net/ethernet/mellanox/mlxsw/switchx2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ static netdev_tx_t mlxsw_sx_port_xmit(struct sk_buff *skb,
313313
dev_kfree_skb_any(skb_orig);
314314
return NETDEV_TX_OK;
315315
}
316+
dev_consume_skb_any(skb_orig);
316317
}
317318
mlxsw_sx_txhdr_construct(skb, &tx_info);
318319
len = skb->len;

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,19 @@ static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev)
13301330
buffer = PTR_ALIGN(priv->tx_align[q], DPTR_ALIGN) +
13311331
entry / NUM_TX_DESC * DPTR_ALIGN;
13321332
len = PTR_ALIGN(skb->data, DPTR_ALIGN) - skb->data;
1333+
/* Zero length DMA descriptors are problematic as they seem to
1334+
* terminate DMA transfers. Avoid them by simply using a length of
1335+
* DPTR_ALIGN (4) when skb data is aligned to DPTR_ALIGN.
1336+
*
1337+
* As skb is guaranteed to have at least ETH_ZLEN (60) bytes of
1338+
* data by the call to skb_put_padto() above this is safe with
1339+
* respect to both the length of the first DMA descriptor (len)
1340+
* overflowing the available data and the length of the second DMA
1341+
* descriptor (skb->len - len) being negative.
1342+
*/
1343+
if (len == 0)
1344+
len = DPTR_ALIGN;
1345+
13331346
memcpy(buffer, skb->data, len);
13341347
dma_addr = dma_map_single(ndev->dev.parent, buffer, len, DMA_TO_DEVICE);
13351348
if (dma_mapping_error(ndev->dev.parent, dma_addr))

drivers/net/phy/bcm63xx.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,23 @@ MODULE_DESCRIPTION("Broadcom 63xx internal PHY driver");
2121
MODULE_AUTHOR("Maxime Bizon <[email protected]>");
2222
MODULE_LICENSE("GPL");
2323

24+
static int bcm63xx_config_intr(struct phy_device *phydev)
25+
{
26+
int reg, err;
27+
28+
reg = phy_read(phydev, MII_BCM63XX_IR);
29+
if (reg < 0)
30+
return reg;
31+
32+
if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
33+
reg &= ~MII_BCM63XX_IR_GMASK;
34+
else
35+
reg |= MII_BCM63XX_IR_GMASK;
36+
37+
err = phy_write(phydev, MII_BCM63XX_IR, reg);
38+
return err;
39+
}
40+
2441
static int bcm63xx_config_init(struct phy_device *phydev)
2542
{
2643
int reg, err;
@@ -55,7 +72,7 @@ static struct phy_driver bcm63xx_driver[] = {
5572
.config_aneg = genphy_config_aneg,
5673
.read_status = genphy_read_status,
5774
.ack_interrupt = bcm_phy_ack_intr,
58-
.config_intr = bcm_phy_config_intr,
75+
.config_intr = bcm63xx_config_intr,
5976
.driver = { .owner = THIS_MODULE },
6077
}, {
6178
/* same phy as above, with just a different OUI */
@@ -68,7 +85,7 @@ static struct phy_driver bcm63xx_driver[] = {
6885
.config_aneg = genphy_config_aneg,
6986
.read_status = genphy_read_status,
7087
.ack_interrupt = bcm_phy_ack_intr,
71-
.config_intr = bcm_phy_config_intr,
88+
.config_intr = bcm63xx_config_intr,
7289
.driver = { .owner = THIS_MODULE },
7390
} };
7491

drivers/net/usb/cdc_ether.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ static const struct driver_info wwan_info = {
462462
#define SAMSUNG_VENDOR_ID 0x04e8
463463
#define LENOVO_VENDOR_ID 0x17ef
464464
#define NVIDIA_VENDOR_ID 0x0955
465+
#define HP_VENDOR_ID 0x03f0
465466

466467
static const struct usb_device_id products[] = {
467468
/* BLACKLIST !!
@@ -608,6 +609,13 @@ static const struct usb_device_id products[] = {
608609
.driver_info = 0,
609610
},
610611

612+
/* HP lt2523 (Novatel E371) - handled by qmi_wwan */
613+
{
614+
USB_DEVICE_AND_INTERFACE_INFO(HP_VENDOR_ID, 0x421d, USB_CLASS_COMM,
615+
USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
616+
.driver_info = 0,
617+
},
618+
611619
/* AnyDATA ADU960S - handled by qmi_wwan */
612620
{
613621
USB_DEVICE_AND_INTERFACE_INFO(0x16d5, 0x650a, USB_CLASS_COMM,

drivers/net/usb/qmi_wwan.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,13 @@ static const struct usb_device_id products[] = {
485485
USB_CDC_PROTO_NONE),
486486
.driver_info = (unsigned long)&qmi_wwan_info,
487487
},
488+
{ /* HP lt2523 (Novatel E371) */
489+
USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x421d,
490+
USB_CLASS_COMM,
491+
USB_CDC_SUBCLASS_ETHERNET,
492+
USB_CDC_PROTO_NONE),
493+
.driver_info = (unsigned long)&qmi_wwan_info,
494+
},
488495
{ /* HP lt4112 LTE/HSPA+ Gobi 4G Module (Huawei me906e) */
489496
USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7),
490497
.driver_info = (unsigned long)&qmi_wwan_info,

drivers/net/usb/r8152.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ static u8 r8152_rx_csum(struct r8152 *tp, struct rx_desc *rx_desc)
16451645
u8 checksum = CHECKSUM_NONE;
16461646
u32 opts2, opts3;
16471647

1648-
if (tp->version == RTL_VER_01)
1648+
if (!(tp->netdev->features & NETIF_F_RXCSUM))
16491649
goto return_result;
16501650

16511651
opts2 = le32_to_cpu(rx_desc->opts2);
@@ -3442,6 +3442,8 @@ static bool delay_autosuspend(struct r8152 *tp)
34423442
*/
34433443
if (!sw_linking && tp->rtl_ops.in_nway(tp))
34443444
return true;
3445+
else if (!skb_queue_empty(&tp->tx_queue))
3446+
return true;
34453447
else
34463448
return false;
34473449
}
@@ -4221,6 +4223,11 @@ static int rtl8152_probe(struct usb_interface *intf,
42214223
NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
42224224
NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
42234225

4226+
if (tp->version == RTL_VER_01) {
4227+
netdev->features &= ~NETIF_F_RXCSUM;
4228+
netdev->hw_features &= ~NETIF_F_RXCSUM;
4229+
}
4230+
42244231
netdev->ethtool_ops = &ops;
42254232
netif_set_gso_max_size(netdev, RTL_LIMITED_TSO_SIZE);
42264233

include/linux/tcp.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,13 @@ static inline unsigned int tcp_optlen(const struct sk_buff *skb)
5656

5757
/* TCP Fast Open Cookie as stored in memory */
5858
struct tcp_fastopen_cookie {
59+
union {
60+
u8 val[TCP_FASTOPEN_COOKIE_MAX];
61+
#if IS_ENABLED(CONFIG_IPV6)
62+
struct in6_addr addr;
63+
#endif
64+
};
5965
s8 len;
60-
u8 val[TCP_FASTOPEN_COOKIE_MAX];
6166
bool exp; /* In RFC6994 experimental option format */
6267
};
6368

net/ax25/ax25_subr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void ax25_disconnect(ax25_cb *ax25, int reason)
264264
{
265265
ax25_clear_queues(ax25);
266266

267-
if (!sock_flag(ax25->sk, SOCK_DESTROY))
267+
if (!ax25->sk || !sock_flag(ax25->sk, SOCK_DESTROY))
268268
ax25_stop_heartbeat(ax25);
269269
ax25_stop_t1timer(ax25);
270270
ax25_stop_t2timer(ax25);

net/bridge/br_netlink.c

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -773,20 +773,6 @@ static int br_validate(struct nlattr *tb[], struct nlattr *data[])
773773
return 0;
774774
}
775775

776-
static int br_dev_newlink(struct net *src_net, struct net_device *dev,
777-
struct nlattr *tb[], struct nlattr *data[])
778-
{
779-
struct net_bridge *br = netdev_priv(dev);
780-
781-
if (tb[IFLA_ADDRESS]) {
782-
spin_lock_bh(&br->lock);
783-
br_stp_change_bridge_id(br, nla_data(tb[IFLA_ADDRESS]));
784-
spin_unlock_bh(&br->lock);
785-
}
786-
787-
return register_netdevice(dev);
788-
}
789-
790776
static int br_port_slave_changelink(struct net_device *brdev,
791777
struct net_device *dev,
792778
struct nlattr *tb[],
@@ -1068,6 +1054,25 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[],
10681054
return 0;
10691055
}
10701056

1057+
static int br_dev_newlink(struct net *src_net, struct net_device *dev,
1058+
struct nlattr *tb[], struct nlattr *data[])
1059+
{
1060+
struct net_bridge *br = netdev_priv(dev);
1061+
int err;
1062+
1063+
if (tb[IFLA_ADDRESS]) {
1064+
spin_lock_bh(&br->lock);
1065+
br_stp_change_bridge_id(br, nla_data(tb[IFLA_ADDRESS]));
1066+
spin_unlock_bh(&br->lock);
1067+
}
1068+
1069+
err = br_changelink(dev, tb, data);
1070+
if (err)
1071+
return err;
1072+
1073+
return register_netdevice(dev);
1074+
}
1075+
10711076
static size_t br_get_size(const struct net_device *brdev)
10721077
{
10731078
return nla_total_size(sizeof(u32)) + /* IFLA_BR_FORWARD_DELAY */

net/core/dev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2650,9 +2650,9 @@ static netdev_features_t harmonize_features(struct sk_buff *skb,
26502650
if (skb->ip_summed != CHECKSUM_NONE &&
26512651
!can_checksum_protocol(features, type)) {
26522652
features &= ~NETIF_F_ALL_CSUM;
2653-
} else if (illegal_highdma(skb->dev, skb)) {
2654-
features &= ~NETIF_F_SG;
26552653
}
2654+
if (illegal_highdma(skb->dev, skb))
2655+
features &= ~NETIF_F_SG;
26562656

26572657
return features;
26582658
}

net/dsa/slave.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,8 @@ int dsa_slave_suspend(struct net_device *slave_dev)
11011101
{
11021102
struct dsa_slave_priv *p = netdev_priv(slave_dev);
11031103

1104+
netif_device_detach(slave_dev);
1105+
11041106
if (p->phy) {
11051107
phy_stop(p->phy);
11061108
p->old_pause = -1;

net/ipv4/fib_semantics.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,8 +1277,9 @@ int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event,
12771277
nla_put_u32(skb, RTA_FLOW, fi->fib_nh[0].nh_tclassid))
12781278
goto nla_put_failure;
12791279
#endif
1280-
if (fi->fib_nh->nh_lwtstate)
1281-
lwtunnel_fill_encap(skb, fi->fib_nh->nh_lwtstate);
1280+
if (fi->fib_nh->nh_lwtstate &&
1281+
lwtunnel_fill_encap(skb, fi->fib_nh->nh_lwtstate) < 0)
1282+
goto nla_put_failure;
12821283
}
12831284
#ifdef CONFIG_IP_ROUTE_MULTIPATH
12841285
if (fi->fib_nhs > 1) {
@@ -1314,8 +1315,10 @@ int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event,
13141315
nla_put_u32(skb, RTA_FLOW, nh->nh_tclassid))
13151316
goto nla_put_failure;
13161317
#endif
1317-
if (nh->nh_lwtstate)
1318-
lwtunnel_fill_encap(skb, nh->nh_lwtstate);
1318+
if (nh->nh_lwtstate &&
1319+
lwtunnel_fill_encap(skb, nh->nh_lwtstate) < 0)
1320+
goto nla_put_failure;
1321+
13191322
/* length of rtnetlink header + attributes */
13201323
rtnh->rtnh_len = nlmsg_get_pos(skb) - (void *) rtnh;
13211324
} endfor_nexthops(fi);

net/ipv4/route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2430,7 +2430,7 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src, u32 table_id,
24302430
r->rtm_dst_len = 32;
24312431
r->rtm_src_len = 0;
24322432
r->rtm_tos = fl4->flowi4_tos;
2433-
r->rtm_table = table_id;
2433+
r->rtm_table = table_id < 256 ? table_id : RT_TABLE_COMPAT;
24342434
if (nla_put_u32(skb, RTA_TABLE, table_id))
24352435
goto nla_put_failure;
24362436
r->rtm_type = rt->rt_type;

net/ipv4/tcp_fastopen.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static bool tcp_fastopen_cookie_gen(struct request_sock *req,
112112
struct tcp_fastopen_cookie tmp;
113113

114114
if (__tcp_fastopen_cookie_gen(&ip6h->saddr, &tmp)) {
115-
struct in6_addr *buf = (struct in6_addr *) tmp.val;
115+
struct in6_addr *buf = &tmp.addr;
116116
int i;
117117

118118
for (i = 0; i < 4; i++)
@@ -161,6 +161,7 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk,
161161
* scaled. So correct it appropriately.
162162
*/
163163
tp->snd_wnd = ntohs(tcp_hdr(skb)->window);
164+
tp->max_window = tp->snd_wnd;
164165

165166
/* Activate the retrans timer so that SYNACK can be retransmitted.
166167
* The request socket is not added to the ehash

0 commit comments

Comments
 (0)