Skip to content

Commit

Permalink
Merge tag 'net-6.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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'"
  ...
  • Loading branch information
Linus Torvalds committed Nov 7, 2024
2 parents 80fb253 + 71712cf commit bfc64d9
Show file tree
Hide file tree
Showing 57 changed files with 333 additions and 337 deletions.
4 changes: 4 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,10 @@ S: Dreisbachstrasse 24
S: D-57250 Netphen
S: Germany

N: Florian Fainelli
E: f.fainelli@gmail.com
D: DSA

N: Rik Faith
E: faith@acm.org
D: Future Domain TMC-16x0 SCSI driver (author)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ properties:
- gmii
- rgmii
- sgmii
- 1000BaseX
- 1000base-x

xlnx,phy-type:
description:
Expand Down
1 change: 0 additions & 1 deletion Documentation/netlink/specs/mptcp_pm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ operations:
doc: Get endpoint information
attribute-set: attr
dont-validate: [ strict ]
flags: [ uns-admin-perm ]
do: &get-addr-attrs
request:
attributes:
Expand Down
2 changes: 1 addition & 1 deletion Documentation/networking/j1939.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ format, the Group Extension is set in the PS-field.

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

Expand Down
1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -16083,7 +16083,6 @@ F: drivers/net/wireless/

NETWORKING [DSA]
M: Andrew Lunn <andrew@lunn.ch>
M: Florian Fainelli <f.fainelli@gmail.com>
M: Vladimir Oltean <olteanv@gmail.com>
S: Maintained
F: Documentation/devicetree/bindings/net/dsa/
Expand Down
7 changes: 6 additions & 1 deletion drivers/net/can/c_can/c_can_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,6 @@ static int c_can_handle_bus_err(struct net_device *dev,

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

/* propagate the error condition to the CAN stack */
skb = alloc_can_err_skb(dev, &cf);
Expand All @@ -1027,26 +1026,32 @@ static int c_can_handle_bus_err(struct net_device *dev,
case LEC_STUFF_ERROR:
netdev_dbg(dev, "stuff error\n");
cf->data[2] |= CAN_ERR_PROT_STUFF;
stats->rx_errors++;
break;
case LEC_FORM_ERROR:
netdev_dbg(dev, "form error\n");
cf->data[2] |= CAN_ERR_PROT_FORM;
stats->rx_errors++;
break;
case LEC_ACK_ERROR:
netdev_dbg(dev, "ack error\n");
cf->data[3] = CAN_ERR_PROT_LOC_ACK;
stats->tx_errors++;
break;
case LEC_BIT1_ERROR:
netdev_dbg(dev, "bit1 error\n");
cf->data[2] |= CAN_ERR_PROT_BIT1;
stats->tx_errors++;
break;
case LEC_BIT0_ERROR:
netdev_dbg(dev, "bit0 error\n");
cf->data[2] |= CAN_ERR_PROT_BIT0;
stats->tx_errors++;
break;
case LEC_CRC_ERROR:
netdev_dbg(dev, "CRC error\n");
cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ;
stats->rx_errors++;
break;
default:
break;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/can/cc770/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if CAN_CC770

config CAN_CC770_ISA
tristate "ISA Bus based legacy CC770 driver"
depends on ISA
depends on HAS_IOPORT
help
This driver adds legacy support for CC770 and AN82527 chips
connected to the ISA bus using I/O port, memory mapped or
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/can/m_can/m_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,8 @@ static int m_can_close(struct net_device *dev)
netif_stop_queue(dev);

m_can_stop(dev);
free_irq(dev->irq, dev);
if (dev->irq)
free_irq(dev->irq, dev);

m_can_clean(dev);

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/can/rockchip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

config CAN_ROCKCHIP_CANFD
tristate "Rockchip CAN-FD controller"
depends on OF || COMPILE_TEST
depends on OF
depends on ARCH_ROCKCHIP || COMPILE_TEST
select CAN_RX_OFFLOAD
help
Say Y here if you want to use CAN-FD controller found on
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/can/sja1000/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ config CAN_PLX_PCI

config CAN_SJA1000_ISA
tristate "ISA Bus based legacy SJA1000 driver"
depends on ISA
depends on HAS_IOPORT
help
This driver adds legacy support for SJA1000 chips connected to
the ISA bus using I/O port, memory mapped or indirect access.
Expand Down
8 changes: 5 additions & 3 deletions drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// mcp251xfd - Microchip MCP251xFD Family CAN controller driver
//
// Copyright (c) 2019, 2020, 2021 Pengutronix,
// Copyright (c) 2019, 2020, 2021, 2024 Pengutronix,
// Marc Kleine-Budde <kernel@pengutronix.de>
//
// Based on:
Expand Down Expand Up @@ -483,9 +483,11 @@ int mcp251xfd_ring_alloc(struct mcp251xfd_priv *priv)
};
const struct ethtool_coalesce ec = {
.rx_coalesce_usecs_irq = priv->rx_coalesce_usecs_irq,
.rx_max_coalesced_frames_irq = priv->rx_obj_num_coalesce_irq,
.rx_max_coalesced_frames_irq = priv->rx_obj_num_coalesce_irq == 0 ?
1 : priv->rx_obj_num_coalesce_irq,
.tx_coalesce_usecs_irq = priv->tx_coalesce_usecs_irq,
.tx_max_coalesced_frames_irq = priv->tx_obj_num_coalesce_irq,
.tx_max_coalesced_frames_irq = priv->tx_obj_num_coalesce_irq == 0 ?
1 : priv->tx_obj_num_coalesce_irq,
};
struct can_ram_layout layout;

Expand Down
10 changes: 7 additions & 3 deletions drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

#include "mcp251xfd.h"

static inline bool mcp251xfd_tx_fifo_sta_full(u32 fifo_sta)
static inline bool mcp251xfd_tx_fifo_sta_empty(u32 fifo_sta)
{
return !(fifo_sta & MCP251XFD_REG_FIFOSTA_TFNRFNIF);
return fifo_sta & MCP251XFD_REG_FIFOSTA_TFERFFIF;
}

static inline int
Expand Down Expand Up @@ -122,7 +122,11 @@ mcp251xfd_get_tef_len(struct mcp251xfd_priv *priv, u8 *len_p)
if (err)
return err;

if (mcp251xfd_tx_fifo_sta_full(fifo_sta)) {
/* If the chip says the TX-FIFO is empty, but there are no TX
* buffers free in the ring, we assume all have been sent.
*/
if (mcp251xfd_tx_fifo_sta_empty(fifo_sta) &&
mcp251xfd_get_tx_free(tx_ring) == 0) {
*len_p = tx_ring->obj_num;
return 0;
}
Expand Down
27 changes: 16 additions & 11 deletions drivers/net/ethernet/arc/emac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ static void arc_emac_tx_clean(struct net_device *ndev)
{
struct arc_emac_priv *priv = netdev_priv(ndev);
struct net_device_stats *stats = &ndev->stats;
struct device *dev = ndev->dev.parent;
unsigned int i;

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

dma_unmap_single(&ndev->dev, dma_unmap_addr(tx_buff, addr),
dma_unmap_single(dev, dma_unmap_addr(tx_buff, addr),
dma_unmap_len(tx_buff, len), DMA_TO_DEVICE);

/* return the sk_buff to system */
Expand Down Expand Up @@ -174,6 +175,7 @@ static void arc_emac_tx_clean(struct net_device *ndev)
static int arc_emac_rx(struct net_device *ndev, int budget)
{
struct arc_emac_priv *priv = netdev_priv(ndev);
struct device *dev = ndev->dev.parent;
unsigned int work_done;

for (work_done = 0; work_done < budget; work_done++) {
Expand Down Expand Up @@ -223,9 +225,9 @@ static int arc_emac_rx(struct net_device *ndev, int budget)
continue;
}

addr = dma_map_single(&ndev->dev, (void *)skb->data,
addr = dma_map_single(dev, (void *)skb->data,
EMAC_BUFFER_SIZE, DMA_FROM_DEVICE);
if (dma_mapping_error(&ndev->dev, addr)) {
if (dma_mapping_error(dev, addr)) {
if (net_ratelimit())
netdev_err(ndev, "cannot map dma buffer\n");
dev_kfree_skb(skb);
Expand All @@ -237,7 +239,7 @@ static int arc_emac_rx(struct net_device *ndev, int budget)
}

/* unmap previosly mapped skb */
dma_unmap_single(&ndev->dev, dma_unmap_addr(rx_buff, addr),
dma_unmap_single(dev, dma_unmap_addr(rx_buff, addr),
dma_unmap_len(rx_buff, len), DMA_FROM_DEVICE);

pktlen = info & LEN_MASK;
Expand Down Expand Up @@ -423,6 +425,7 @@ static int arc_emac_open(struct net_device *ndev)
{
struct arc_emac_priv *priv = netdev_priv(ndev);
struct phy_device *phy_dev = ndev->phydev;
struct device *dev = ndev->dev.parent;
int i;

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

addr = dma_map_single(&ndev->dev, (void *)rx_buff->skb->data,
addr = dma_map_single(dev, (void *)rx_buff->skb->data,
EMAC_BUFFER_SIZE, DMA_FROM_DEVICE);
if (dma_mapping_error(&ndev->dev, addr)) {
if (dma_mapping_error(dev, addr)) {
netdev_err(ndev, "cannot dma map\n");
dev_kfree_skb(rx_buff->skb);
return -ENOMEM;
Expand Down Expand Up @@ -548,14 +551,15 @@ static void arc_emac_set_rx_mode(struct net_device *ndev)
static void arc_free_tx_queue(struct net_device *ndev)
{
struct arc_emac_priv *priv = netdev_priv(ndev);
struct device *dev = ndev->dev.parent;
unsigned int i;

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

if (tx_buff->skb) {
dma_unmap_single(&ndev->dev,
dma_unmap_single(dev,
dma_unmap_addr(tx_buff, addr),
dma_unmap_len(tx_buff, len),
DMA_TO_DEVICE);
Expand All @@ -579,14 +583,15 @@ static void arc_free_tx_queue(struct net_device *ndev)
static void arc_free_rx_queue(struct net_device *ndev)
{
struct arc_emac_priv *priv = netdev_priv(ndev);
struct device *dev = ndev->dev.parent;
unsigned int i;

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

if (rx_buff->skb) {
dma_unmap_single(&ndev->dev,
dma_unmap_single(dev,
dma_unmap_addr(rx_buff, addr),
dma_unmap_len(rx_buff, len),
DMA_FROM_DEVICE);
Expand Down Expand Up @@ -679,6 +684,7 @@ static netdev_tx_t arc_emac_tx(struct sk_buff *skb, struct net_device *ndev)
unsigned int len, *txbd_curr = &priv->txbd_curr;
struct net_device_stats *stats = &ndev->stats;
__le32 *info = &priv->txbd[*txbd_curr].info;
struct device *dev = ndev->dev.parent;
dma_addr_t addr;

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

addr = dma_map_single(&ndev->dev, (void *)skb->data, len,
DMA_TO_DEVICE);
addr = dma_map_single(dev, (void *)skb->data, len, DMA_TO_DEVICE);

if (unlikely(dma_mapping_error(&ndev->dev, addr))) {
if (unlikely(dma_mapping_error(dev, addr))) {
stats->tx_dropped++;
stats->tx_errors++;
dev_kfree_skb_any(skb);
Expand Down
9 changes: 8 additions & 1 deletion drivers/net/ethernet/arc/emac_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv)
struct arc_emac_mdio_bus_data *data = &priv->bus_data;
struct device_node *np = priv->dev->of_node;
const char *name = "Synopsys MII Bus";
struct device_node *mdio_node;
struct mii_bus *bus;
int error;

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

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

error = of_mdiobus_register(bus, priv->dev->of_node);
/* Backwards compatibility for EMAC nodes without MDIO subnode. */
mdio_node = of_get_child_by_name(np, "mdio");
if (!mdio_node)
mdio_node = of_node_get(np);

error = of_mdiobus_register(bus, mdio_node);
of_node_put(mdio_node);
if (error) {
mdiobus_free(bus);
return dev_err_probe(priv->dev, error,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ DECLARE_EVENT_CLASS(dpaa_eth_fd,
__entry->fd_format = qm_fd_get_format(fd);
__entry->fd_offset = qm_fd_get_offset(fd);
__entry->fd_length = qm_fd_get_length(fd);
__entry->fd_status = fd->status;
__entry->fd_status = __be32_to_cpu(fd->status);
__assign_str(name);
),

Expand Down
18 changes: 9 additions & 9 deletions drivers/net/ethernet/freescale/enetc/enetc_pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,19 +665,11 @@ static int enetc_sriov_configure(struct pci_dev *pdev, int num_vfs)

if (!num_vfs) {
enetc_msg_psi_free(pf);
kfree(pf->vf_state);
pf->num_vfs = 0;
pci_disable_sriov(pdev);
} else {
pf->num_vfs = num_vfs;

pf->vf_state = kcalloc(num_vfs, sizeof(struct enetc_vf_state),
GFP_KERNEL);
if (!pf->vf_state) {
pf->num_vfs = 0;
return -ENOMEM;
}

err = enetc_msg_psi_init(pf);
if (err) {
dev_err(&pdev->dev, "enetc_msg_psi_init (%d)\n", err);
Expand All @@ -696,7 +688,6 @@ static int enetc_sriov_configure(struct pci_dev *pdev, int num_vfs)
err_en_sriov:
enetc_msg_psi_free(pf);
err_msg_psi:
kfree(pf->vf_state);
pf->num_vfs = 0;

return err;
Expand Down Expand Up @@ -1286,6 +1277,12 @@ static int enetc_pf_probe(struct pci_dev *pdev,
pf = enetc_si_priv(si);
pf->si = si;
pf->total_vfs = pci_sriov_get_totalvfs(pdev);
if (pf->total_vfs) {
pf->vf_state = kcalloc(pf->total_vfs, sizeof(struct enetc_vf_state),
GFP_KERNEL);
if (!pf->vf_state)
goto err_alloc_vf_state;
}

err = enetc_setup_mac_addresses(node, pf);
if (err)
Expand Down Expand Up @@ -1363,6 +1360,8 @@ static int enetc_pf_probe(struct pci_dev *pdev,
free_netdev(ndev);
err_alloc_netdev:
err_setup_mac_addresses:
kfree(pf->vf_state);
err_alloc_vf_state:
enetc_psi_destroy(pdev);
err_psi_create:
return err;
Expand All @@ -1389,6 +1388,7 @@ static void enetc_pf_remove(struct pci_dev *pdev)
enetc_free_si_resources(priv);

free_netdev(si->ndev);
kfree(pf->vf_state);

enetc_psi_destroy(pdev);
}
Expand Down
Loading

0 comments on commit bfc64d9

Please sign in to comment.