Skip to content

Commit bfc64d9

Browse files
committed
Merge tag 'net-6.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from can and netfilter. Things are slowing down quite a bit, mostly driver fixes here. No known ongoing investigations. Current release - new code bugs: - eth: ti: am65-cpsw: - fix multi queue Rx on J7 - fix warning in am65_cpsw_nuss_remove_rx_chns() Previous releases - regressions: - mptcp: do not require admin perm to list endpoints, got missed in a refactoring - mptcp: use sock_kfree_s instead of kfree Previous releases - always broken: - sctp: properly validate chunk size in sctp_sf_ootb() fix OOB access - virtio_net: make RSS interact properly with queue number - can: mcp251xfd: mcp251xfd_get_tef_len(): fix length calculation - can: mcp251xfd: mcp251xfd_ring_alloc(): fix coalescing configuration when switching CAN modes Misc: - revert earlier hns3 fixes, they were ignoring IOMMU abstractions and need to be reworked - can: {cc770,sja1000}_isa: allow building on x86_64" * tag 'net-6.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (42 commits) drivers: net: ionic: add missed debugfs cleanup to ionic_probe() error path net/smc: do not leave a dangling sk pointer in __smc_create() rxrpc: Fix missing locking causing hanging calls net/smc: Fix lookup of netdev by using ib_device_get_netdev() net: arc: rockchip: fix emac mdio node support net: arc: fix the device for dma_map_single/dma_unmap_single virtio_net: Update rss when set queue virtio_net: Sync rss config to device when virtnet_probe virtio_net: Add hash_key_length check virtio_net: Support dynamic rss indirection table size netfilter: nf_tables: wait for rcu grace period on net_device removal net: stmmac: Fix unbalanced IRQ wake disable warning on single irq case net: vertexcom: mse102x: Fix possible double free of TX skb mptcp: use sock_kfree_s instead of kfree mptcp: no admin perm to list endpoints net: phy: ti: add PHY_RST_AFTER_CLK_EN flag net: ethernet: ti: am65-cpsw: fix warning in am65_cpsw_nuss_remove_rx_chns() net: ethernet: ti: am65-cpsw: Fix multi queue Rx on J7 net: hns3: fix kernel crash when uninstalling driver Revert "Merge branch 'there-are-some-bugfix-for-the-hns3-ethernet-driver'" ...
2 parents 80fb253 + 71712cf commit bfc64d9

Some content is hidden

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

57 files changed

+333
-337
lines changed

CREDITS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,10 @@ S: Dreisbachstrasse 24
12041204
S: D-57250 Netphen
12051205
S: Germany
12061206

1207+
N: Florian Fainelli
1208+
1209+
D: DSA
1210+
12071211
N: Rik Faith
12081212
12091213
D: Future Domain TMC-16x0 SCSI driver (author)

Documentation/devicetree/bindings/net/xlnx,axi-ethernet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ properties:
6161
- gmii
6262
- rgmii
6363
- sgmii
64-
- 1000BaseX
64+
- 1000base-x
6565

6666
xlnx,phy-type:
6767
description:

Documentation/netlink/specs/mptcp_pm.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ operations:
293293
doc: Get endpoint information
294294
attribute-set: attr
295295
dont-validate: [ strict ]
296-
flags: [ uns-admin-perm ]
297296
do: &get-addr-attrs
298297
request:
299298
attributes:

Documentation/networking/j1939.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ format, the Group Extension is set in the PS-field.
121121

122122
On the other hand, when using PDU1 format, the PS-field contains a so-called
123123
Destination Address, which is _not_ part of the PGN. When communicating a PGN
124-
from user space to kernel (or vice versa) and PDU2 format is used, the PS-field
124+
from user space to kernel (or vice versa) and PDU1 format is used, the PS-field
125125
of the PGN shall be set to zero. The Destination Address shall be set
126126
elsewhere.
127127

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16083,7 +16083,6 @@ F: drivers/net/wireless/
1608316083

1608416084
NETWORKING [DSA]
1608516085
M: Andrew Lunn <[email protected]>
16086-
M: Florian Fainelli <[email protected]>
1608716086
M: Vladimir Oltean <[email protected]>
1608816087
S: Maintained
1608916088
F: Documentation/devicetree/bindings/net/dsa/

drivers/net/can/c_can/c_can_main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,6 @@ static int c_can_handle_bus_err(struct net_device *dev,
10111011

10121012
/* common for all type of bus errors */
10131013
priv->can.can_stats.bus_error++;
1014-
stats->rx_errors++;
10151014

10161015
/* propagate the error condition to the CAN stack */
10171016
skb = alloc_can_err_skb(dev, &cf);
@@ -1027,26 +1026,32 @@ static int c_can_handle_bus_err(struct net_device *dev,
10271026
case LEC_STUFF_ERROR:
10281027
netdev_dbg(dev, "stuff error\n");
10291028
cf->data[2] |= CAN_ERR_PROT_STUFF;
1029+
stats->rx_errors++;
10301030
break;
10311031
case LEC_FORM_ERROR:
10321032
netdev_dbg(dev, "form error\n");
10331033
cf->data[2] |= CAN_ERR_PROT_FORM;
1034+
stats->rx_errors++;
10341035
break;
10351036
case LEC_ACK_ERROR:
10361037
netdev_dbg(dev, "ack error\n");
10371038
cf->data[3] = CAN_ERR_PROT_LOC_ACK;
1039+
stats->tx_errors++;
10381040
break;
10391041
case LEC_BIT1_ERROR:
10401042
netdev_dbg(dev, "bit1 error\n");
10411043
cf->data[2] |= CAN_ERR_PROT_BIT1;
1044+
stats->tx_errors++;
10421045
break;
10431046
case LEC_BIT0_ERROR:
10441047
netdev_dbg(dev, "bit0 error\n");
10451048
cf->data[2] |= CAN_ERR_PROT_BIT0;
1049+
stats->tx_errors++;
10461050
break;
10471051
case LEC_CRC_ERROR:
10481052
netdev_dbg(dev, "CRC error\n");
10491053
cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ;
1054+
stats->rx_errors++;
10501055
break;
10511056
default:
10521057
break;

drivers/net/can/cc770/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if CAN_CC770
77

88
config CAN_CC770_ISA
99
tristate "ISA Bus based legacy CC770 driver"
10-
depends on ISA
10+
depends on HAS_IOPORT
1111
help
1212
This driver adds legacy support for CC770 and AN82527 chips
1313
connected to the ISA bus using I/O port, memory mapped or

drivers/net/can/m_can/m_can.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,8 @@ static int m_can_close(struct net_device *dev)
17651765
netif_stop_queue(dev);
17661766

17671767
m_can_stop(dev);
1768-
free_irq(dev->irq, dev);
1768+
if (dev->irq)
1769+
free_irq(dev->irq, dev);
17691770

17701771
m_can_clean(dev);
17711772

drivers/net/can/rockchip/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
config CAN_ROCKCHIP_CANFD
44
tristate "Rockchip CAN-FD controller"
5-
depends on OF || COMPILE_TEST
5+
depends on OF
6+
depends on ARCH_ROCKCHIP || COMPILE_TEST
67
select CAN_RX_OFFLOAD
78
help
89
Say Y here if you want to use CAN-FD controller found on

drivers/net/can/sja1000/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ config CAN_PLX_PCI
8787

8888
config CAN_SJA1000_ISA
8989
tristate "ISA Bus based legacy SJA1000 driver"
90-
depends on ISA
90+
depends on HAS_IOPORT
9191
help
9292
This driver adds legacy support for SJA1000 chips connected to
9393
the ISA bus using I/O port, memory mapped or indirect access.

drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// mcp251xfd - Microchip MCP251xFD Family CAN controller driver
44
//
5-
// Copyright (c) 2019, 2020, 2021 Pengutronix,
5+
// Copyright (c) 2019, 2020, 2021, 2024 Pengutronix,
66
// Marc Kleine-Budde <[email protected]>
77
//
88
// Based on:
@@ -483,9 +483,11 @@ int mcp251xfd_ring_alloc(struct mcp251xfd_priv *priv)
483483
};
484484
const struct ethtool_coalesce ec = {
485485
.rx_coalesce_usecs_irq = priv->rx_coalesce_usecs_irq,
486-
.rx_max_coalesced_frames_irq = priv->rx_obj_num_coalesce_irq,
486+
.rx_max_coalesced_frames_irq = priv->rx_obj_num_coalesce_irq == 0 ?
487+
1 : priv->rx_obj_num_coalesce_irq,
487488
.tx_coalesce_usecs_irq = priv->tx_coalesce_usecs_irq,
488-
.tx_max_coalesced_frames_irq = priv->tx_obj_num_coalesce_irq,
489+
.tx_max_coalesced_frames_irq = priv->tx_obj_num_coalesce_irq == 0 ?
490+
1 : priv->tx_obj_num_coalesce_irq,
489491
};
490492
struct can_ram_layout layout;
491493

drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
#include "mcp251xfd.h"
1818

19-
static inline bool mcp251xfd_tx_fifo_sta_full(u32 fifo_sta)
19+
static inline bool mcp251xfd_tx_fifo_sta_empty(u32 fifo_sta)
2020
{
21-
return !(fifo_sta & MCP251XFD_REG_FIFOSTA_TFNRFNIF);
21+
return fifo_sta & MCP251XFD_REG_FIFOSTA_TFERFFIF;
2222
}
2323

2424
static inline int
@@ -122,7 +122,11 @@ mcp251xfd_get_tef_len(struct mcp251xfd_priv *priv, u8 *len_p)
122122
if (err)
123123
return err;
124124

125-
if (mcp251xfd_tx_fifo_sta_full(fifo_sta)) {
125+
/* If the chip says the TX-FIFO is empty, but there are no TX
126+
* buffers free in the ring, we assume all have been sent.
127+
*/
128+
if (mcp251xfd_tx_fifo_sta_empty(fifo_sta) &&
129+
mcp251xfd_get_tx_free(tx_ring) == 0) {
126130
*len_p = tx_ring->obj_num;
127131
return 0;
128132
}

drivers/net/ethernet/arc/emac_main.c

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ static void arc_emac_tx_clean(struct net_device *ndev)
111111
{
112112
struct arc_emac_priv *priv = netdev_priv(ndev);
113113
struct net_device_stats *stats = &ndev->stats;
114+
struct device *dev = ndev->dev.parent;
114115
unsigned int i;
115116

116117
for (i = 0; i < TX_BD_NUM; i++) {
@@ -140,7 +141,7 @@ static void arc_emac_tx_clean(struct net_device *ndev)
140141
stats->tx_bytes += skb->len;
141142
}
142143

143-
dma_unmap_single(&ndev->dev, dma_unmap_addr(tx_buff, addr),
144+
dma_unmap_single(dev, dma_unmap_addr(tx_buff, addr),
144145
dma_unmap_len(tx_buff, len), DMA_TO_DEVICE);
145146

146147
/* return the sk_buff to system */
@@ -174,6 +175,7 @@ static void arc_emac_tx_clean(struct net_device *ndev)
174175
static int arc_emac_rx(struct net_device *ndev, int budget)
175176
{
176177
struct arc_emac_priv *priv = netdev_priv(ndev);
178+
struct device *dev = ndev->dev.parent;
177179
unsigned int work_done;
178180

179181
for (work_done = 0; work_done < budget; work_done++) {
@@ -223,9 +225,9 @@ static int arc_emac_rx(struct net_device *ndev, int budget)
223225
continue;
224226
}
225227

226-
addr = dma_map_single(&ndev->dev, (void *)skb->data,
228+
addr = dma_map_single(dev, (void *)skb->data,
227229
EMAC_BUFFER_SIZE, DMA_FROM_DEVICE);
228-
if (dma_mapping_error(&ndev->dev, addr)) {
230+
if (dma_mapping_error(dev, addr)) {
229231
if (net_ratelimit())
230232
netdev_err(ndev, "cannot map dma buffer\n");
231233
dev_kfree_skb(skb);
@@ -237,7 +239,7 @@ static int arc_emac_rx(struct net_device *ndev, int budget)
237239
}
238240

239241
/* unmap previosly mapped skb */
240-
dma_unmap_single(&ndev->dev, dma_unmap_addr(rx_buff, addr),
242+
dma_unmap_single(dev, dma_unmap_addr(rx_buff, addr),
241243
dma_unmap_len(rx_buff, len), DMA_FROM_DEVICE);
242244

243245
pktlen = info & LEN_MASK;
@@ -423,6 +425,7 @@ static int arc_emac_open(struct net_device *ndev)
423425
{
424426
struct arc_emac_priv *priv = netdev_priv(ndev);
425427
struct phy_device *phy_dev = ndev->phydev;
428+
struct device *dev = ndev->dev.parent;
426429
int i;
427430

428431
phy_dev->autoneg = AUTONEG_ENABLE;
@@ -445,9 +448,9 @@ static int arc_emac_open(struct net_device *ndev)
445448
if (unlikely(!rx_buff->skb))
446449
return -ENOMEM;
447450

448-
addr = dma_map_single(&ndev->dev, (void *)rx_buff->skb->data,
451+
addr = dma_map_single(dev, (void *)rx_buff->skb->data,
449452
EMAC_BUFFER_SIZE, DMA_FROM_DEVICE);
450-
if (dma_mapping_error(&ndev->dev, addr)) {
453+
if (dma_mapping_error(dev, addr)) {
451454
netdev_err(ndev, "cannot dma map\n");
452455
dev_kfree_skb(rx_buff->skb);
453456
return -ENOMEM;
@@ -548,14 +551,15 @@ static void arc_emac_set_rx_mode(struct net_device *ndev)
548551
static void arc_free_tx_queue(struct net_device *ndev)
549552
{
550553
struct arc_emac_priv *priv = netdev_priv(ndev);
554+
struct device *dev = ndev->dev.parent;
551555
unsigned int i;
552556

553557
for (i = 0; i < TX_BD_NUM; i++) {
554558
struct arc_emac_bd *txbd = &priv->txbd[i];
555559
struct buffer_state *tx_buff = &priv->tx_buff[i];
556560

557561
if (tx_buff->skb) {
558-
dma_unmap_single(&ndev->dev,
562+
dma_unmap_single(dev,
559563
dma_unmap_addr(tx_buff, addr),
560564
dma_unmap_len(tx_buff, len),
561565
DMA_TO_DEVICE);
@@ -579,14 +583,15 @@ static void arc_free_tx_queue(struct net_device *ndev)
579583
static void arc_free_rx_queue(struct net_device *ndev)
580584
{
581585
struct arc_emac_priv *priv = netdev_priv(ndev);
586+
struct device *dev = ndev->dev.parent;
582587
unsigned int i;
583588

584589
for (i = 0; i < RX_BD_NUM; i++) {
585590
struct arc_emac_bd *rxbd = &priv->rxbd[i];
586591
struct buffer_state *rx_buff = &priv->rx_buff[i];
587592

588593
if (rx_buff->skb) {
589-
dma_unmap_single(&ndev->dev,
594+
dma_unmap_single(dev,
590595
dma_unmap_addr(rx_buff, addr),
591596
dma_unmap_len(rx_buff, len),
592597
DMA_FROM_DEVICE);
@@ -679,6 +684,7 @@ static netdev_tx_t arc_emac_tx(struct sk_buff *skb, struct net_device *ndev)
679684
unsigned int len, *txbd_curr = &priv->txbd_curr;
680685
struct net_device_stats *stats = &ndev->stats;
681686
__le32 *info = &priv->txbd[*txbd_curr].info;
687+
struct device *dev = ndev->dev.parent;
682688
dma_addr_t addr;
683689

684690
if (skb_padto(skb, ETH_ZLEN))
@@ -692,10 +698,9 @@ static netdev_tx_t arc_emac_tx(struct sk_buff *skb, struct net_device *ndev)
692698
return NETDEV_TX_BUSY;
693699
}
694700

695-
addr = dma_map_single(&ndev->dev, (void *)skb->data, len,
696-
DMA_TO_DEVICE);
701+
addr = dma_map_single(dev, (void *)skb->data, len, DMA_TO_DEVICE);
697702

698-
if (unlikely(dma_mapping_error(&ndev->dev, addr))) {
703+
if (unlikely(dma_mapping_error(dev, addr))) {
699704
stats->tx_dropped++;
700705
stats->tx_errors++;
701706
dev_kfree_skb_any(skb);

drivers/net/ethernet/arc/emac_mdio.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv)
133133
struct arc_emac_mdio_bus_data *data = &priv->bus_data;
134134
struct device_node *np = priv->dev->of_node;
135135
const char *name = "Synopsys MII Bus";
136+
struct device_node *mdio_node;
136137
struct mii_bus *bus;
137138
int error;
138139

@@ -164,7 +165,13 @@ int arc_mdio_probe(struct arc_emac_priv *priv)
164165

165166
snprintf(bus->id, MII_BUS_ID_SIZE, "%s", bus->name);
166167

167-
error = of_mdiobus_register(bus, priv->dev->of_node);
168+
/* Backwards compatibility for EMAC nodes without MDIO subnode. */
169+
mdio_node = of_get_child_by_name(np, "mdio");
170+
if (!mdio_node)
171+
mdio_node = of_node_get(np);
172+
173+
error = of_mdiobus_register(bus, mdio_node);
174+
of_node_put(mdio_node);
168175
if (error) {
169176
mdiobus_free(bus);
170177
return dev_err_probe(priv->dev, error,

drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ DECLARE_EVENT_CLASS(dpaa_eth_fd,
5656
__entry->fd_format = qm_fd_get_format(fd);
5757
__entry->fd_offset = qm_fd_get_offset(fd);
5858
__entry->fd_length = qm_fd_get_length(fd);
59-
__entry->fd_status = fd->status;
59+
__entry->fd_status = __be32_to_cpu(fd->status);
6060
__assign_str(name);
6161
),
6262

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -665,19 +665,11 @@ static int enetc_sriov_configure(struct pci_dev *pdev, int num_vfs)
665665

666666
if (!num_vfs) {
667667
enetc_msg_psi_free(pf);
668-
kfree(pf->vf_state);
669668
pf->num_vfs = 0;
670669
pci_disable_sriov(pdev);
671670
} else {
672671
pf->num_vfs = num_vfs;
673672

674-
pf->vf_state = kcalloc(num_vfs, sizeof(struct enetc_vf_state),
675-
GFP_KERNEL);
676-
if (!pf->vf_state) {
677-
pf->num_vfs = 0;
678-
return -ENOMEM;
679-
}
680-
681673
err = enetc_msg_psi_init(pf);
682674
if (err) {
683675
dev_err(&pdev->dev, "enetc_msg_psi_init (%d)\n", err);
@@ -696,7 +688,6 @@ static int enetc_sriov_configure(struct pci_dev *pdev, int num_vfs)
696688
err_en_sriov:
697689
enetc_msg_psi_free(pf);
698690
err_msg_psi:
699-
kfree(pf->vf_state);
700691
pf->num_vfs = 0;
701692

702693
return err;
@@ -1286,6 +1277,12 @@ static int enetc_pf_probe(struct pci_dev *pdev,
12861277
pf = enetc_si_priv(si);
12871278
pf->si = si;
12881279
pf->total_vfs = pci_sriov_get_totalvfs(pdev);
1280+
if (pf->total_vfs) {
1281+
pf->vf_state = kcalloc(pf->total_vfs, sizeof(struct enetc_vf_state),
1282+
GFP_KERNEL);
1283+
if (!pf->vf_state)
1284+
goto err_alloc_vf_state;
1285+
}
12891286

12901287
err = enetc_setup_mac_addresses(node, pf);
12911288
if (err)
@@ -1363,6 +1360,8 @@ static int enetc_pf_probe(struct pci_dev *pdev,
13631360
free_netdev(ndev);
13641361
err_alloc_netdev:
13651362
err_setup_mac_addresses:
1363+
kfree(pf->vf_state);
1364+
err_alloc_vf_state:
13661365
enetc_psi_destroy(pdev);
13671366
err_psi_create:
13681367
return err;
@@ -1389,6 +1388,7 @@ static void enetc_pf_remove(struct pci_dev *pdev)
13891388
enetc_free_si_resources(priv);
13901389

13911390
free_netdev(si->ndev);
1391+
kfree(pf->vf_state);
13921392

13931393
enetc_psi_destroy(pdev);
13941394
}

0 commit comments

Comments
 (0)