Skip to content

Commit e001d70

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Some straggler bug fixes here: 1) Netlink_sendmsg() doesn't check iterator type properly in mmap case, from Ken-ichirou MATSUZAWA. 2) Don't sleep in atomic context in bcmgenet driver, from Florian Fainelli. 3) The pfkey_broadcast() code patch can't actually ever use anything other than GFP_ATOMIC. And the cases that right now pass GFP_KERNEL or similar will currently trigger an RCU splat. Just use GFP_ATOMIC unconditionally. From David Ahern. 4) Fix FD bit timings handling in pcan_usb driver, from Marc Kleine-Budde. 5) Cache dst leaked in ip6_gre tunnel removal, fix from Huaibin Wang. 6) Traversal into drivers/net/ethernet/renesas should be triggered by CONFIG_NET_VENDOR_RENESAS, not a particular driver's config option. From Kazuya Mizuguchi. 7) Fix regression in handling of igmp_join errors in vxlan, from Marcelo Ricardo Leitner. 8) Make phy_{read,write}_mmd_indirect() properly take the mdio_lock mutex when programming the registers. From Russell King. 9) Fix non-forced handling in u32_destroy(), from WANG Cong. 10) Test the EVENT_NO_RUNTIME_PM flag before it is cleared in usbnet_stop(), from Eugene Shatokhin. 11) In sfc driver, don't fetch statistics firmware isn't capable of, from Bert Kenward. 12) Verify ASCONF address parameter location in SCTP, from Xin Long" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: sctp: donot reset the overall_error_count in SHUTDOWN_RECEIVE state sctp: asconf's process should verify address parameter is in the beginning sfc: only use vadaptor stats if firmware is capable net: phy: fixed: propagate fixed link values to struct usbnet: Get EVENT_NO_RUNTIME_PM bit before it is cleared drivers: net: xgene: fix: Oops in linkwatch_fire_event cls_u32: complete the check for non-forced case in u32_destroy() net: fec: use reinit_completion() in mdio accessor functions net: phy: add locking to phy_read_mmd_indirect()/phy_write_mmd_indirect() vxlan: re-ignore EADDRINUSE from igmp_join net: compile renesas directory if NET_VENDOR_RENESAS is configured ip6_gre: release cached dst on tunnel removal phylib: Make PHYs children of their MDIO bus, not the bus' parent. can: pcan_usb: don't provide CAN FD bittimings by non-FD adapters net: Fix RCU splat in af_key net: bcmgenet: fix uncleaned dma flags net: bcmgenet: Avoid sleeping in bcmgenet_timeout netlink: mmap: fix tx type check
2 parents 5c98bcc + f648f80 commit e001d70

File tree

22 files changed

+207
-113
lines changed

22 files changed

+207
-113
lines changed

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,18 @@ static int pcan_usb_probe(struct usb_interface *intf)
854854
/*
855855
* describe the PCAN-USB adapter
856856
*/
857+
static const struct can_bittiming_const pcan_usb_const = {
858+
.name = "pcan_usb",
859+
.tseg1_min = 1,
860+
.tseg1_max = 16,
861+
.tseg2_min = 1,
862+
.tseg2_max = 8,
863+
.sjw_max = 4,
864+
.brp_min = 1,
865+
.brp_max = 64,
866+
.brp_inc = 1,
867+
};
868+
857869
const struct peak_usb_adapter pcan_usb = {
858870
.name = "PCAN-USB",
859871
.device_id = PCAN_USB_PRODUCT_ID,
@@ -862,17 +874,7 @@ const struct peak_usb_adapter pcan_usb = {
862874
.clock = {
863875
.freq = PCAN_USB_CRYSTAL_HZ / 2 ,
864876
},
865-
.bittiming_const = {
866-
.name = "pcan_usb",
867-
.tseg1_min = 1,
868-
.tseg1_max = 16,
869-
.tseg2_min = 1,
870-
.tseg2_max = 8,
871-
.sjw_max = 4,
872-
.brp_min = 1,
873-
.brp_max = 64,
874-
.brp_inc = 1,
875-
},
877+
.bittiming_const = &pcan_usb_const,
876878

877879
/* size of device private data */
878880
.sizeof_dev_private = sizeof(struct pcan_usb),

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,9 +792,9 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter,
792792
dev->ep_msg_out = peak_usb_adapter->ep_msg_out[ctrl_idx];
793793

794794
dev->can.clock = peak_usb_adapter->clock;
795-
dev->can.bittiming_const = &peak_usb_adapter->bittiming_const;
795+
dev->can.bittiming_const = peak_usb_adapter->bittiming_const;
796796
dev->can.do_set_bittiming = peak_usb_set_bittiming;
797-
dev->can.data_bittiming_const = &peak_usb_adapter->data_bittiming_const;
797+
dev->can.data_bittiming_const = peak_usb_adapter->data_bittiming_const;
798798
dev->can.do_set_data_bittiming = peak_usb_set_data_bittiming;
799799
dev->can.do_set_mode = peak_usb_set_mode;
800800
dev->can.do_get_berr_counter = peak_usb_adapter->do_get_berr_counter;

drivers/net/can/usb/peak_usb/pcan_usb_core.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ struct peak_usb_adapter {
4848
u32 device_id;
4949
u32 ctrlmode_supported;
5050
struct can_clock clock;
51-
const struct can_bittiming_const bittiming_const;
52-
const struct can_bittiming_const data_bittiming_const;
51+
const struct can_bittiming_const * const bittiming_const;
52+
const struct can_bittiming_const * const data_bittiming_const;
5353
unsigned int ctrl_count;
5454

5555
int (*intf_probe)(struct usb_interface *intf);

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

Lines changed: 52 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,30 @@ static void pcan_usb_fd_free(struct peak_usb_device *dev)
990990
}
991991

992992
/* describes the PCAN-USB FD adapter */
993+
static const struct can_bittiming_const pcan_usb_fd_const = {
994+
.name = "pcan_usb_fd",
995+
.tseg1_min = 1,
996+
.tseg1_max = 64,
997+
.tseg2_min = 1,
998+
.tseg2_max = 16,
999+
.sjw_max = 16,
1000+
.brp_min = 1,
1001+
.brp_max = 1024,
1002+
.brp_inc = 1,
1003+
};
1004+
1005+
static const struct can_bittiming_const pcan_usb_fd_data_const = {
1006+
.name = "pcan_usb_fd",
1007+
.tseg1_min = 1,
1008+
.tseg1_max = 16,
1009+
.tseg2_min = 1,
1010+
.tseg2_max = 8,
1011+
.sjw_max = 4,
1012+
.brp_min = 1,
1013+
.brp_max = 1024,
1014+
.brp_inc = 1,
1015+
};
1016+
9931017
const struct peak_usb_adapter pcan_usb_fd = {
9941018
.name = "PCAN-USB FD",
9951019
.device_id = PCAN_USBFD_PRODUCT_ID,
@@ -999,28 +1023,8 @@ const struct peak_usb_adapter pcan_usb_fd = {
9991023
.clock = {
10001024
.freq = PCAN_UFD_CRYSTAL_HZ,
10011025
},
1002-
.bittiming_const = {
1003-
.name = "pcan_usb_fd",
1004-
.tseg1_min = 1,
1005-
.tseg1_max = 64,
1006-
.tseg2_min = 1,
1007-
.tseg2_max = 16,
1008-
.sjw_max = 16,
1009-
.brp_min = 1,
1010-
.brp_max = 1024,
1011-
.brp_inc = 1,
1012-
},
1013-
.data_bittiming_const = {
1014-
.name = "pcan_usb_fd",
1015-
.tseg1_min = 1,
1016-
.tseg1_max = 16,
1017-
.tseg2_min = 1,
1018-
.tseg2_max = 8,
1019-
.sjw_max = 4,
1020-
.brp_min = 1,
1021-
.brp_max = 1024,
1022-
.brp_inc = 1,
1023-
},
1026+
.bittiming_const = &pcan_usb_fd_const,
1027+
.data_bittiming_const = &pcan_usb_fd_data_const,
10241028

10251029
/* size of device private data */
10261030
.sizeof_dev_private = sizeof(struct pcan_usb_fd_device),
@@ -1058,6 +1062,30 @@ const struct peak_usb_adapter pcan_usb_fd = {
10581062
};
10591063

10601064
/* describes the PCAN-USB Pro FD adapter */
1065+
static const struct can_bittiming_const pcan_usb_pro_fd_const = {
1066+
.name = "pcan_usb_pro_fd",
1067+
.tseg1_min = 1,
1068+
.tseg1_max = 64,
1069+
.tseg2_min = 1,
1070+
.tseg2_max = 16,
1071+
.sjw_max = 16,
1072+
.brp_min = 1,
1073+
.brp_max = 1024,
1074+
.brp_inc = 1,
1075+
};
1076+
1077+
static const struct can_bittiming_const pcan_usb_pro_fd_data_const = {
1078+
.name = "pcan_usb_pro_fd",
1079+
.tseg1_min = 1,
1080+
.tseg1_max = 16,
1081+
.tseg2_min = 1,
1082+
.tseg2_max = 8,
1083+
.sjw_max = 4,
1084+
.brp_min = 1,
1085+
.brp_max = 1024,
1086+
.brp_inc = 1,
1087+
};
1088+
10611089
const struct peak_usb_adapter pcan_usb_pro_fd = {
10621090
.name = "PCAN-USB Pro FD",
10631091
.device_id = PCAN_USBPROFD_PRODUCT_ID,
@@ -1067,28 +1095,8 @@ const struct peak_usb_adapter pcan_usb_pro_fd = {
10671095
.clock = {
10681096
.freq = PCAN_UFD_CRYSTAL_HZ,
10691097
},
1070-
.bittiming_const = {
1071-
.name = "pcan_usb_pro_fd",
1072-
.tseg1_min = 1,
1073-
.tseg1_max = 64,
1074-
.tseg2_min = 1,
1075-
.tseg2_max = 16,
1076-
.sjw_max = 16,
1077-
.brp_min = 1,
1078-
.brp_max = 1024,
1079-
.brp_inc = 1,
1080-
},
1081-
.data_bittiming_const = {
1082-
.name = "pcan_usb_pro_fd",
1083-
.tseg1_min = 1,
1084-
.tseg1_max = 16,
1085-
.tseg2_min = 1,
1086-
.tseg2_max = 8,
1087-
.sjw_max = 4,
1088-
.brp_min = 1,
1089-
.brp_max = 1024,
1090-
.brp_inc = 1,
1091-
},
1098+
.bittiming_const = &pcan_usb_pro_fd_const,
1099+
.data_bittiming_const = &pcan_usb_pro_fd_data_const,
10921100

10931101
/* size of device private data */
10941102
.sizeof_dev_private = sizeof(struct pcan_usb_fd_device),

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,18 @@ int pcan_usb_pro_probe(struct usb_interface *intf)
10041004
/*
10051005
* describe the PCAN-USB Pro adapter
10061006
*/
1007+
static const struct can_bittiming_const pcan_usb_pro_const = {
1008+
.name = "pcan_usb_pro",
1009+
.tseg1_min = 1,
1010+
.tseg1_max = 16,
1011+
.tseg2_min = 1,
1012+
.tseg2_max = 8,
1013+
.sjw_max = 4,
1014+
.brp_min = 1,
1015+
.brp_max = 1024,
1016+
.brp_inc = 1,
1017+
};
1018+
10071019
const struct peak_usb_adapter pcan_usb_pro = {
10081020
.name = "PCAN-USB Pro",
10091021
.device_id = PCAN_USBPRO_PRODUCT_ID,
@@ -1012,17 +1024,7 @@ const struct peak_usb_adapter pcan_usb_pro = {
10121024
.clock = {
10131025
.freq = PCAN_USBPRO_CRYSTAL_HZ,
10141026
},
1015-
.bittiming_const = {
1016-
.name = "pcan_usb_pro",
1017-
.tseg1_min = 1,
1018-
.tseg1_max = 16,
1019-
.tseg2_min = 1,
1020-
.tseg2_max = 8,
1021-
.sjw_max = 4,
1022-
.brp_min = 1,
1023-
.brp_max = 1024,
1024-
.brp_inc = 1,
1025-
},
1027+
.bittiming_const = &pcan_usb_pro_const,
10261028

10271029
/* size of device private data */
10281030
.sizeof_dev_private = sizeof(struct pcan_usb_pro_device),

drivers/net/ethernet/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ obj-$(CONFIG_NET_VENDOR_PASEMI) += pasemi/
6565
obj-$(CONFIG_NET_VENDOR_QLOGIC) += qlogic/
6666
obj-$(CONFIG_NET_VENDOR_QUALCOMM) += qualcomm/
6767
obj-$(CONFIG_NET_VENDOR_REALTEK) += realtek/
68-
obj-$(CONFIG_SH_ETH) += renesas/
68+
obj-$(CONFIG_NET_VENDOR_RENESAS) += renesas/
6969
obj-$(CONFIG_NET_VENDOR_RDC) += rdc/
7070
obj-$(CONFIG_NET_VENDOR_ROCKER) += rocker/
7171
obj-$(CONFIG_NET_VENDOR_SAMSUNG) += samsung/

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,9 @@ int xgene_enet_mdio_config(struct xgene_enet_pdata *pdata)
801801

802802
void xgene_enet_mdio_remove(struct xgene_enet_pdata *pdata)
803803
{
804+
if (pdata->phy_dev)
805+
phy_disconnect(pdata->phy_dev);
806+
804807
mdiobus_unregister(pdata->mdio_bus);
805808
mdiobus_free(pdata->mdio_bus);
806809
pdata->mdio_bus = NULL;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,9 +1277,10 @@ static int xgene_enet_remove(struct platform_device *pdev)
12771277
mac_ops->tx_disable(pdata);
12781278

12791279
xgene_enet_napi_del(pdata);
1280-
xgene_enet_mdio_remove(pdata);
1281-
xgene_enet_delete_desc_rings(pdata);
1280+
if (pdata->phy_mode == PHY_INTERFACE_MODE_RGMII)
1281+
xgene_enet_mdio_remove(pdata);
12821282
unregister_netdev(ndev);
1283+
xgene_enet_delete_desc_rings(pdata);
12831284
pdata->port_ops->shutdown(pdata);
12841285
free_netdev(ndev);
12851286

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,6 +2126,8 @@ static int bcmgenet_dma_teardown(struct bcmgenet_priv *priv)
21262126
int ret = 0;
21272127
int timeout = 0;
21282128
u32 reg;
2129+
u32 dma_ctrl;
2130+
int i;
21292131

21302132
/* Disable TDMA to stop add more frames in TX DMA */
21312133
reg = bcmgenet_tdma_readl(priv, DMA_CTRL);
@@ -2169,6 +2171,20 @@ static int bcmgenet_dma_teardown(struct bcmgenet_priv *priv)
21692171
ret = -ETIMEDOUT;
21702172
}
21712173

2174+
dma_ctrl = 0;
2175+
for (i = 0; i < priv->hw_params->rx_queues; i++)
2176+
dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT));
2177+
reg = bcmgenet_rdma_readl(priv, DMA_CTRL);
2178+
reg &= ~dma_ctrl;
2179+
bcmgenet_rdma_writel(priv, reg, DMA_CTRL);
2180+
2181+
dma_ctrl = 0;
2182+
for (i = 0; i < priv->hw_params->tx_queues; i++)
2183+
dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT));
2184+
reg = bcmgenet_tdma_readl(priv, DMA_CTRL);
2185+
reg &= ~dma_ctrl;
2186+
bcmgenet_tdma_writel(priv, reg, DMA_CTRL);
2187+
21722188
return ret;
21732189
}
21742190

@@ -2820,8 +2836,6 @@ static void bcmgenet_timeout(struct net_device *dev)
28202836

28212837
netif_dbg(priv, tx_err, dev, "bcmgenet_timeout\n");
28222838

2823-
bcmgenet_disable_tx_napi(priv);
2824-
28252839
for (q = 0; q < priv->hw_params->tx_queues; q++)
28262840
bcmgenet_dump_tx_queue(&priv->tx_rings[q]);
28272841
bcmgenet_dump_tx_queue(&priv->tx_rings[DESC_INDEX]);
@@ -2837,8 +2851,6 @@ static void bcmgenet_timeout(struct net_device *dev)
28372851
bcmgenet_intrl2_0_writel(priv, int0_enable, INTRL2_CPU_MASK_CLEAR);
28382852
bcmgenet_intrl2_1_writel(priv, int1_enable, INTRL2_CPU_MASK_CLEAR);
28392853

2840-
bcmgenet_enable_tx_napi(priv);
2841-
28422854
dev->trans_start = jiffies;
28432855

28442856
dev->stats.tx_errors++;

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
17781778
return ret;
17791779

17801780
fep->mii_timeout = 0;
1781-
init_completion(&fep->mdio_done);
1781+
reinit_completion(&fep->mdio_done);
17821782

17831783
/* start a read op */
17841784
writel(FEC_MMFR_ST | FEC_MMFR_OP_READ |
@@ -1817,7 +1817,7 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
18171817
return ret;
18181818

18191819
fep->mii_timeout = 0;
1820-
init_completion(&fep->mdio_done);
1820+
reinit_completion(&fep->mdio_done);
18211821

18221822
/* start a write op */
18231823
writel(FEC_MMFR_ST | FEC_MMFR_OP_WRITE |

drivers/net/ethernet/sfc/ef10.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,12 @@ static size_t efx_ef10_update_stats_common(struct efx_nic *efx, u64 *full_stats,
12821282
}
12831283
}
12841284

1285-
if (core_stats) {
1285+
if (!core_stats)
1286+
return stats_count;
1287+
1288+
if (nic_data->datapath_caps &
1289+
1 << MC_CMD_GET_CAPABILITIES_OUT_EVB_LBN) {
1290+
/* Use vadaptor stats. */
12861291
core_stats->rx_packets = stats[EF10_STAT_rx_unicast] +
12871292
stats[EF10_STAT_rx_multicast] +
12881293
stats[EF10_STAT_rx_broadcast];
@@ -1302,6 +1307,26 @@ static size_t efx_ef10_update_stats_common(struct efx_nic *efx, u64 *full_stats,
13021307
core_stats->rx_fifo_errors = stats[EF10_STAT_rx_overflow];
13031308
core_stats->rx_errors = core_stats->rx_crc_errors;
13041309
core_stats->tx_errors = stats[EF10_STAT_tx_bad];
1310+
} else {
1311+
/* Use port stats. */
1312+
core_stats->rx_packets = stats[EF10_STAT_port_rx_packets];
1313+
core_stats->tx_packets = stats[EF10_STAT_port_tx_packets];
1314+
core_stats->rx_bytes = stats[EF10_STAT_port_rx_bytes];
1315+
core_stats->tx_bytes = stats[EF10_STAT_port_tx_bytes];
1316+
core_stats->rx_dropped = stats[EF10_STAT_port_rx_nodesc_drops] +
1317+
stats[GENERIC_STAT_rx_nodesc_trunc] +
1318+
stats[GENERIC_STAT_rx_noskb_drops];
1319+
core_stats->multicast = stats[EF10_STAT_port_rx_multicast];
1320+
core_stats->rx_length_errors =
1321+
stats[EF10_STAT_port_rx_gtjumbo] +
1322+
stats[EF10_STAT_port_rx_length_error];
1323+
core_stats->rx_crc_errors = stats[EF10_STAT_port_rx_bad];
1324+
core_stats->rx_frame_errors =
1325+
stats[EF10_STAT_port_rx_align_error];
1326+
core_stats->rx_fifo_errors = stats[EF10_STAT_port_rx_overflow];
1327+
core_stats->rx_errors = (core_stats->rx_length_errors +
1328+
core_stats->rx_crc_errors +
1329+
core_stats->rx_frame_errors);
13051330
}
13061331

13071332
return stats_count;

drivers/net/phy/fixed_phy.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,15 @@ struct phy_device *fixed_phy_register(unsigned int irq,
290290
return ERR_PTR(-EINVAL);
291291
}
292292

293+
/* propagate the fixed link values to struct phy_device */
294+
phy->link = status->link;
295+
if (status->link) {
296+
phy->speed = status->speed;
297+
phy->duplex = status->duplex;
298+
phy->pause = status->pause;
299+
phy->asym_pause = status->asym_pause;
300+
}
301+
293302
of_node_get(np);
294303
phy->dev.of_node = np;
295304

0 commit comments

Comments
 (0)