Skip to content

Commit 4d02da9

Browse files
committed
Merge tag 'net-5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Networking fixes for 5.10-rc5, including fixes from the WiFi (mac80211), can and bpf (including the strncpy_from_user fix). Current release - regressions: - mac80211: fix memory leak of filtered powersave frames - mac80211: free sta in sta_info_insert_finish() on errors to avoid sleeping in atomic context - netlabel: fix an uninitialized variable warning added in -rc4 Previous release - regressions: - vsock: forward all packets to the host when no H2G is registered, un-breaking AWS Nitro Enclaves - net: Exempt multicast addresses from five-second neighbor lifetime requirement, decreasing the chances neighbor tables fill up - net/tls: fix corrupted data in recvmsg - qed: fix ILT configuration of SRC block - can: m_can: process interrupt only when not runtime suspended Previous release - always broken: - page_frag: Recover from memory pressure by not recycling pages allocating from the reserves - strncpy_from_user: Mask out bytes after NUL terminator - ip_tunnels: Set tunnel option flag only when tunnel metadata is present, always setting it confuses Open vSwitch - bpf, sockmap: - Fix partial copy_page_to_iter so progress can still be made - Fix socket memory accounting and obeying SO_RCVBUF - net: Have netpoll bring-up DSA management interface - net: bridge: add missing counters to ndo_get_stats64 callback - tcp: brr: only postpone PROBE_RTT if RTT is < current min_rtt - enetc: Workaround MDIO register access HW bug - net/ncsi: move netlink family registration to a subsystem init, instead of tying it to driver probe - net: ftgmac100: unregister NC-SI when removing driver to avoid crash - lan743x: - prevent interrupt storm on open - fix freeing skbs in the wrong context - net/mlx5e: Fix socket refcount leak on kTLS RX resync - net: dsa: mv88e6xxx: Avoid VLAN database corruption on 6097 - fix 21 unset return codes and other mistakes on error paths, mostly detected by the Hulk Robot" * tag 'net-5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (115 commits) fail_function: Remove a redundant mutex unlock selftest/bpf: Test bpf_probe_read_user_str() strips trailing bytes after NUL lib/strncpy_from_user.c: Mask out bytes after NUL terminator. net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid() net/smc: fix matching of existing link groups ipv6: Remove dependency of ipv6_frag_thdr_truncated on ipv6 module libbpf: Fix VERSIONED_SYM_COUNT number parsing net/mlx4_core: Fix init_hca fields offset atm: nicstar: Unmap DMA on send error page_frag: Recover from memory pressure net: dsa: mv88e6xxx: Wait for EEPROM done after HW reset mlxsw: core: Use variable timeout for EMAD retries mlxsw: Fix firmware flashing net: Have netpoll bring-up DSA management interface atl1e: fix error return code in atl1e_probe() atl1c: fix error return code in atl1c_probe() ah6: fix error return code in ah6_input() net: usb: qmi_wwan: Set DTR quirk for MR400 can: m_can: process interrupt only when not runtime suspended can: flexcan: flexcan_chip_start(): fix erroneous flexcan_transceiver_enable() during bus-off recovery ...
2 parents 3be28e9 + e6ea60b commit 4d02da9

File tree

123 files changed

+1054
-379
lines changed

Some content is hidden

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

123 files changed

+1054
-379
lines changed

MAINTAINERS

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,10 +3233,10 @@ F: drivers/iio/accel/bma400*
32333233
BPF (Safe dynamic programs and tools)
32343234
M: Alexei Starovoitov <[email protected]>
32353235
M: Daniel Borkmann <[email protected]>
3236+
M: Andrii Nakryiko <[email protected]>
32363237
R: Martin KaFai Lau <[email protected]>
32373238
R: Song Liu <[email protected]>
32383239
R: Yonghong Song <[email protected]>
3239-
R: Andrii Nakryiko <[email protected]>
32403240
R: John Fastabend <[email protected]>
32413241
R: KP Singh <[email protected]>
32423242
@@ -4700,7 +4700,7 @@ T: git git://linuxtv.org/anttip/media_tree.git
47004700
F: drivers/media/dvb-frontends/cxd2820r*
47014701

47024702
CXGB3 ETHERNET DRIVER (CXGB3)
4703-
M: Vishal Kulkarni <vishal@chelsio.com>
4703+
M: Raju Rangoju <rajur@chelsio.com>
47044704
47054705
S: Supported
47064706
W: http://www.chelsio.com
@@ -4732,7 +4732,7 @@ W: http://www.chelsio.com
47324732
F: drivers/net/ethernet/chelsio/inline_crypto/
47334733

47344734
CXGB4 ETHERNET DRIVER (CXGB4)
4735-
M: Vishal Kulkarni <vishal@chelsio.com>
4735+
M: Raju Rangoju <rajur@chelsio.com>
47364736
47374737
S: Supported
47384738
W: http://www.chelsio.com
@@ -4754,7 +4754,7 @@ F: drivers/infiniband/hw/cxgb4/
47544754
F: include/uapi/rdma/cxgb4-abi.h
47554755

47564756
CXGB4VF ETHERNET DRIVER (CXGB4VF)
4757-
M: Vishal Kulkarni <vishal@gmail.com>
4757+
M: Raju Rangoju <rajur@chelsio.com>
47584758
47594759
S: Supported
47604760
W: http://www.chelsio.com
@@ -9833,13 +9833,6 @@ S: Maintained
98339833
F: arch/mips/lantiq
98349834
F: drivers/soc/lantiq
98359835

9836-
LAPB module
9837-
9838-
S: Orphan
9839-
F: Documentation/networking/lapb-module.rst
9840-
F: include/*/lapb.h
9841-
F: net/lapb/
9842-
98439836
LASI 53c700 driver for PARISC
98449837
M: "James E.J. Bottomley" <[email protected]>
98459838
@@ -18991,12 +18984,18 @@ L: [email protected]
1899118984
S: Maintained
1899218985
N: axp[128]
1899318986

18994-
X.25 NETWORK LAYER
18995-
M: Andrew Hendry <[email protected]>
18987+
X.25 STACK
18988+
M: Martin Schiller <[email protected]>
1899618989
18997-
S: Odd Fixes
18990+
S: Maintained
18991+
F: Documentation/networking/lapb-module.rst
1899818992
F: Documentation/networking/x25*
18993+
F: drivers/net/wan/hdlc_x25.c
18994+
F: drivers/net/wan/lapbether.c
18995+
F: include/*/lapb.h
1899918996
F: include/net/x25*
18997+
F: include/uapi/linux/x25.h
18998+
F: net/lapb/
1900018999
F: net/x25/
1900119000

1900219001
X86 ARCHITECTURE (32-BIT AND 64-BIT)

drivers/atm/nicstar.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,6 +1706,8 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb)
17061706

17071707
if (push_scqe(card, vc, scq, &scqe, skb) != 0) {
17081708
atomic_inc(&vcc->stats->tx_err);
1709+
dma_unmap_single(&card->pcidev->dev, NS_PRV_DMA(skb), skb->len,
1710+
DMA_TO_DEVICE);
17091711
dev_kfree_skb_any(skb);
17101712
return -EIO;
17111713
}

drivers/net/can/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ static void can_restart(struct net_device *dev)
592592

593593
cf->can_id |= CAN_ERR_RESTARTED;
594594

595-
netif_rx(skb);
595+
netif_rx_ni(skb);
596596

597597
stats->rx_packets++;
598598
stats->rx_bytes += cf->can_dlc;

drivers/net/can/flexcan.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,10 @@ static int flexcan_get_berr_counter(const struct net_device *dev,
728728
int err;
729729

730730
err = pm_runtime_get_sync(priv->dev);
731-
if (err < 0)
731+
if (err < 0) {
732+
pm_runtime_put_noidle(priv->dev);
732733
return err;
734+
}
733735

734736
err = __flexcan_get_berr_counter(dev, bec);
735737

@@ -1565,14 +1567,10 @@ static int flexcan_chip_start(struct net_device *dev)
15651567
priv->write(reg_ctrl2, &regs->ctrl2);
15661568
}
15671569

1568-
err = flexcan_transceiver_enable(priv);
1569-
if (err)
1570-
goto out_chip_disable;
1571-
15721570
/* synchronize with the can bus */
15731571
err = flexcan_chip_unfreeze(priv);
15741572
if (err)
1575-
goto out_transceiver_disable;
1573+
goto out_chip_disable;
15761574

15771575
priv->can.state = CAN_STATE_ERROR_ACTIVE;
15781576

@@ -1590,8 +1588,6 @@ static int flexcan_chip_start(struct net_device *dev)
15901588

15911589
return 0;
15921590

1593-
out_transceiver_disable:
1594-
flexcan_transceiver_disable(priv);
15951591
out_chip_disable:
15961592
flexcan_chip_disable(priv);
15971593
return err;
@@ -1621,7 +1617,6 @@ static int __flexcan_chip_stop(struct net_device *dev, bool disable_on_error)
16211617
priv->write(priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL,
16221618
&regs->ctrl);
16231619

1624-
flexcan_transceiver_disable(priv);
16251620
priv->can.state = CAN_STATE_STOPPED;
16261621

16271622
return 0;
@@ -1654,17 +1649,23 @@ static int flexcan_open(struct net_device *dev)
16541649
}
16551650

16561651
err = pm_runtime_get_sync(priv->dev);
1657-
if (err < 0)
1652+
if (err < 0) {
1653+
pm_runtime_put_noidle(priv->dev);
16581654
return err;
1655+
}
16591656

16601657
err = open_candev(dev);
16611658
if (err)
16621659
goto out_runtime_put;
16631660

1664-
err = request_irq(dev->irq, flexcan_irq, IRQF_SHARED, dev->name, dev);
1661+
err = flexcan_transceiver_enable(priv);
16651662
if (err)
16661663
goto out_close;
16671664

1665+
err = request_irq(dev->irq, flexcan_irq, IRQF_SHARED, dev->name, dev);
1666+
if (err)
1667+
goto out_transceiver_disable;
1668+
16681669
if (priv->can.ctrlmode & CAN_CTRLMODE_FD)
16691670
priv->mb_size = sizeof(struct flexcan_mb) + CANFD_MAX_DLEN;
16701671
else
@@ -1716,6 +1717,8 @@ static int flexcan_open(struct net_device *dev)
17161717
can_rx_offload_del(&priv->offload);
17171718
out_free_irq:
17181719
free_irq(dev->irq, dev);
1720+
out_transceiver_disable:
1721+
flexcan_transceiver_disable(priv);
17191722
out_close:
17201723
close_candev(dev);
17211724
out_runtime_put:
@@ -1734,6 +1737,7 @@ static int flexcan_close(struct net_device *dev)
17341737

17351738
can_rx_offload_del(&priv->offload);
17361739
free_irq(dev->irq, dev);
1740+
flexcan_transceiver_disable(priv);
17371741

17381742
close_candev(dev);
17391743
pm_runtime_put(priv->dev);
@@ -1852,7 +1856,7 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)
18521856
return -EINVAL;
18531857

18541858
/* stop mode property format is:
1855-
* <&gpr req_gpr>.
1859+
* <&gpr req_gpr req_bit>.
18561860
*/
18571861
ret = of_property_read_u32_array(np, "fsl,stop-mode", out_val,
18581862
ARRAY_SIZE(out_val));

drivers/net/can/kvaser_pciefd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,12 @@ struct kvaser_pciefd_tx_packet {
287287
static const struct can_bittiming_const kvaser_pciefd_bittiming_const = {
288288
.name = KVASER_PCIEFD_DRV_NAME,
289289
.tseg1_min = 1,
290-
.tseg1_max = 255,
290+
.tseg1_max = 512,
291291
.tseg2_min = 1,
292292
.tseg2_max = 32,
293293
.sjw_max = 16,
294294
.brp_min = 1,
295-
.brp_max = 4096,
295+
.brp_max = 8192,
296296
.brp_inc = 1,
297297
};
298298

drivers/net/can/m_can/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ config CAN_M_CAN_PLATFORM
1616

1717
config CAN_M_CAN_TCAN4X5X
1818
depends on CAN_M_CAN
19-
depends on REGMAP_SPI
19+
depends on SPI
20+
select REGMAP_SPI
2021
tristate "TCAN4X5X M_CAN device"
2122
help
2223
Say Y here if you want support for Texas Instruments TCAN4x5x

drivers/net/can/m_can/m_can.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ static int m_can_handle_state_change(struct net_device *dev,
665665
unsigned int ecr;
666666

667667
switch (new_state) {
668-
case CAN_STATE_ERROR_ACTIVE:
668+
case CAN_STATE_ERROR_WARNING:
669669
/* error warning state */
670670
cdev->can.can_stats.error_warning++;
671671
cdev->can.state = CAN_STATE_ERROR_WARNING;
@@ -694,7 +694,7 @@ static int m_can_handle_state_change(struct net_device *dev,
694694
__m_can_get_berr_counter(dev, &bec);
695695

696696
switch (new_state) {
697-
case CAN_STATE_ERROR_ACTIVE:
697+
case CAN_STATE_ERROR_WARNING:
698698
/* error warning state */
699699
cf->can_id |= CAN_ERR_CRTL;
700700
cf->data[1] = (bec.txerr > bec.rxerr) ?
@@ -956,6 +956,8 @@ static irqreturn_t m_can_isr(int irq, void *dev_id)
956956
struct net_device_stats *stats = &dev->stats;
957957
u32 ir;
958958

959+
if (pm_runtime_suspended(cdev->dev))
960+
return IRQ_NONE;
959961
ir = m_can_read(cdev, M_CAN_IR);
960962
if (!ir)
961963
return IRQ_NONE;
@@ -1414,6 +1416,9 @@ static void m_can_stop(struct net_device *dev)
14141416
/* disable all interrupts */
14151417
m_can_disable_all_interrupts(cdev);
14161418

1419+
/* Set init mode to disengage from the network */
1420+
m_can_config_endisable(cdev, true);
1421+
14171422
/* set the state as STOPPED */
14181423
cdev->can.state = CAN_STATE_STOPPED;
14191424
}
@@ -1812,6 +1817,12 @@ struct m_can_classdev *m_can_class_allocate_dev(struct device *dev)
18121817
}
18131818
EXPORT_SYMBOL_GPL(m_can_class_allocate_dev);
18141819

1820+
void m_can_class_free_dev(struct net_device *net)
1821+
{
1822+
free_candev(net);
1823+
}
1824+
EXPORT_SYMBOL_GPL(m_can_class_free_dev);
1825+
18151826
int m_can_class_register(struct m_can_classdev *m_can_dev)
18161827
{
18171828
int ret;
@@ -1850,7 +1861,6 @@ int m_can_class_register(struct m_can_classdev *m_can_dev)
18501861
if (ret) {
18511862
if (m_can_dev->pm_clock_support)
18521863
pm_runtime_disable(m_can_dev->dev);
1853-
free_candev(m_can_dev->net);
18541864
}
18551865

18561866
return ret;
@@ -1908,8 +1918,6 @@ void m_can_class_unregister(struct m_can_classdev *m_can_dev)
19081918
unregister_candev(m_can_dev->net);
19091919

19101920
m_can_clk_stop(m_can_dev);
1911-
1912-
free_candev(m_can_dev->net);
19131921
}
19141922
EXPORT_SYMBOL_GPL(m_can_class_unregister);
19151923

drivers/net/can/m_can/m_can.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ struct m_can_classdev {
9999
};
100100

101101
struct m_can_classdev *m_can_class_allocate_dev(struct device *dev);
102+
void m_can_class_free_dev(struct net_device *net);
102103
int m_can_class_register(struct m_can_classdev *cdev);
103104
void m_can_class_unregister(struct m_can_classdev *cdev);
104105
int m_can_class_get_clocks(struct m_can_classdev *cdev);

drivers/net/can/m_can/m_can_platform.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,32 +67,36 @@ static int m_can_plat_probe(struct platform_device *pdev)
6767
return -ENOMEM;
6868

6969
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
70-
if (!priv)
71-
return -ENOMEM;
70+
if (!priv) {
71+
ret = -ENOMEM;
72+
goto probe_fail;
73+
}
7274

7375
mcan_class->device_data = priv;
7476

75-
m_can_class_get_clocks(mcan_class);
77+
ret = m_can_class_get_clocks(mcan_class);
78+
if (ret)
79+
goto probe_fail;
7680

7781
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "m_can");
7882
addr = devm_ioremap_resource(&pdev->dev, res);
7983
irq = platform_get_irq_byname(pdev, "int0");
8084
if (IS_ERR(addr) || irq < 0) {
8185
ret = -EINVAL;
82-
goto failed_ret;
86+
goto probe_fail;
8387
}
8488

8589
/* message ram could be shared */
8690
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "message_ram");
8791
if (!res) {
8892
ret = -ENODEV;
89-
goto failed_ret;
93+
goto probe_fail;
9094
}
9195

9296
mram_addr = devm_ioremap(&pdev->dev, res->start, resource_size(res));
9397
if (!mram_addr) {
9498
ret = -ENOMEM;
95-
goto failed_ret;
99+
goto probe_fail;
96100
}
97101

98102
priv->base = addr;
@@ -111,9 +115,10 @@ static int m_can_plat_probe(struct platform_device *pdev)
111115

112116
m_can_init_ram(mcan_class);
113117

114-
ret = m_can_class_register(mcan_class);
118+
return m_can_class_register(mcan_class);
115119

116-
failed_ret:
120+
probe_fail:
121+
m_can_class_free_dev(mcan_class->net);
117122
return ret;
118123
}
119124

@@ -134,6 +139,8 @@ static int m_can_plat_remove(struct platform_device *pdev)
134139

135140
m_can_class_unregister(mcan_class);
136141

142+
m_can_class_free_dev(mcan_class->net);
143+
137144
platform_set_drvdata(pdev, NULL);
138145

139146
return 0;

0 commit comments

Comments
 (0)