Skip to content

Commit 2375886

Browse files
committed
Merge tag 'net-6.1-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from 802.15.4 (Zigbee et al). Current release - regressions: - ipa: fix bugs in the register conversion for IPA v3.1 and v3.5.1 Current release - new code bugs: - mptcp: fix abba deadlock on fastopen - eth: stmmac: rk3588: allow multiple gmac controllers in one system Previous releases - regressions: - ip: rework the fix for dflt addr selection for connected nexthop - net: couple more fixes for misinterpreting bits in struct page after the signature was added Previous releases - always broken: - ipv6: ensure sane device mtu in tunnels - openvswitch: switch from WARN to pr_warn on a user-triggerable path - ethtool: eeprom: fix null-deref on genl_info in dump - ieee802154: more return code fixes for corner cases in dgram_sendmsg - mac802154: fix link-quality-indicator recording - eth: mlx5: fixes for IPsec, PTP timestamps, OvS and conntrack offload - eth: fec: limit register access on i.MX6UL - eth: bcm4908_enet: update TX stats after actual transmission - can: rcar_canfd: improve IRQ handling for RZ/G2L Misc: - genetlink: piggy back on the newly added resv_op_start to enforce more sanity checks on new commands" * tag 'net-6.1-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (57 commits) net: enetc: survive memory pressure without crashing kcm: do not sense pfmemalloc status in kcm_sendpage() net: do not sense pfmemalloc status in skb_append_pagefrags() net/mlx5e: Fix macsec sci endianness at rx sa update net/mlx5e: Fix wrong bitwise comparison usage in macsec_fs_rx_add_rule function net/mlx5e: Fix macsec rx security association (SA) update/delete net/mlx5e: Fix macsec coverity issue at rx sa update net/mlx5: Fix crash during sync firmware reset net/mlx5: Update fw fatal reporter state on PCI handlers successful recover net/mlx5e: TC, Fix cloned flow attr instance dests are not zeroed net/mlx5e: TC, Reject forwarding from internal port to internal port net/mlx5: Fix possible use-after-free in async command interface net/mlx5: ASO, Create the ASO SQ with the correct timestamp format net/mlx5e: Update restore chain id for slow path packets net/mlx5e: Extend SKB room check to include PTP-SQ net/mlx5: DR, Fix matcher disconnect error flow net/mlx5: Wait for firmware to enable CRS before pci_restore_state net/mlx5e: Do not increment ESN when updating IPsec ESN state netdevsim: remove dir in nsim_dev_debugfs_init() when creating ports dir failed netdevsim: fix memory leak in nsim_drv_probe() when nsim_dev_resources_register() failed ...
2 parents 7dd257d + 84ce1ca commit 2375886

File tree

62 files changed

+1197
-347
lines changed

Some content is hidden

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

62 files changed

+1197
-347
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15436,6 +15436,7 @@ S: Maintained
1543615436
W: http://openvswitch.org
1543715437
F: include/uapi/linux/openvswitch.h
1543815438
F: net/openvswitch/
15439+
F: tools/testing/selftests/net/openvswitch/
1543915440

1544015441
OPERATING PERFORMANCE POINTS (OPP)
1544115442
M: Viresh Kumar <[email protected]>

drivers/net/can/mscan/mpc5xxx_can.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,22 +322,24 @@ static int mpc5xxx_can_probe(struct platform_device *ofdev)
322322
&mscan_clksrc);
323323
if (!priv->can.clock.freq) {
324324
dev_err(&ofdev->dev, "couldn't get MSCAN clock properties\n");
325-
goto exit_free_mscan;
325+
goto exit_put_clock;
326326
}
327327

328328
err = register_mscandev(dev, mscan_clksrc);
329329
if (err) {
330330
dev_err(&ofdev->dev, "registering %s failed (err=%d)\n",
331331
DRV_NAME, err);
332-
goto exit_free_mscan;
332+
goto exit_put_clock;
333333
}
334334

335335
dev_info(&ofdev->dev, "MSCAN at 0x%p, irq %d, clock %d Hz\n",
336336
priv->reg_base, dev->irq, priv->can.clock.freq);
337337

338338
return 0;
339339

340-
exit_free_mscan:
340+
exit_put_clock:
341+
if (data->put_clock)
342+
data->put_clock(ofdev);
341343
free_candev(dev);
342344
exit_dispose_irq:
343345
irq_dispose_mapping(irq);

drivers/net/can/rcar/rcar_canfd.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,11 +1157,13 @@ static void rcar_canfd_handle_global_receive(struct rcar_canfd_global *gpriv, u3
11571157
{
11581158
struct rcar_canfd_channel *priv = gpriv->ch[ch];
11591159
u32 ridx = ch + RCANFD_RFFIFO_IDX;
1160-
u32 sts;
1160+
u32 sts, cc;
11611161

11621162
/* Handle Rx interrupts */
11631163
sts = rcar_canfd_read(priv->base, RCANFD_RFSTS(gpriv, ridx));
1164-
if (likely(sts & RCANFD_RFSTS_RFIF)) {
1164+
cc = rcar_canfd_read(priv->base, RCANFD_RFCC(gpriv, ridx));
1165+
if (likely(sts & RCANFD_RFSTS_RFIF &&
1166+
cc & RCANFD_RFCC_RFIE)) {
11651167
if (napi_schedule_prep(&priv->napi)) {
11661168
/* Disable Rx FIFO interrupts */
11671169
rcar_canfd_clear_bit(priv->base,
@@ -1244,11 +1246,9 @@ static void rcar_canfd_handle_channel_tx(struct rcar_canfd_global *gpriv, u32 ch
12441246

12451247
static irqreturn_t rcar_canfd_channel_tx_interrupt(int irq, void *dev_id)
12461248
{
1247-
struct rcar_canfd_global *gpriv = dev_id;
1248-
u32 ch;
1249+
struct rcar_canfd_channel *priv = dev_id;
12491250

1250-
for_each_set_bit(ch, &gpriv->channels_mask, gpriv->max_channels)
1251-
rcar_canfd_handle_channel_tx(gpriv, ch);
1251+
rcar_canfd_handle_channel_tx(priv->gpriv, priv->channel);
12521252

12531253
return IRQ_HANDLED;
12541254
}
@@ -1276,11 +1276,9 @@ static void rcar_canfd_handle_channel_err(struct rcar_canfd_global *gpriv, u32 c
12761276

12771277
static irqreturn_t rcar_canfd_channel_err_interrupt(int irq, void *dev_id)
12781278
{
1279-
struct rcar_canfd_global *gpriv = dev_id;
1280-
u32 ch;
1279+
struct rcar_canfd_channel *priv = dev_id;
12811280

1282-
for_each_set_bit(ch, &gpriv->channels_mask, gpriv->max_channels)
1283-
rcar_canfd_handle_channel_err(gpriv, ch);
1281+
rcar_canfd_handle_channel_err(priv->gpriv, priv->channel);
12841282

12851283
return IRQ_HANDLED;
12861284
}
@@ -1721,6 +1719,7 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
17211719
priv->ndev = ndev;
17221720
priv->base = gpriv->base;
17231721
priv->channel = ch;
1722+
priv->gpriv = gpriv;
17241723
priv->can.clock.freq = fcan_freq;
17251724
dev_info(&pdev->dev, "can_clk rate is %u\n", priv->can.clock.freq);
17261725

@@ -1749,7 +1748,7 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
17491748
}
17501749
err = devm_request_irq(&pdev->dev, err_irq,
17511750
rcar_canfd_channel_err_interrupt, 0,
1752-
irq_name, gpriv);
1751+
irq_name, priv);
17531752
if (err) {
17541753
dev_err(&pdev->dev, "devm_request_irq CH Err(%d) failed, error %d\n",
17551754
err_irq, err);
@@ -1763,7 +1762,7 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
17631762
}
17641763
err = devm_request_irq(&pdev->dev, tx_irq,
17651764
rcar_canfd_channel_tx_interrupt, 0,
1766-
irq_name, gpriv);
1765+
irq_name, priv);
17671766
if (err) {
17681767
dev_err(&pdev->dev, "devm_request_irq Tx (%d) failed, error %d\n",
17691768
tx_irq, err);
@@ -1789,7 +1788,6 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
17891788

17901789
priv->can.do_set_mode = rcar_canfd_do_set_mode;
17911790
priv->can.do_get_berr_counter = rcar_canfd_get_berr_counter;
1792-
priv->gpriv = gpriv;
17931791
SET_NETDEV_DEV(ndev, &pdev->dev);
17941792

17951793
netif_napi_add_weight(ndev, &priv->napi, rcar_canfd_rx_poll,

drivers/net/can/spi/mcp251x.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,11 +1415,14 @@ static int mcp251x_can_probe(struct spi_device *spi)
14151415

14161416
ret = mcp251x_gpio_setup(priv);
14171417
if (ret)
1418-
goto error_probe;
1418+
goto out_unregister_candev;
14191419

14201420
netdev_info(net, "MCP%x successfully initialized.\n", priv->model);
14211421
return 0;
14221422

1423+
out_unregister_candev:
1424+
unregister_candev(net);
1425+
14231426
error_probe:
14241427
destroy_workqueue(priv->wq);
14251428
priv->wq = NULL;

drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,7 +1875,7 @@ static int kvaser_usb_hydra_start_chip(struct kvaser_usb_net_priv *priv)
18751875
{
18761876
int err;
18771877

1878-
init_completion(&priv->start_comp);
1878+
reinit_completion(&priv->start_comp);
18791879

18801880
err = kvaser_usb_hydra_send_simple_cmd(priv->dev, CMD_START_CHIP_REQ,
18811881
priv->channel);
@@ -1893,7 +1893,7 @@ static int kvaser_usb_hydra_stop_chip(struct kvaser_usb_net_priv *priv)
18931893
{
18941894
int err;
18951895

1896-
init_completion(&priv->stop_comp);
1896+
reinit_completion(&priv->stop_comp);
18971897

18981898
/* Make sure we do not report invalid BUS_OFF from CMD_CHIP_STATE_EVENT
18991899
* see comment in kvaser_usb_hydra_update_state()

drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ static int kvaser_usb_leaf_start_chip(struct kvaser_usb_net_priv *priv)
13201320
{
13211321
int err;
13221322

1323-
init_completion(&priv->start_comp);
1323+
reinit_completion(&priv->start_comp);
13241324

13251325
err = kvaser_usb_leaf_send_simple_cmd(priv->dev, CMD_START_CHIP,
13261326
priv->channel);
@@ -1338,7 +1338,7 @@ static int kvaser_usb_leaf_stop_chip(struct kvaser_usb_net_priv *priv)
13381338
{
13391339
int err;
13401340

1341-
init_completion(&priv->stop_comp);
1341+
reinit_completion(&priv->stop_comp);
13421342

13431343
err = kvaser_usb_leaf_send_simple_cmd(priv->dev, CMD_STOP_CHIP,
13441344
priv->channel);

drivers/net/ethernet/broadcom/bcm4908_enet.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,6 @@ static netdev_tx_t bcm4908_enet_start_xmit(struct sk_buff *skb, struct net_devic
561561

562562
if (++ring->write_idx == ring->length - 1)
563563
ring->write_idx = 0;
564-
enet->netdev->stats.tx_bytes += skb->len;
565-
enet->netdev->stats.tx_packets++;
566564

567565
return NETDEV_TX_OK;
568566
}
@@ -635,6 +633,7 @@ static int bcm4908_enet_poll_tx(struct napi_struct *napi, int weight)
635633
struct bcm4908_enet_dma_ring_bd *buf_desc;
636634
struct bcm4908_enet_dma_ring_slot *slot;
637635
struct device *dev = enet->dev;
636+
unsigned int bytes = 0;
638637
int handled = 0;
639638

640639
while (handled < weight && tx_ring->read_idx != tx_ring->write_idx) {
@@ -645,12 +644,17 @@ static int bcm4908_enet_poll_tx(struct napi_struct *napi, int weight)
645644

646645
dma_unmap_single(dev, slot->dma_addr, slot->len, DMA_TO_DEVICE);
647646
dev_kfree_skb(slot->skb);
648-
if (++tx_ring->read_idx == tx_ring->length)
649-
tx_ring->read_idx = 0;
650647

651648
handled++;
649+
bytes += slot->len;
650+
651+
if (++tx_ring->read_idx == tx_ring->length)
652+
tx_ring->read_idx = 0;
652653
}
653654

655+
enet->netdev->stats.tx_packets += handled;
656+
enet->netdev->stats.tx_bytes += bytes;
657+
654658
if (handled < weight) {
655659
napi_complete_done(napi, handled);
656660
bcm4908_enet_dma_ring_intrs_on(enet, tx_ring);

drivers/net/ethernet/broadcom/bcmsysport.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,6 +1991,9 @@ static int bcm_sysport_open(struct net_device *dev)
19911991
goto out_clk_disable;
19921992
}
19931993

1994+
/* Indicate that the MAC is responsible for PHY PM */
1995+
phydev->mac_managed_pm = true;
1996+
19941997
/* Reset house keeping link status */
19951998
priv->old_duplex = -1;
19961999
priv->old_link = -1;

drivers/net/ethernet/freescale/enetc/enetc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,7 +2090,12 @@ static void enetc_setup_rxbdr(struct enetc_hw *hw, struct enetc_bdr *rx_ring)
20902090
else
20912091
enetc_rxbdr_wr(hw, idx, ENETC_RBBSR, ENETC_RXB_DMA_SIZE);
20922092

2093+
/* Also prepare the consumer index in case page allocation never
2094+
* succeeds. In that case, hardware will never advance producer index
2095+
* to match consumer index, and will drop all frames.
2096+
*/
20932097
enetc_rxbdr_wr(hw, idx, ENETC_RBPIR, 0);
2098+
enetc_rxbdr_wr(hw, idx, ENETC_RBCIR, 1);
20942099

20952100
/* enable Rx ints by setting pkt thr to 1 */
20962101
enetc_rxbdr_wr(hw, idx, ENETC_RBICR0, ENETC_RBICR0_ICEN | 0x1);

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,6 +2432,31 @@ static u32 fec_enet_register_offset[] = {
24322432
IEEE_R_DROP, IEEE_R_FRAME_OK, IEEE_R_CRC, IEEE_R_ALIGN, IEEE_R_MACERR,
24332433
IEEE_R_FDXFC, IEEE_R_OCTETS_OK
24342434
};
2435+
/* for i.MX6ul */
2436+
static u32 fec_enet_register_offset_6ul[] = {
2437+
FEC_IEVENT, FEC_IMASK, FEC_R_DES_ACTIVE_0, FEC_X_DES_ACTIVE_0,
2438+
FEC_ECNTRL, FEC_MII_DATA, FEC_MII_SPEED, FEC_MIB_CTRLSTAT, FEC_R_CNTRL,
2439+
FEC_X_CNTRL, FEC_ADDR_LOW, FEC_ADDR_HIGH, FEC_OPD, FEC_TXIC0, FEC_RXIC0,
2440+
FEC_HASH_TABLE_HIGH, FEC_HASH_TABLE_LOW, FEC_GRP_HASH_TABLE_HIGH,
2441+
FEC_GRP_HASH_TABLE_LOW, FEC_X_WMRK, FEC_R_DES_START_0,
2442+
FEC_X_DES_START_0, FEC_R_BUFF_SIZE_0, FEC_R_FIFO_RSFL, FEC_R_FIFO_RSEM,
2443+
FEC_R_FIFO_RAEM, FEC_R_FIFO_RAFL, FEC_RACC,
2444+
RMON_T_DROP, RMON_T_PACKETS, RMON_T_BC_PKT, RMON_T_MC_PKT,
2445+
RMON_T_CRC_ALIGN, RMON_T_UNDERSIZE, RMON_T_OVERSIZE, RMON_T_FRAG,
2446+
RMON_T_JAB, RMON_T_COL, RMON_T_P64, RMON_T_P65TO127, RMON_T_P128TO255,
2447+
RMON_T_P256TO511, RMON_T_P512TO1023, RMON_T_P1024TO2047,
2448+
RMON_T_P_GTE2048, RMON_T_OCTETS,
2449+
IEEE_T_DROP, IEEE_T_FRAME_OK, IEEE_T_1COL, IEEE_T_MCOL, IEEE_T_DEF,
2450+
IEEE_T_LCOL, IEEE_T_EXCOL, IEEE_T_MACERR, IEEE_T_CSERR, IEEE_T_SQE,
2451+
IEEE_T_FDXFC, IEEE_T_OCTETS_OK,
2452+
RMON_R_PACKETS, RMON_R_BC_PKT, RMON_R_MC_PKT, RMON_R_CRC_ALIGN,
2453+
RMON_R_UNDERSIZE, RMON_R_OVERSIZE, RMON_R_FRAG, RMON_R_JAB,
2454+
RMON_R_RESVD_O, RMON_R_P64, RMON_R_P65TO127, RMON_R_P128TO255,
2455+
RMON_R_P256TO511, RMON_R_P512TO1023, RMON_R_P1024TO2047,
2456+
RMON_R_P_GTE2048, RMON_R_OCTETS,
2457+
IEEE_R_DROP, IEEE_R_FRAME_OK, IEEE_R_CRC, IEEE_R_ALIGN, IEEE_R_MACERR,
2458+
IEEE_R_FDXFC, IEEE_R_OCTETS_OK
2459+
};
24352460
#else
24362461
static __u32 fec_enet_register_version = 1;
24372462
static u32 fec_enet_register_offset[] = {
@@ -2456,7 +2481,24 @@ static void fec_enet_get_regs(struct net_device *ndev,
24562481
u32 *buf = (u32 *)regbuf;
24572482
u32 i, off;
24582483
int ret;
2484+
#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
2485+
defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM) || \
2486+
defined(CONFIG_ARM64) || defined(CONFIG_COMPILE_TEST)
2487+
u32 *reg_list;
2488+
u32 reg_cnt;
24592489

2490+
if (!of_machine_is_compatible("fsl,imx6ul")) {
2491+
reg_list = fec_enet_register_offset;
2492+
reg_cnt = ARRAY_SIZE(fec_enet_register_offset);
2493+
} else {
2494+
reg_list = fec_enet_register_offset_6ul;
2495+
reg_cnt = ARRAY_SIZE(fec_enet_register_offset_6ul);
2496+
}
2497+
#else
2498+
/* coldfire */
2499+
static u32 *reg_list = fec_enet_register_offset;
2500+
static const u32 reg_cnt = ARRAY_SIZE(fec_enet_register_offset);
2501+
#endif
24602502
ret = pm_runtime_resume_and_get(dev);
24612503
if (ret < 0)
24622504
return;
@@ -2465,8 +2507,8 @@ static void fec_enet_get_regs(struct net_device *ndev,
24652507

24662508
memset(buf, 0, regs->len);
24672509

2468-
for (i = 0; i < ARRAY_SIZE(fec_enet_register_offset); i++) {
2469-
off = fec_enet_register_offset[i];
2510+
for (i = 0; i < reg_cnt; i++) {
2511+
off = reg_list[i];
24702512

24712513
if ((off == FEC_R_BOUND || off == FEC_R_FSTART) &&
24722514
!(fep->quirks & FEC_QUIRK_HAS_FRREG))

0 commit comments

Comments
 (0)