Skip to content

Commit 78bac77

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) Several nf_flow_table_offload fixes from Pablo Neira Ayuso, including adding a missing ipv6 match description. 2) Several heap overflow fixes in mwifiex from qize wang and Ganapathi Bhat. 3) Fix uninit value in bond_neigh_init(), from Eric Dumazet. 4) Fix non-ACPI probing of nxp-nci, from Stephan Gerhold. 5) Fix use after free in tipc_disc_rcv(), from Tuong Lien. 6) Enforce limit of 33 tail calls in mips and riscv JIT, from Paul Chaignon. 7) Multicast MAC limit test is off by one in qede, from Manish Chopra. 8) Fix established socket lookup race when socket goes from TCP_ESTABLISHED to TCP_LISTEN, because there lacks an intervening RCU grace period. From Eric Dumazet. 9) Don't send empty SKBs from tcp_write_xmit(), also from Eric Dumazet. 10) Fix active backup transition after link failure in bonding, from Mahesh Bandewar. 11) Avoid zero sized hash table in gtp driver, from Taehee Yoo. 12) Fix wrong interface passed to ->mac_link_up(), from Russell King. 13) Fix DSA egress flooding settings in b53, from Florian Fainelli. 14) Memory leak in gmac_setup_txqs(), from Navid Emamdoost. 15) Fix double free in dpaa2-ptp code, from Ioana Ciornei. 16) Reject invalid MTU values in stmmac, from Jose Abreu. 17) Fix refcount leak in error path of u32 classifier, from Davide Caratti. 18) Fix regression causing iwlwifi firmware crashes on boot, from Anders Kaseorg. 19) Fix inverted return value logic in llc2 code, from Chan Shu Tak. 20) Disable hardware GRO when XDP is attached to qede, frm Manish Chopra. 21) Since we encode state in the low pointer bits, dst metrics must be at least 4 byte aligned, which is not necessarily true on m68k. Add annotations to fix this, from Geert Uytterhoeven. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (160 commits) sfc: Include XDP packet headroom in buffer step size. sfc: fix channel allocation with brute force net: dst: Force 4-byte alignment of dst_metrics selftests: pmtu: fix init mtu value in description hv_netvsc: Fix unwanted rx_table reset net: phy: ensure that phy IDs are correctly typed mod_devicetable: fix PHY module format qede: Disable hardware gro when xdp prog is installed net: ena: fix issues in setting interrupt moderation params in ethtool net: ena: fix default tx interrupt moderation interval net/smc: unregister ib devices in reboot_event net: stmmac: platform: Fix MDIO init for platforms without PHY llc2: Fix return statement of llc_stat_ev_rx_null_dsap_xid_c (and _test_c) net: hisilicon: Fix a BUG trigered by wrong bytes_compl net: dsa: ksz: use common define for tag len s390/qeth: don't return -ENOTSUPP to userspace s390/qeth: fix promiscuous mode after reset s390/qeth: handle error due to unsupported transport mode cxgb4: fix refcount init for TC-MQPRIO offload tc-testing: initial tdc selftests for cls_u32 ...
2 parents 0dd1e37 + 4bfeadf commit 78bac77

File tree

176 files changed

+2138
-1005
lines changed

Some content is hidden

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

176 files changed

+2138
-1005
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ Vinod Koul <[email protected]> <[email protected]>
266266
267267
268268
269+
269270
270271
271272

Documentation/devicetree/bindings/net/can/tcan4x5x.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Required properties:
1010
- #size-cells: 0
1111
- spi-max-frequency: Maximum frequency of the SPI bus the chip can
1212
operate at should be less than or equal to 18 MHz.
13-
- device-wake-gpios: Wake up GPIO to wake up the TCAN device.
1413
- interrupt-parent: the phandle to the interrupt controller which provides
1514
the interrupt.
1615
- interrupts: interrupt specification for data-ready.
@@ -23,6 +22,7 @@ Optional properties:
2322
reset.
2423
- device-state-gpios: Input GPIO that indicates if the device is in
2524
a sleep state or if the device is active.
25+
- device-wake-gpios: Wake up GPIO to wake up the TCAN device.
2626

2727
Example:
2828
tcan4x5x: tcan4x5x@0 {
@@ -36,5 +36,5 @@ tcan4x5x: tcan4x5x@0 {
3636
interrupts = <14 GPIO_ACTIVE_LOW>;
3737
device-state-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
3838
device-wake-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
39-
reset-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>;
39+
reset-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
4040
};

Documentation/networking/j1939.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ To claim an address following code example can be used:
339339
.pgn = J1939_PGN_ADDRESS_CLAIMED,
340340
.pgn_mask = J1939_PGN_PDU1_MAX,
341341
}, {
342-
.pgn = J1939_PGN_ADDRESS_REQUEST,
342+
.pgn = J1939_PGN_REQUEST,
343343
.pgn_mask = J1939_PGN_PDU1_MAX,
344344
}, {
345345
.pgn = J1939_PGN_ADDRESS_COMMANDED,

MAINTAINERS

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10110,6 +10110,7 @@ S: Maintained
1011010110
F: drivers/media/radio/radio-maxiradio*
1011110111

1011210112
MCAN MMIO DEVICE DRIVER
10113+
M: Dan Murphy <[email protected]>
1011310114
M: Sriram Dash <[email protected]>
1011410115
1011510116
S: Maintained
@@ -13710,6 +13711,15 @@ L: [email protected]
1371013711
S: Maintained
1371113712
F: drivers/iommu/qcom_iommu.c
1371213713

13714+
QUALCOMM RMNET DRIVER
13715+
M: Subash Abhinov Kasiviswanathan <[email protected]>
13716+
M: Sean Tranchetti <[email protected]>
13717+
13718+
S: Maintained
13719+
F: drivers/net/ethernet/qualcomm/rmnet/
13720+
F: Documentation/networking/device_drivers/qualcomm/rmnet.txt
13721+
F: include/linux/if_rmnet.h
13722+
1371313723
QUALCOMM TSENS THERMAL DRIVER
1371413724
M: Amit Kucheria <[email protected]>
1371513725
@@ -16533,6 +16543,13 @@ L: [email protected] (moderated for non-subscribers)
1653316543
S: Odd Fixes
1653416544
F: sound/soc/codecs/tas571x*
1653516545

16546+
TI TCAN4X5X DEVICE DRIVER
16547+
M: Dan Murphy <[email protected]>
16548+
16549+
S: Maintained
16550+
F: Documentation/devicetree/bindings/net/can/tcan4x5x.txt
16551+
F: drivers/net/can/m_can/tcan4x5x.c
16552+
1653616553
TI TRF7970A NFC DRIVER
1653716554
M: Mark Greer <[email protected]>
1653816555

arch/mips/net/ebpf_jit.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ static void emit_const_to_reg(struct jit_ctx *ctx, int dst, u64 value)
604604
static int emit_bpf_tail_call(struct jit_ctx *ctx, int this_idx)
605605
{
606606
int off, b_off;
607+
int tcc_reg;
607608

608609
ctx->flags |= EBPF_SEEN_TC;
609610
/*
@@ -616,14 +617,14 @@ static int emit_bpf_tail_call(struct jit_ctx *ctx, int this_idx)
616617
b_off = b_imm(this_idx + 1, ctx);
617618
emit_instr(ctx, bne, MIPS_R_AT, MIPS_R_ZERO, b_off);
618619
/*
619-
* if (--TCC < 0)
620+
* if (TCC-- < 0)
620621
* goto out;
621622
*/
622623
/* Delay slot */
623-
emit_instr(ctx, daddiu, MIPS_R_T5,
624-
(ctx->flags & EBPF_TCC_IN_V1) ? MIPS_R_V1 : MIPS_R_S4, -1);
624+
tcc_reg = (ctx->flags & EBPF_TCC_IN_V1) ? MIPS_R_V1 : MIPS_R_S4;
625+
emit_instr(ctx, daddiu, MIPS_R_T5, tcc_reg, -1);
625626
b_off = b_imm(this_idx + 1, ctx);
626-
emit_instr(ctx, bltz, MIPS_R_T5, b_off);
627+
emit_instr(ctx, bltz, tcc_reg, b_off);
627628
/*
628629
* prog = array->ptrs[index];
629630
* if (prog == NULL)

arch/riscv/net/bpf_jit_comp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,14 +631,14 @@ static int emit_bpf_tail_call(int insn, struct rv_jit_context *ctx)
631631
return -1;
632632
emit(rv_bgeu(RV_REG_A2, RV_REG_T1, off >> 1), ctx);
633633

634-
/* if (--TCC < 0)
634+
/* if (TCC-- < 0)
635635
* goto out;
636636
*/
637637
emit(rv_addi(RV_REG_T1, tcc, -1), ctx);
638638
off = (tc_ninsn - (ctx->ninsns - start_insn)) << 2;
639639
if (is_13b_check(off, insn))
640640
return -1;
641-
emit(rv_blt(RV_REG_T1, RV_REG_ZERO, off >> 1), ctx);
641+
emit(rv_blt(tcc, RV_REG_ZERO, off >> 1), ctx);
642642

643643
/* prog = array->ptrs[index];
644644
* if (!prog)

drivers/net/bonding/bond_main.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,9 +2272,6 @@ static void bond_miimon_commit(struct bonding *bond)
22722272
} else if (BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) {
22732273
/* make it immediately active */
22742274
bond_set_active_slave(slave);
2275-
} else if (slave != primary) {
2276-
/* prevent it from being the active one */
2277-
bond_set_backup_slave(slave);
22782275
}
22792276

22802277
slave_info(bond->dev, slave->dev, "link status definitely up, %u Mbps %s duplex\n",
@@ -3702,32 +3699,35 @@ static int bond_neigh_init(struct neighbour *n)
37023699
const struct net_device_ops *slave_ops;
37033700
struct neigh_parms parms;
37043701
struct slave *slave;
3705-
int ret;
3702+
int ret = 0;
37063703

3707-
slave = bond_first_slave(bond);
3704+
rcu_read_lock();
3705+
slave = bond_first_slave_rcu(bond);
37083706
if (!slave)
3709-
return 0;
3707+
goto out;
37103708
slave_ops = slave->dev->netdev_ops;
37113709
if (!slave_ops->ndo_neigh_setup)
3712-
return 0;
3713-
3714-
parms.neigh_setup = NULL;
3715-
parms.neigh_cleanup = NULL;
3716-
ret = slave_ops->ndo_neigh_setup(slave->dev, &parms);
3717-
if (ret)
3718-
return ret;
3710+
goto out;
37193711

3720-
/* Assign slave's neigh_cleanup to neighbour in case cleanup is called
3721-
* after the last slave has been detached. Assumes that all slaves
3722-
* utilize the same neigh_cleanup (true at this writing as only user
3723-
* is ipoib).
3712+
/* TODO: find another way [1] to implement this.
3713+
* Passing a zeroed structure is fragile,
3714+
* but at least we do not pass garbage.
3715+
*
3716+
* [1] One way would be that ndo_neigh_setup() never touch
3717+
* struct neigh_parms, but propagate the new neigh_setup()
3718+
* back to ___neigh_create() / neigh_parms_alloc()
37243719
*/
3725-
n->parms->neigh_cleanup = parms.neigh_cleanup;
3720+
memset(&parms, 0, sizeof(parms));
3721+
ret = slave_ops->ndo_neigh_setup(slave->dev, &parms);
37263722

3727-
if (!parms.neigh_setup)
3728-
return 0;
3723+
if (ret)
3724+
goto out;
37293725

3730-
return parms.neigh_setup(n);
3726+
if (parms.neigh_setup)
3727+
ret = parms.neigh_setup(n);
3728+
out:
3729+
rcu_read_unlock();
3730+
return ret;
37313731
}
37323732

37333733
/* The bonding ndo_neigh_setup is called at init time beofre any

drivers/net/can/flexcan.c

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,34 @@ static struct flexcan_mb __iomem *flexcan_get_mb(const struct flexcan_priv *priv
389389
(&priv->regs->mb[bank][priv->mb_size * mb_index]);
390390
}
391391

392+
static int flexcan_low_power_enter_ack(struct flexcan_priv *priv)
393+
{
394+
struct flexcan_regs __iomem *regs = priv->regs;
395+
unsigned int timeout = FLEXCAN_TIMEOUT_US / 10;
396+
397+
while (timeout-- && !(priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
398+
udelay(10);
399+
400+
if (!(priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
401+
return -ETIMEDOUT;
402+
403+
return 0;
404+
}
405+
406+
static int flexcan_low_power_exit_ack(struct flexcan_priv *priv)
407+
{
408+
struct flexcan_regs __iomem *regs = priv->regs;
409+
unsigned int timeout = FLEXCAN_TIMEOUT_US / 10;
410+
411+
while (timeout-- && (priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
412+
udelay(10);
413+
414+
if (priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK)
415+
return -ETIMEDOUT;
416+
417+
return 0;
418+
}
419+
392420
static void flexcan_enable_wakeup_irq(struct flexcan_priv *priv, bool enable)
393421
{
394422
struct flexcan_regs __iomem *regs = priv->regs;
@@ -407,7 +435,6 @@ static void flexcan_enable_wakeup_irq(struct flexcan_priv *priv, bool enable)
407435
static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv)
408436
{
409437
struct flexcan_regs __iomem *regs = priv->regs;
410-
unsigned int ackval;
411438
u32 reg_mcr;
412439

413440
reg_mcr = priv->read(&regs->mcr);
@@ -418,36 +445,24 @@ static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv)
418445
regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
419446
1 << priv->stm.req_bit, 1 << priv->stm.req_bit);
420447

421-
/* get stop acknowledgment */
422-
if (regmap_read_poll_timeout(priv->stm.gpr, priv->stm.ack_gpr,
423-
ackval, ackval & (1 << priv->stm.ack_bit),
424-
0, FLEXCAN_TIMEOUT_US))
425-
return -ETIMEDOUT;
426-
427-
return 0;
448+
return flexcan_low_power_enter_ack(priv);
428449
}
429450

430451
static inline int flexcan_exit_stop_mode(struct flexcan_priv *priv)
431452
{
432453
struct flexcan_regs __iomem *regs = priv->regs;
433-
unsigned int ackval;
434454
u32 reg_mcr;
435455

436456
/* remove stop request */
437457
regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
438458
1 << priv->stm.req_bit, 0);
439459

440-
/* get stop acknowledgment */
441-
if (regmap_read_poll_timeout(priv->stm.gpr, priv->stm.ack_gpr,
442-
ackval, !(ackval & (1 << priv->stm.ack_bit)),
443-
0, FLEXCAN_TIMEOUT_US))
444-
return -ETIMEDOUT;
445460

446461
reg_mcr = priv->read(&regs->mcr);
447462
reg_mcr &= ~FLEXCAN_MCR_SLF_WAK;
448463
priv->write(reg_mcr, &regs->mcr);
449464

450-
return 0;
465+
return flexcan_low_power_exit_ack(priv);
451466
}
452467

453468
static inline void flexcan_error_irq_enable(const struct flexcan_priv *priv)
@@ -506,39 +521,25 @@ static inline int flexcan_transceiver_disable(const struct flexcan_priv *priv)
506521
static int flexcan_chip_enable(struct flexcan_priv *priv)
507522
{
508523
struct flexcan_regs __iomem *regs = priv->regs;
509-
unsigned int timeout = FLEXCAN_TIMEOUT_US / 10;
510524
u32 reg;
511525

512526
reg = priv->read(&regs->mcr);
513527
reg &= ~FLEXCAN_MCR_MDIS;
514528
priv->write(reg, &regs->mcr);
515529

516-
while (timeout-- && (priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
517-
udelay(10);
518-
519-
if (priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK)
520-
return -ETIMEDOUT;
521-
522-
return 0;
530+
return flexcan_low_power_exit_ack(priv);
523531
}
524532

525533
static int flexcan_chip_disable(struct flexcan_priv *priv)
526534
{
527535
struct flexcan_regs __iomem *regs = priv->regs;
528-
unsigned int timeout = FLEXCAN_TIMEOUT_US / 10;
529536
u32 reg;
530537

531538
reg = priv->read(&regs->mcr);
532539
reg |= FLEXCAN_MCR_MDIS;
533540
priv->write(reg, &regs->mcr);
534541

535-
while (timeout-- && !(priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
536-
udelay(10);
537-
538-
if (!(priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
539-
return -ETIMEDOUT;
540-
541-
return 0;
542+
return flexcan_low_power_enter_ack(priv);
542543
}
543544

544545
static int flexcan_chip_freeze(struct flexcan_priv *priv)
@@ -1722,6 +1723,9 @@ static int __maybe_unused flexcan_resume(struct device *device)
17221723
netif_start_queue(dev);
17231724
if (device_may_wakeup(device)) {
17241725
disable_irq_wake(dev->irq);
1726+
err = flexcan_exit_stop_mode(priv);
1727+
if (err)
1728+
return err;
17251729
} else {
17261730
err = pm_runtime_force_resume(device);
17271731
if (err)
@@ -1767,14 +1771,9 @@ static int __maybe_unused flexcan_noirq_resume(struct device *device)
17671771
{
17681772
struct net_device *dev = dev_get_drvdata(device);
17691773
struct flexcan_priv *priv = netdev_priv(dev);
1770-
int err;
17711774

1772-
if (netif_running(dev) && device_may_wakeup(device)) {
1775+
if (netif_running(dev) && device_may_wakeup(device))
17731776
flexcan_enable_wakeup_irq(priv, false);
1774-
err = flexcan_exit_stop_mode(priv);
1775-
if (err)
1776-
return err;
1777-
}
17781777

17791778
return 0;
17801779
}

0 commit comments

Comments
 (0)