Skip to content

Commit c2c2ccf

Browse files
committed
Merge tag 'net-6.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: Including fixes from bluetooth and wireless. Current release - new code bugs: - ptp: expose raw cycles only for clocks with free-running counter - bonding: fix null-deref in actor_port_prio setting - mdio: ERR_PTR-check regmap pointer returned by device_node_to_regmap() - eth: libie: depend on DEBUG_FS when building LIBIE_FWLOG Previous releases - regressions: - virtio_net: fix perf regression due to bad alignment of virtio_net_hdr_v1_hash - Revert "wifi: ath10k: avoid unnecessary wait for service ready message" caused regressions for QCA988x and QCA9984 - Revert "wifi: ath12k: Fix missing station power save configuration" caused regressions for WCN7850 - eth: bnxt_en: shutdown FW DMA in bnxt_shutdown(), fix memory corruptions after kexec Previous releases - always broken: - virtio-net: fix received packet length check for big packets - sctp: fix races in socket diag handling - wifi: add an hrtimer-based delayed work item to avoid low granularity of timers set relatively far in the future, and use it where it matters (e.g. when performing AP-scheduled channel switch) - eth: mlx5e: - correctly propagate error in case of module EEPROM read failure - fix HW-GRO on systems with PAGE_SIZE == 64kB - dsa: b53: fixes for tagging, link configuration / RMII, FDB, multicast - phy: lan8842: implement latest errata" * tag 'net-6.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (63 commits) selftests/vsock: avoid false-positives when checking dmesg net: bridge: fix MST static key usage net: bridge: fix use-after-free due to MST port state bypass lan966x: Fix sleeping in atomic context bonding: fix NULL pointer dereference in actor_port_prio setting net: dsa: microchip: Fix reserved multicast address table programming net: wan: framer: pef2256: Switch to devm_mfd_add_devices() net: libwx: fix device bus LAN ID net/mlx5e: SHAMPO, Fix header formulas for higher MTUs and 64K pages net/mlx5e: SHAMPO, Fix skb size check for 64K pages net/mlx5e: SHAMPO, Fix header mapping for 64K pages net: ti: icssg-prueth: Fix fdb hash size configuration net/mlx5e: Fix return value in case of module EEPROM read error net: gro_cells: Reduce lock scope in gro_cell_poll libie: depend on DEBUG_FS when building LIBIE_FWLOG wifi: mac80211_hwsim: Limit destroy_on_close radio removal to netgroup netpoll: Fix deadlock in memory allocation under spinlock net: ethernet: ti: netcp: Standardize knav_dma_open_channel to return NULL on error virtio-net: fix received length check in big packets bnxt_en: Fix warning in bnxt_dl_reload_down() ...
2 parents dc77806 + 3534e03 commit c2c2ccf

72 files changed

Lines changed: 876 additions & 333 deletions

File tree

Some content is hidden

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

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4818,6 +4818,7 @@ F: drivers/net/dsa/b53/*
48184818
F: drivers/net/dsa/bcm_sf2*
48194819
F: include/linux/dsa/brcm.h
48204820
F: include/linux/platform_data/b53.h
4821+
F: net/dsa/tag_brcm.c
48214822

48224823
BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE
48234824
M: Florian Fainelli <florian.fainelli@broadcom.com>

drivers/bluetooth/btrtl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,10 @@ static int rtlbt_parse_firmware_v2(struct hci_dev *hdev,
625625
len += entry->len;
626626
}
627627

628-
if (!len)
628+
if (!len) {
629+
kvfree(ptr);
629630
return -EPERM;
631+
}
630632

631633
*_buf = ptr;
632634
return len;

drivers/isdn/hardware/mISDN/hfcsusb.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,13 +1904,13 @@ setup_instance(struct hfcsusb *hw, struct device *parent)
19041904
mISDN_freebchannel(&hw->bch[1]);
19051905
mISDN_freebchannel(&hw->bch[0]);
19061906
mISDN_freedchannel(&hw->dch);
1907-
kfree(hw);
19081907
return err;
19091908
}
19101909

19111910
static int
19121911
hfcsusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
19131912
{
1913+
int err;
19141914
struct hfcsusb *hw;
19151915
struct usb_device *dev = interface_to_usbdev(intf);
19161916
struct usb_host_interface *iface = intf->cur_altsetting;
@@ -2101,20 +2101,28 @@ hfcsusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
21012101
if (!hw->ctrl_urb) {
21022102
pr_warn("%s: No memory for control urb\n",
21032103
driver_info->vend_name);
2104-
kfree(hw);
2105-
return -ENOMEM;
2104+
err = -ENOMEM;
2105+
goto err_free_hw;
21062106
}
21072107

21082108
pr_info("%s: %s: detected \"%s\" (%s, if=%d alt=%d)\n",
21092109
hw->name, __func__, driver_info->vend_name,
21102110
conf_str[small_match], ifnum, alt_used);
21112111

2112-
if (setup_instance(hw, dev->dev.parent))
2113-
return -EIO;
2112+
if (setup_instance(hw, dev->dev.parent)) {
2113+
err = -EIO;
2114+
goto err_free_urb;
2115+
}
21142116

21152117
hw->intf = intf;
21162118
usb_set_intfdata(hw->intf, hw);
21172119
return 0;
2120+
2121+
err_free_urb:
2122+
usb_free_urb(hw->ctrl_urb);
2123+
err_free_hw:
2124+
kfree(hw);
2125+
return err;
21182126
}
21192127

21202128
/* function called when an active device is removed */

drivers/net/bonding/bond_options.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,6 @@ static const struct bond_opt_value bond_ad_actor_sys_prio_tbl[] = {
225225
{ NULL, -1, 0},
226226
};
227227

228-
static const struct bond_opt_value bond_actor_port_prio_tbl[] = {
229-
{ "minval", 0, BOND_VALFLAG_MIN},
230-
{ "maxval", 65535, BOND_VALFLAG_MAX},
231-
{ "default", 255, BOND_VALFLAG_DEFAULT},
232-
{ NULL, -1, 0},
233-
};
234-
235228
static const struct bond_opt_value bond_ad_user_port_key_tbl[] = {
236229
{ "minval", 0, BOND_VALFLAG_MIN | BOND_VALFLAG_DEFAULT},
237230
{ "maxval", 1023, BOND_VALFLAG_MAX},
@@ -497,7 +490,7 @@ static const struct bond_option bond_opts[BOND_OPT_LAST] = {
497490
.id = BOND_OPT_ACTOR_PORT_PRIO,
498491
.name = "actor_port_prio",
499492
.unsuppmodes = BOND_MODE_ALL_EX(BIT(BOND_MODE_8023AD)),
500-
.values = bond_actor_port_prio_tbl,
493+
.flags = BOND_OPTFLAG_RAWVAL,
501494
.set = bond_option_actor_port_prio_set,
502495
},
503496
[BOND_OPT_AD_ACTOR_SYSTEM] = {

drivers/net/dsa/b53/b53_common.c

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,11 @@ static void b53_set_forwarding(struct b53_device *dev, int enable)
371371
* frames should be flooded or not.
372372
*/
373373
b53_read8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, &mgmt);
374-
mgmt |= B53_UC_FWD_EN | B53_MC_FWD_EN | B53_IPMC_FWD_EN;
374+
mgmt |= B53_UC_FWD_EN | B53_MC_FWD_EN | B53_IP_MC;
375375
b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt);
376376
} else {
377377
b53_read8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, &mgmt);
378-
mgmt |= B53_IP_MCAST_25;
378+
mgmt |= B53_IP_MC;
379379
b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt);
380380
}
381381
}
@@ -1372,6 +1372,10 @@ static void b53_force_port_config(struct b53_device *dev, int port,
13721372
else
13731373
reg &= ~PORT_OVERRIDE_FULL_DUPLEX;
13741374

1375+
reg &= ~(0x3 << GMII_PO_SPEED_S);
1376+
if (is5301x(dev) || is58xx(dev))
1377+
reg &= ~PORT_OVERRIDE_SPEED_2000M;
1378+
13751379
switch (speed) {
13761380
case 2000:
13771381
reg |= PORT_OVERRIDE_SPEED_2000M;
@@ -1390,6 +1394,11 @@ static void b53_force_port_config(struct b53_device *dev, int port,
13901394
return;
13911395
}
13921396

1397+
if (is5325(dev))
1398+
reg &= ~PORT_OVERRIDE_LP_FLOW_25;
1399+
else
1400+
reg &= ~(PORT_OVERRIDE_RX_FLOW | PORT_OVERRIDE_TX_FLOW);
1401+
13931402
if (rx_pause) {
13941403
if (is5325(dev))
13951404
reg |= PORT_OVERRIDE_LP_FLOW_25;
@@ -1593,8 +1602,11 @@ static void b53_phylink_mac_link_down(struct phylink_config *config,
15931602
struct b53_device *dev = dp->ds->priv;
15941603
int port = dp->index;
15951604

1596-
if (mode == MLO_AN_PHY)
1605+
if (mode == MLO_AN_PHY) {
1606+
if (is63xx(dev) && in_range(port, B53_63XX_RGMII0, 4))
1607+
b53_force_link(dev, port, false);
15971608
return;
1609+
}
15981610

15991611
if (mode == MLO_AN_FIXED) {
16001612
b53_force_link(dev, port, false);
@@ -1622,6 +1634,13 @@ static void b53_phylink_mac_link_up(struct phylink_config *config,
16221634
if (mode == MLO_AN_PHY) {
16231635
/* Re-negotiate EEE if it was enabled already */
16241636
p->eee_enabled = b53_eee_init(ds, port, phydev);
1637+
1638+
if (is63xx(dev) && in_range(port, B53_63XX_RGMII0, 4)) {
1639+
b53_force_port_config(dev, port, speed, duplex,
1640+
tx_pause, rx_pause);
1641+
b53_force_link(dev, port, true);
1642+
}
1643+
16251644
return;
16261645
}
16271646

@@ -2018,7 +2037,7 @@ static int b53_arl_search_wait(struct b53_device *dev)
20182037
do {
20192038
b53_read8(dev, B53_ARLIO_PAGE, offset, &reg);
20202039
if (!(reg & ARL_SRCH_STDN))
2021-
return 0;
2040+
return -ENOENT;
20222041

20232042
if (reg & ARL_SRCH_VLID)
20242043
return 0;
@@ -2068,13 +2087,16 @@ static int b53_fdb_copy(int port, const struct b53_arl_entry *ent,
20682087
int b53_fdb_dump(struct dsa_switch *ds, int port,
20692088
dsa_fdb_dump_cb_t *cb, void *data)
20702089
{
2090+
unsigned int count = 0, results_per_hit = 1;
20712091
struct b53_device *priv = ds->priv;
20722092
struct b53_arl_entry results[2];
2073-
unsigned int count = 0;
20742093
u8 offset;
20752094
int ret;
20762095
u8 reg;
20772096

2097+
if (priv->num_arl_bins > 2)
2098+
results_per_hit = 2;
2099+
20782100
mutex_lock(&priv->arl_mutex);
20792101

20802102
if (is5325(priv) || is5365(priv))
@@ -2096,7 +2118,7 @@ int b53_fdb_dump(struct dsa_switch *ds, int port,
20962118
if (ret)
20972119
break;
20982120

2099-
if (priv->num_arl_bins > 2) {
2121+
if (results_per_hit == 2) {
21002122
b53_arl_search_rd(priv, 1, &results[1]);
21012123
ret = b53_fdb_copy(port, &results[1], cb, data);
21022124
if (ret)
@@ -2106,7 +2128,7 @@ int b53_fdb_dump(struct dsa_switch *ds, int port,
21062128
break;
21072129
}
21082130

2109-
} while (count++ < b53_max_arl_entries(priv) / 2);
2131+
} while (count++ < b53_max_arl_entries(priv) / results_per_hit);
21102132

21112133
mutex_unlock(&priv->arl_mutex);
21122134

drivers/net/dsa/b53/b53_regs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@
111111

112112
/* IP Multicast control (8 bit) */
113113
#define B53_IP_MULTICAST_CTRL 0x21
114-
#define B53_IP_MCAST_25 BIT(0)
115-
#define B53_IPMC_FWD_EN BIT(1)
114+
#define B53_IP_MC BIT(0)
116115
#define B53_UC_FWD_EN BIT(6)
117116
#define B53_MC_FWD_EN BIT(7)
118117

drivers/net/dsa/microchip/ksz9477.c

Lines changed: 84 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,9 +1355,15 @@ void ksz9477_config_cpu_port(struct dsa_switch *ds)
13551355
}
13561356
}
13571357

1358+
#define RESV_MCAST_CNT 8
1359+
1360+
static u8 reserved_mcast_map[RESV_MCAST_CNT] = { 0, 1, 3, 16, 32, 33, 2, 17 };
1361+
13581362
int ksz9477_enable_stp_addr(struct ksz_device *dev)
13591363
{
1364+
u8 i, ports, update;
13601365
const u32 *masks;
1366+
bool override;
13611367
u32 data;
13621368
int ret;
13631369

@@ -1366,23 +1372,87 @@ int ksz9477_enable_stp_addr(struct ksz_device *dev)
13661372
/* Enable Reserved multicast table */
13671373
ksz_cfg(dev, REG_SW_LUE_CTRL_0, SW_RESV_MCAST_ENABLE, true);
13681374

1369-
/* Set the Override bit for forwarding BPDU packet to CPU */
1370-
ret = ksz_write32(dev, REG_SW_ALU_VAL_B,
1371-
ALU_V_OVERRIDE | BIT(dev->cpu_port));
1372-
if (ret < 0)
1373-
return ret;
1375+
/* The reserved multicast address table has 8 entries. Each entry has
1376+
* a default value of which port to forward. It is assumed the host
1377+
* port is the last port in most of the switches, but that is not the
1378+
* case for KSZ9477 or maybe KSZ9897. For LAN937X family the default
1379+
* port is port 5, the first RGMII port. It is okay for LAN9370, a
1380+
* 5-port switch, but may not be correct for the other 8-port
1381+
* versions. It is necessary to update the whole table to forward to
1382+
* the right ports.
1383+
* Furthermore PTP messages can use a reserved multicast address and
1384+
* the host will not receive them if this table is not correct.
1385+
*/
1386+
for (i = 0; i < RESV_MCAST_CNT; i++) {
1387+
data = reserved_mcast_map[i] <<
1388+
dev->info->shifts[ALU_STAT_INDEX];
1389+
data |= ALU_STAT_START |
1390+
masks[ALU_STAT_DIRECT] |
1391+
masks[ALU_RESV_MCAST_ADDR] |
1392+
masks[ALU_STAT_READ];
1393+
ret = ksz_write32(dev, REG_SW_ALU_STAT_CTRL__4, data);
1394+
if (ret < 0)
1395+
return ret;
13741396

1375-
data = ALU_STAT_START | ALU_RESV_MCAST_ADDR | masks[ALU_STAT_WRITE];
1397+
/* wait to be finished */
1398+
ret = ksz9477_wait_alu_sta_ready(dev);
1399+
if (ret < 0)
1400+
return ret;
13761401

1377-
ret = ksz_write32(dev, REG_SW_ALU_STAT_CTRL__4, data);
1378-
if (ret < 0)
1379-
return ret;
1402+
ret = ksz_read32(dev, REG_SW_ALU_VAL_B, &data);
1403+
if (ret < 0)
1404+
return ret;
13801405

1381-
/* wait to be finished */
1382-
ret = ksz9477_wait_alu_sta_ready(dev);
1383-
if (ret < 0) {
1384-
dev_err(dev->dev, "Failed to update Reserved Multicast table\n");
1385-
return ret;
1406+
override = false;
1407+
ports = data & dev->port_mask;
1408+
switch (i) {
1409+
case 0:
1410+
case 6:
1411+
/* Change the host port. */
1412+
update = BIT(dev->cpu_port);
1413+
override = true;
1414+
break;
1415+
case 2:
1416+
/* Change the host port. */
1417+
update = BIT(dev->cpu_port);
1418+
break;
1419+
case 4:
1420+
case 5:
1421+
case 7:
1422+
/* Skip the host port. */
1423+
update = dev->port_mask & ~BIT(dev->cpu_port);
1424+
break;
1425+
default:
1426+
update = ports;
1427+
break;
1428+
}
1429+
if (update != ports || override) {
1430+
data &= ~dev->port_mask;
1431+
data |= update;
1432+
/* Set Override bit to receive frame even when port is
1433+
* closed.
1434+
*/
1435+
if (override)
1436+
data |= ALU_V_OVERRIDE;
1437+
ret = ksz_write32(dev, REG_SW_ALU_VAL_B, data);
1438+
if (ret < 0)
1439+
return ret;
1440+
1441+
data = reserved_mcast_map[i] <<
1442+
dev->info->shifts[ALU_STAT_INDEX];
1443+
data |= ALU_STAT_START |
1444+
masks[ALU_STAT_DIRECT] |
1445+
masks[ALU_RESV_MCAST_ADDR] |
1446+
masks[ALU_STAT_WRITE];
1447+
ret = ksz_write32(dev, REG_SW_ALU_STAT_CTRL__4, data);
1448+
if (ret < 0)
1449+
return ret;
1450+
1451+
/* wait to be finished */
1452+
ret = ksz9477_wait_alu_sta_ready(dev);
1453+
if (ret < 0)
1454+
return ret;
1455+
}
13861456
}
13871457

13881458
return 0;

drivers/net/dsa/microchip/ksz9477_reg.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* Microchip KSZ9477 register definitions
44
*
5-
* Copyright (C) 2017-2024 Microchip Technology Inc.
5+
* Copyright (C) 2017-2025 Microchip Technology Inc.
66
*/
77

88
#ifndef __KSZ9477_REGS_H
@@ -397,7 +397,6 @@
397397

398398
#define ALU_RESV_MCAST_INDEX_M (BIT(6) - 1)
399399
#define ALU_STAT_START BIT(7)
400-
#define ALU_RESV_MCAST_ADDR BIT(1)
401400

402401
#define REG_SW_ALU_VAL_A 0x0420
403402

drivers/net/dsa/microchip/ksz_common.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,8 @@ static const u16 ksz9477_regs[] = {
808808
static const u32 ksz9477_masks[] = {
809809
[ALU_STAT_WRITE] = 0,
810810
[ALU_STAT_READ] = 1,
811+
[ALU_STAT_DIRECT] = 0,
812+
[ALU_RESV_MCAST_ADDR] = BIT(1),
811813
[P_MII_TX_FLOW_CTRL] = BIT(5),
812814
[P_MII_RX_FLOW_CTRL] = BIT(3),
813815
};
@@ -835,6 +837,8 @@ static const u8 ksz9477_xmii_ctrl1[] = {
835837
static const u32 lan937x_masks[] = {
836838
[ALU_STAT_WRITE] = 1,
837839
[ALU_STAT_READ] = 2,
840+
[ALU_STAT_DIRECT] = BIT(3),
841+
[ALU_RESV_MCAST_ADDR] = BIT(2),
838842
[P_MII_TX_FLOW_CTRL] = BIT(5),
839843
[P_MII_RX_FLOW_CTRL] = BIT(3),
840844
};

drivers/net/dsa/microchip/ksz_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ enum ksz_masks {
294294
DYNAMIC_MAC_TABLE_TIMESTAMP,
295295
ALU_STAT_WRITE,
296296
ALU_STAT_READ,
297+
ALU_STAT_DIRECT,
298+
ALU_RESV_MCAST_ADDR,
297299
P_MII_TX_FLOW_CTRL,
298300
P_MII_RX_FLOW_CTRL,
299301
};

0 commit comments

Comments
 (0)