Skip to content

Commit 2d45e6e

Browse files
committed
Merge branch 'ksz-fixes'
Oleksij Rempel says: ==================== net: dsa: microchip: ksz8: fixes for stable changes v2: - use proper Fixes tag - add Acked-by: Arun Ramadoss <[email protected]> on all reviewed patches except the ksz8863_smi patch. These fixes address issues such as incomplete FDB extraction, incorrect FID extraction and configuration, incorrect timestamp extraction, and ghost entry extraction from an empty dynamic MAC table. These updates ensure proper functioning of the FDB/MDB functionality for the ksz8863/ksz8873 series of chips. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents f336422 + 9aa5757 commit 2d45e6e

File tree

3 files changed

+11
-21
lines changed

3 files changed

+11
-21
lines changed

drivers/net/dsa/microchip/ksz8795.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -958,15 +958,14 @@ int ksz8_fdb_dump(struct ksz_device *dev, int port,
958958
u16 entries = 0;
959959
u8 timestamp = 0;
960960
u8 fid;
961-
u8 member;
962-
struct alu_struct alu;
961+
u8 src_port;
962+
u8 mac[ETH_ALEN];
963963

964964
do {
965-
alu.is_static = false;
966-
ret = ksz8_r_dyn_mac_table(dev, i, alu.mac, &fid, &member,
965+
ret = ksz8_r_dyn_mac_table(dev, i, mac, &fid, &src_port,
967966
&timestamp, &entries);
968-
if (!ret && (member & BIT(port))) {
969-
ret = cb(alu.mac, alu.fid, alu.is_static, data);
967+
if (!ret && port == src_port) {
968+
ret = cb(mac, fid, false, data);
970969
if (ret)
971970
break;
972971
}

drivers/net/dsa/microchip/ksz8863_smi.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,16 @@ static const struct regmap_bus regmap_smi[] = {
8282
{
8383
.read = ksz8863_mdio_read,
8484
.write = ksz8863_mdio_write,
85-
.max_raw_read = 1,
86-
.max_raw_write = 1,
8785
},
8886
{
8987
.read = ksz8863_mdio_read,
9088
.write = ksz8863_mdio_write,
9189
.val_format_endian_default = REGMAP_ENDIAN_BIG,
92-
.max_raw_read = 2,
93-
.max_raw_write = 2,
9490
},
9591
{
9692
.read = ksz8863_mdio_read,
9793
.write = ksz8863_mdio_write,
9894
.val_format_endian_default = REGMAP_ENDIAN_BIG,
99-
.max_raw_read = 4,
100-
.max_raw_write = 4,
10195
}
10296
};
10397

@@ -108,7 +102,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
108102
.pad_bits = 24,
109103
.val_bits = 8,
110104
.cache_type = REGCACHE_NONE,
111-
.use_single_read = 1,
112105
.lock = ksz_regmap_lock,
113106
.unlock = ksz_regmap_unlock,
114107
},
@@ -118,7 +111,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
118111
.pad_bits = 24,
119112
.val_bits = 16,
120113
.cache_type = REGCACHE_NONE,
121-
.use_single_read = 1,
122114
.lock = ksz_regmap_lock,
123115
.unlock = ksz_regmap_unlock,
124116
},
@@ -128,7 +120,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
128120
.pad_bits = 24,
129121
.val_bits = 32,
130122
.cache_type = REGCACHE_NONE,
131-
.use_single_read = 1,
132123
.lock = ksz_regmap_lock,
133124
.unlock = ksz_regmap_unlock,
134125
}

drivers/net/dsa/microchip/ksz_common.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,13 @@ static const u32 ksz8863_masks[] = {
404404
[VLAN_TABLE_VALID] = BIT(19),
405405
[STATIC_MAC_TABLE_VALID] = BIT(19),
406406
[STATIC_MAC_TABLE_USE_FID] = BIT(21),
407-
[STATIC_MAC_TABLE_FID] = GENMASK(29, 26),
407+
[STATIC_MAC_TABLE_FID] = GENMASK(25, 22),
408408
[STATIC_MAC_TABLE_OVERRIDE] = BIT(20),
409409
[STATIC_MAC_TABLE_FWD_PORTS] = GENMASK(18, 16),
410-
[DYNAMIC_MAC_TABLE_ENTRIES_H] = GENMASK(5, 0),
411-
[DYNAMIC_MAC_TABLE_MAC_EMPTY] = BIT(7),
410+
[DYNAMIC_MAC_TABLE_ENTRIES_H] = GENMASK(1, 0),
411+
[DYNAMIC_MAC_TABLE_MAC_EMPTY] = BIT(2),
412412
[DYNAMIC_MAC_TABLE_NOT_READY] = BIT(7),
413-
[DYNAMIC_MAC_TABLE_ENTRIES] = GENMASK(31, 28),
413+
[DYNAMIC_MAC_TABLE_ENTRIES] = GENMASK(31, 24),
414414
[DYNAMIC_MAC_TABLE_FID] = GENMASK(19, 16),
415415
[DYNAMIC_MAC_TABLE_SRC_PORT] = GENMASK(21, 20),
416416
[DYNAMIC_MAC_TABLE_TIMESTAMP] = GENMASK(23, 22),
@@ -420,10 +420,10 @@ static u8 ksz8863_shifts[] = {
420420
[VLAN_TABLE_MEMBERSHIP_S] = 16,
421421
[STATIC_MAC_FWD_PORTS] = 16,
422422
[STATIC_MAC_FID] = 22,
423-
[DYNAMIC_MAC_ENTRIES_H] = 3,
423+
[DYNAMIC_MAC_ENTRIES_H] = 8,
424424
[DYNAMIC_MAC_ENTRIES] = 24,
425425
[DYNAMIC_MAC_FID] = 16,
426-
[DYNAMIC_MAC_TIMESTAMP] = 24,
426+
[DYNAMIC_MAC_TIMESTAMP] = 22,
427427
[DYNAMIC_MAC_SRC_PORT] = 20,
428428
};
429429

0 commit comments

Comments
 (0)