Skip to content

Commit 8d70eeb

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix double-free in batman-adv, from Sven Eckelmann. 2) Fix packet stats for fast-RX path, from Joannes Berg. 3) Netfilter's ip_route_me_harder() doesn't handle request sockets properly, fix from Florian Westphal. 4) Fix sendmsg deadlock in rxrpc, from David Howells. 5) Add missing RCU locking to transport hashtable scan, from Xin Long. 6) Fix potential packet loss in mlxsw driver, from Ido Schimmel. 7) Fix race in NAPI handling between poll handlers and busy polling, from Eric Dumazet. 8) TX path in vxlan and geneve need proper RCU locking, from Jakub Kicinski. 9) SYN processing in DCCP and TCP need to disable BH, from Eric Dumazet. 10) Properly handle net_enable_timestamp() being invoked from IRQ context, also from Eric Dumazet. 11) Fix crash on device-tree systems in xgene driver, from Alban Bedel. 12) Do not call sk_free() on a locked socket, from Arnaldo Carvalho de Melo. 13) Fix use-after-free in netvsc driver, from Dexuan Cui. 14) Fix max MTU setting in bonding driver, from WANG Cong. 15) xen-netback hash table can be allocated from softirq context, so use GFP_ATOMIC. From Anoob Soman. 16) Fix MAC address change bug in bgmac driver, from Hari Vyas. 17) strparser needs to destroy strp_wq on module exit, from WANG Cong. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (69 commits) strparser: destroy workqueue on module exit sfc: fix IPID endianness in TSOv2 sfc: avoid max() in array size rds: remove unnecessary returned value check rxrpc: Fix potential NULL-pointer exception nfp: correct DMA direction in XDP DMA sync nfp: don't tell FW about the reserved buffer space net: ethernet: bgmac: mac address change bug net: ethernet: bgmac: init sequence bug xen-netback: don't vfree() queues under spinlock xen-netback: keep a local pointer for vif in backend_disconnect() netfilter: nf_tables: don't call nfnetlink_set_err() if nfnetlink_send() fails netfilter: nft_set_rbtree: incorrect assumption on lower interval lookups netfilter: nf_conntrack_sip: fix wrong memory initialisation can: flexcan: fix typo in comment can: usb_8dev: Fix memory leak of priv->cmd_msg_buffer can: gs_usb: fix coding style can: gs_usb: Don't use stack memory for USB transfers ixgbe: Limit use of 2K buffers on architectures with 256B or larger cache lines ixgbe: update the rss key on h/w, when ethtool ask for it ...
2 parents 2d62e07 + f78ef7c commit 8d70eeb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+895
-368
lines changed

MAINTAINERS

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6011,9 +6011,8 @@ F: include/linux/hsi/
60116011
F: include/uapi/linux/hsi/
60126012

60136013
HSO 3G MODEM DRIVER
6014-
M: Jan Dumon <[email protected]>
6015-
W: http://www.pharscape.org
6016-
S: Maintained
6014+
6015+
S: Orphan
60176016
F: drivers/net/usb/hso.c
60186017

60196018
HSR NETWORK PROTOCOL

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4179,6 +4179,7 @@ void bond_setup(struct net_device *bond_dev)
41794179

41804180
/* Initialize the device entry points */
41814181
ether_setup(bond_dev);
4182+
bond_dev->max_mtu = ETH_MAX_MTU;
41824183
bond_dev->netdev_ops = &bond_netdev_ops;
41834184
bond_dev->ethtool_ops = &bond_ethtool_ops;
41844185

drivers/net/can/flexcan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
#define FLEXCAN_QUIRK_BROKEN_ERR_STATE BIT(1) /* [TR]WRN_INT not connected */
197197
#define FLEXCAN_QUIRK_DISABLE_RXFG BIT(2) /* Disable RX FIFO Global mask */
198198
#define FLEXCAN_QUIRK_ENABLE_EACEN_RRS BIT(3) /* Enable EACEN and RRS bit in ctrl2 */
199-
#define FLEXCAN_QUIRK_DISABLE_MECR BIT(4) /* Disble Memory error detection */
199+
#define FLEXCAN_QUIRK_DISABLE_MECR BIT(4) /* Disable Memory error detection */
200200
#define FLEXCAN_QUIRK_USE_OFF_TIMESTAMP BIT(5) /* Use timestamp based offloading */
201201

202202
/* Structure of the message buffer */

drivers/net/can/usb/gs_usb.c

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ static int gs_cmd_reset(struct gs_usb *gsusb, struct gs_can *gsdev)
258258
rc = usb_control_msg(interface_to_usbdev(intf),
259259
usb_sndctrlpipe(interface_to_usbdev(intf), 0),
260260
GS_USB_BREQ_MODE,
261-
USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
261+
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
262262
gsdev->channel,
263263
0,
264264
dm,
@@ -432,7 +432,7 @@ static int gs_usb_set_bittiming(struct net_device *netdev)
432432
rc = usb_control_msg(interface_to_usbdev(intf),
433433
usb_sndctrlpipe(interface_to_usbdev(intf), 0),
434434
GS_USB_BREQ_BITTIMING,
435-
USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
435+
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
436436
dev->channel,
437437
0,
438438
dbt,
@@ -546,7 +546,6 @@ static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb,
546546
hf,
547547
urb->transfer_dma);
548548

549-
550549
if (rc == -ENODEV) {
551550
netif_device_detach(netdev);
552551
} else {
@@ -804,7 +803,7 @@ static struct gs_can *gs_make_candev(unsigned int channel,
804803
rc = usb_control_msg(interface_to_usbdev(intf),
805804
usb_rcvctrlpipe(interface_to_usbdev(intf), 0),
806805
GS_USB_BREQ_BT_CONST,
807-
USB_DIR_IN|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
806+
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
808807
channel,
809808
0,
810809
bt_const,
@@ -908,57 +907,72 @@ static int gs_usb_probe(struct usb_interface *intf,
908907
struct gs_usb *dev;
909908
int rc = -ENOMEM;
910909
unsigned int icount, i;
911-
struct gs_host_config hconf = {
912-
.byte_order = 0x0000beef,
913-
};
914-
struct gs_device_config dconf;
910+
struct gs_host_config *hconf;
911+
struct gs_device_config *dconf;
912+
913+
hconf = kmalloc(sizeof(*hconf), GFP_KERNEL);
914+
if (!hconf)
915+
return -ENOMEM;
916+
917+
hconf->byte_order = 0x0000beef;
915918

916919
/* send host config */
917920
rc = usb_control_msg(interface_to_usbdev(intf),
918921
usb_sndctrlpipe(interface_to_usbdev(intf), 0),
919922
GS_USB_BREQ_HOST_FORMAT,
920-
USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
923+
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
921924
1,
922925
intf->altsetting[0].desc.bInterfaceNumber,
923-
&hconf,
924-
sizeof(hconf),
926+
hconf,
927+
sizeof(*hconf),
925928
1000);
926929

930+
kfree(hconf);
931+
927932
if (rc < 0) {
928933
dev_err(&intf->dev, "Couldn't send data format (err=%d)\n",
929934
rc);
930935
return rc;
931936
}
932937

938+
dconf = kmalloc(sizeof(*dconf), GFP_KERNEL);
939+
if (!dconf)
940+
return -ENOMEM;
941+
933942
/* read device config */
934943
rc = usb_control_msg(interface_to_usbdev(intf),
935944
usb_rcvctrlpipe(interface_to_usbdev(intf), 0),
936945
GS_USB_BREQ_DEVICE_CONFIG,
937-
USB_DIR_IN|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
946+
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
938947
1,
939948
intf->altsetting[0].desc.bInterfaceNumber,
940-
&dconf,
941-
sizeof(dconf),
949+
dconf,
950+
sizeof(*dconf),
942951
1000);
943952
if (rc < 0) {
944953
dev_err(&intf->dev, "Couldn't get device config: (err=%d)\n",
945954
rc);
955+
kfree(dconf);
946956
return rc;
947957
}
948958

949-
icount = dconf.icount + 1;
959+
icount = dconf->icount + 1;
950960
dev_info(&intf->dev, "Configuring for %d interfaces\n", icount);
951961

952962
if (icount > GS_MAX_INTF) {
953963
dev_err(&intf->dev,
954964
"Driver cannot handle more that %d CAN interfaces\n",
955965
GS_MAX_INTF);
966+
kfree(dconf);
956967
return -EINVAL;
957968
}
958969

959970
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
960-
if (!dev)
971+
if (!dev) {
972+
kfree(dconf);
961973
return -ENOMEM;
974+
}
975+
962976
init_usb_anchor(&dev->rx_submitted);
963977

964978
atomic_set(&dev->active_channels, 0);
@@ -967,7 +981,7 @@ static int gs_usb_probe(struct usb_interface *intf,
967981
dev->udev = interface_to_usbdev(intf);
968982

969983
for (i = 0; i < icount; i++) {
970-
dev->canch[i] = gs_make_candev(i, intf, &dconf);
984+
dev->canch[i] = gs_make_candev(i, intf, dconf);
971985
if (IS_ERR_OR_NULL(dev->canch[i])) {
972986
/* save error code to return later */
973987
rc = PTR_ERR(dev->canch[i]);
@@ -978,12 +992,15 @@ static int gs_usb_probe(struct usb_interface *intf,
978992
gs_destroy_candev(dev->canch[i]);
979993

980994
usb_kill_anchored_urbs(&dev->rx_submitted);
995+
kfree(dconf);
981996
kfree(dev);
982997
return rc;
983998
}
984999
dev->canch[i]->parent = dev;
9851000
}
9861001

1002+
kfree(dconf);
1003+
9871004
return 0;
9881005
}
9891006

drivers/net/can/usb/usb_8dev.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,8 @@ static int usb_8dev_probe(struct usb_interface *intf,
951951
for (i = 0; i < MAX_TX_URBS; i++)
952952
priv->tx_contexts[i].echo_index = MAX_TX_URBS;
953953

954-
priv->cmd_msg_buffer = kzalloc(sizeof(struct usb_8dev_cmd_msg),
955-
GFP_KERNEL);
954+
priv->cmd_msg_buffer = devm_kzalloc(&intf->dev, sizeof(struct usb_8dev_cmd_msg),
955+
GFP_KERNEL);
956956
if (!priv->cmd_msg_buffer)
957957
goto cleanup_candev;
958958

@@ -966,7 +966,7 @@ static int usb_8dev_probe(struct usb_interface *intf,
966966
if (err) {
967967
netdev_err(netdev,
968968
"couldn't register CAN device: %d\n", err);
969-
goto cleanup_cmd_msg_buffer;
969+
goto cleanup_candev;
970970
}
971971

972972
err = usb_8dev_cmd_version(priv, &version);
@@ -987,9 +987,6 @@ static int usb_8dev_probe(struct usb_interface *intf,
987987
cleanup_unregister_candev:
988988
unregister_netdev(priv->netdev);
989989

990-
cleanup_cmd_msg_buffer:
991-
kfree(priv->cmd_msg_buffer);
992-
993990
cleanup_candev:
994991
free_candev(netdev);
995992

drivers/net/ethernet/amd/declance.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,18 +1276,6 @@ static int dec_lance_probe(struct device *bdev, const int type)
12761276
return ret;
12771277
}
12781278

1279-
static void __exit dec_lance_remove(struct device *bdev)
1280-
{
1281-
struct net_device *dev = dev_get_drvdata(bdev);
1282-
resource_size_t start, len;
1283-
1284-
unregister_netdev(dev);
1285-
start = to_tc_dev(bdev)->resource.start;
1286-
len = to_tc_dev(bdev)->resource.end - start + 1;
1287-
release_mem_region(start, len);
1288-
free_netdev(dev);
1289-
}
1290-
12911279
/* Find all the lance cards on the system and initialize them */
12921280
static int __init dec_lance_platform_probe(void)
12931281
{
@@ -1320,7 +1308,7 @@ static void __exit dec_lance_platform_remove(void)
13201308

13211309
#ifdef CONFIG_TC
13221310
static int dec_lance_tc_probe(struct device *dev);
1323-
static int __exit dec_lance_tc_remove(struct device *dev);
1311+
static int dec_lance_tc_remove(struct device *dev);
13241312

13251313
static const struct tc_device_id dec_lance_tc_table[] = {
13261314
{ "DEC ", "PMAD-AA " },
@@ -1334,7 +1322,7 @@ static struct tc_driver dec_lance_tc_driver = {
13341322
.name = "declance",
13351323
.bus = &tc_bus_type,
13361324
.probe = dec_lance_tc_probe,
1337-
.remove = __exit_p(dec_lance_tc_remove),
1325+
.remove = dec_lance_tc_remove,
13381326
},
13391327
};
13401328

@@ -1346,7 +1334,19 @@ static int dec_lance_tc_probe(struct device *dev)
13461334
return status;
13471335
}
13481336

1349-
static int __exit dec_lance_tc_remove(struct device *dev)
1337+
static void dec_lance_remove(struct device *bdev)
1338+
{
1339+
struct net_device *dev = dev_get_drvdata(bdev);
1340+
resource_size_t start, len;
1341+
1342+
unregister_netdev(dev);
1343+
start = to_tc_dev(bdev)->resource.start;
1344+
len = to_tc_dev(bdev)->resource.end - start + 1;
1345+
release_mem_region(start, len);
1346+
free_netdev(dev);
1347+
}
1348+
1349+
static int dec_lance_tc_remove(struct device *dev)
13501350
{
13511351
put_device(dev);
13521352
dec_lance_remove(dev);

drivers/net/ethernet/amd/xgbe/xgbe-dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ static int xgbe_read_ext_mii_regs(struct xgbe_prv_data *pdata, int addr,
13231323
static int xgbe_set_ext_mii_mode(struct xgbe_prv_data *pdata, unsigned int port,
13241324
enum xgbe_mdio_mode mode)
13251325
{
1326-
unsigned int reg_val = 0;
1326+
unsigned int reg_val = XGMAC_IOREAD(pdata, MAC_MDIOCL22R);
13271327

13281328
switch (mode) {
13291329
case XGBE_MDIO_MODE_CL22:

drivers/net/ethernet/amd/xgbe/xgbe-drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,12 +1131,12 @@ static void xgbe_stop(struct xgbe_prv_data *pdata)
11311131
hw_if->disable_tx(pdata);
11321132
hw_if->disable_rx(pdata);
11331133

1134+
phy_if->phy_stop(pdata);
1135+
11341136
xgbe_free_irqs(pdata);
11351137

11361138
xgbe_napi_disable(pdata, 1);
11371139

1138-
phy_if->phy_stop(pdata);
1139-
11401140
hw_if->exit(pdata);
11411141

11421142
channel = pdata->channel;

drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,8 @@ static void xgbe_phy_sfp_phy_settings(struct xgbe_prv_data *pdata)
716716
pdata->phy.duplex = DUPLEX_UNKNOWN;
717717
pdata->phy.autoneg = AUTONEG_ENABLE;
718718
pdata->phy.advertising = pdata->phy.supported;
719+
720+
return;
719721
}
720722

721723
pdata->phy.advertising &= ~ADVERTISED_Autoneg;
@@ -875,6 +877,16 @@ static int xgbe_phy_find_phy_device(struct xgbe_prv_data *pdata)
875877
!phy_data->sfp_phy_avail)
876878
return 0;
877879

880+
/* Set the proper MDIO mode for the PHY */
881+
ret = pdata->hw_if.set_ext_mii_mode(pdata, phy_data->mdio_addr,
882+
phy_data->phydev_mode);
883+
if (ret) {
884+
netdev_err(pdata->netdev,
885+
"mdio port/clause not compatible (%u/%u)\n",
886+
phy_data->mdio_addr, phy_data->phydev_mode);
887+
return ret;
888+
}
889+
878890
/* Create and connect to the PHY device */
879891
phydev = get_phy_device(phy_data->mii, phy_data->mdio_addr,
880892
(phy_data->phydev_mode == XGBE_MDIO_MODE_CL45));
@@ -2722,6 +2734,18 @@ static int xgbe_phy_start(struct xgbe_prv_data *pdata)
27222734
if (ret)
27232735
return ret;
27242736

2737+
/* Set the proper MDIO mode for the re-driver */
2738+
if (phy_data->redrv && !phy_data->redrv_if) {
2739+
ret = pdata->hw_if.set_ext_mii_mode(pdata, phy_data->redrv_addr,
2740+
XGBE_MDIO_MODE_CL22);
2741+
if (ret) {
2742+
netdev_err(pdata->netdev,
2743+
"redriver mdio port not compatible (%u)\n",
2744+
phy_data->redrv_addr);
2745+
return ret;
2746+
}
2747+
}
2748+
27252749
/* Start in highest supported mode */
27262750
xgbe_phy_set_mode(pdata, phy_data->start_mode);
27272751

drivers/net/ethernet/apm/xgene/xgene_enet_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,12 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
17491749

17501750
pdata->clk = devm_clk_get(&pdev->dev, NULL);
17511751
if (IS_ERR(pdata->clk)) {
1752+
/* Abort if the clock is defined but couldn't be retrived.
1753+
* Always abort if the clock is missing on DT system as
1754+
* the driver can't cope with this case.
1755+
*/
1756+
if (PTR_ERR(pdata->clk) != -ENOENT || dev->of_node)
1757+
return PTR_ERR(pdata->clk);
17521758
/* Firmware may have set up the clock already. */
17531759
dev_info(dev, "clocks have been setup already\n");
17541760
}

drivers/net/ethernet/broadcom/bgmac-platform.c

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ static void platform_bgmac_idm_write(struct bgmac *bgmac, u16 offset, u32 value)
5151

5252
static bool platform_bgmac_clk_enabled(struct bgmac *bgmac)
5353
{
54-
if ((bgmac_idm_read(bgmac, BCMA_IOCTL) &
55-
(BCMA_IOCTL_CLK | BCMA_IOCTL_FGC)) != BCMA_IOCTL_CLK)
54+
if ((bgmac_idm_read(bgmac, BCMA_IOCTL) & BGMAC_CLK_EN) != BGMAC_CLK_EN)
5655
return false;
5756
if (bgmac_idm_read(bgmac, BCMA_RESET_CTL) & BCMA_RESET_CTL_RESET)
5857
return false;
@@ -61,15 +60,25 @@ static bool platform_bgmac_clk_enabled(struct bgmac *bgmac)
6160

6261
static void platform_bgmac_clk_enable(struct bgmac *bgmac, u32 flags)
6362
{
64-
bgmac_idm_write(bgmac, BCMA_IOCTL,
65-
(BCMA_IOCTL_CLK | BCMA_IOCTL_FGC | flags));
66-
bgmac_idm_read(bgmac, BCMA_IOCTL);
63+
u32 val;
6764

68-
bgmac_idm_write(bgmac, BCMA_RESET_CTL, 0);
69-
bgmac_idm_read(bgmac, BCMA_RESET_CTL);
70-
udelay(1);
65+
/* The Reset Control register only contains a single bit to show if the
66+
* controller is currently in reset. Do a sanity check here, just in
67+
* case the bootloader happened to leave the device in reset.
68+
*/
69+
val = bgmac_idm_read(bgmac, BCMA_RESET_CTL);
70+
if (val) {
71+
bgmac_idm_write(bgmac, BCMA_RESET_CTL, 0);
72+
bgmac_idm_read(bgmac, BCMA_RESET_CTL);
73+
udelay(1);
74+
}
7175

72-
bgmac_idm_write(bgmac, BCMA_IOCTL, (BCMA_IOCTL_CLK | flags));
76+
val = bgmac_idm_read(bgmac, BCMA_IOCTL);
77+
/* Some bits of BCMA_IOCTL set by HW/ATF and should not change */
78+
val |= flags & ~(BGMAC_AWCACHE | BGMAC_ARCACHE | BGMAC_AWUSER |
79+
BGMAC_ARUSER);
80+
val |= BGMAC_CLK_EN;
81+
bgmac_idm_write(bgmac, BCMA_IOCTL, val);
7382
bgmac_idm_read(bgmac, BCMA_IOCTL);
7483
udelay(1);
7584
}

0 commit comments

Comments
 (0)