提交 2d45e6e9 编写于 作者: D David S. Miller

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 <arun.ramadoss@microchip.com> 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: NDavid S. Miller <davem@davemloft.net>
...@@ -958,15 +958,14 @@ int ksz8_fdb_dump(struct ksz_device *dev, int port, ...@@ -958,15 +958,14 @@ int ksz8_fdb_dump(struct ksz_device *dev, int port,
u16 entries = 0; u16 entries = 0;
u8 timestamp = 0; u8 timestamp = 0;
u8 fid; u8 fid;
u8 member; u8 src_port;
struct alu_struct alu; u8 mac[ETH_ALEN];
do { do {
alu.is_static = false; ret = ksz8_r_dyn_mac_table(dev, i, mac, &fid, &src_port,
ret = ksz8_r_dyn_mac_table(dev, i, alu.mac, &fid, &member,
&timestamp, &entries); &timestamp, &entries);
if (!ret && (member & BIT(port))) { if (!ret && port == src_port) {
ret = cb(alu.mac, alu.fid, alu.is_static, data); ret = cb(mac, fid, false, data);
if (ret) if (ret)
break; break;
} }
......
...@@ -82,22 +82,16 @@ static const struct regmap_bus regmap_smi[] = { ...@@ -82,22 +82,16 @@ static const struct regmap_bus regmap_smi[] = {
{ {
.read = ksz8863_mdio_read, .read = ksz8863_mdio_read,
.write = ksz8863_mdio_write, .write = ksz8863_mdio_write,
.max_raw_read = 1,
.max_raw_write = 1,
}, },
{ {
.read = ksz8863_mdio_read, .read = ksz8863_mdio_read,
.write = ksz8863_mdio_write, .write = ksz8863_mdio_write,
.val_format_endian_default = REGMAP_ENDIAN_BIG, .val_format_endian_default = REGMAP_ENDIAN_BIG,
.max_raw_read = 2,
.max_raw_write = 2,
}, },
{ {
.read = ksz8863_mdio_read, .read = ksz8863_mdio_read,
.write = ksz8863_mdio_write, .write = ksz8863_mdio_write,
.val_format_endian_default = REGMAP_ENDIAN_BIG, .val_format_endian_default = REGMAP_ENDIAN_BIG,
.max_raw_read = 4,
.max_raw_write = 4,
} }
}; };
...@@ -108,7 +102,6 @@ static const struct regmap_config ksz8863_regmap_config[] = { ...@@ -108,7 +102,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
.pad_bits = 24, .pad_bits = 24,
.val_bits = 8, .val_bits = 8,
.cache_type = REGCACHE_NONE, .cache_type = REGCACHE_NONE,
.use_single_read = 1,
.lock = ksz_regmap_lock, .lock = ksz_regmap_lock,
.unlock = ksz_regmap_unlock, .unlock = ksz_regmap_unlock,
}, },
...@@ -118,7 +111,6 @@ static const struct regmap_config ksz8863_regmap_config[] = { ...@@ -118,7 +111,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
.pad_bits = 24, .pad_bits = 24,
.val_bits = 16, .val_bits = 16,
.cache_type = REGCACHE_NONE, .cache_type = REGCACHE_NONE,
.use_single_read = 1,
.lock = ksz_regmap_lock, .lock = ksz_regmap_lock,
.unlock = ksz_regmap_unlock, .unlock = ksz_regmap_unlock,
}, },
...@@ -128,7 +120,6 @@ static const struct regmap_config ksz8863_regmap_config[] = { ...@@ -128,7 +120,6 @@ static const struct regmap_config ksz8863_regmap_config[] = {
.pad_bits = 24, .pad_bits = 24,
.val_bits = 32, .val_bits = 32,
.cache_type = REGCACHE_NONE, .cache_type = REGCACHE_NONE,
.use_single_read = 1,
.lock = ksz_regmap_lock, .lock = ksz_regmap_lock,
.unlock = ksz_regmap_unlock, .unlock = ksz_regmap_unlock,
} }
......
...@@ -404,13 +404,13 @@ static const u32 ksz8863_masks[] = { ...@@ -404,13 +404,13 @@ static const u32 ksz8863_masks[] = {
[VLAN_TABLE_VALID] = BIT(19), [VLAN_TABLE_VALID] = BIT(19),
[STATIC_MAC_TABLE_VALID] = BIT(19), [STATIC_MAC_TABLE_VALID] = BIT(19),
[STATIC_MAC_TABLE_USE_FID] = BIT(21), [STATIC_MAC_TABLE_USE_FID] = BIT(21),
[STATIC_MAC_TABLE_FID] = GENMASK(29, 26), [STATIC_MAC_TABLE_FID] = GENMASK(25, 22),
[STATIC_MAC_TABLE_OVERRIDE] = BIT(20), [STATIC_MAC_TABLE_OVERRIDE] = BIT(20),
[STATIC_MAC_TABLE_FWD_PORTS] = GENMASK(18, 16), [STATIC_MAC_TABLE_FWD_PORTS] = GENMASK(18, 16),
[DYNAMIC_MAC_TABLE_ENTRIES_H] = GENMASK(5, 0), [DYNAMIC_MAC_TABLE_ENTRIES_H] = GENMASK(1, 0),
[DYNAMIC_MAC_TABLE_MAC_EMPTY] = BIT(7), [DYNAMIC_MAC_TABLE_MAC_EMPTY] = BIT(2),
[DYNAMIC_MAC_TABLE_NOT_READY] = BIT(7), [DYNAMIC_MAC_TABLE_NOT_READY] = BIT(7),
[DYNAMIC_MAC_TABLE_ENTRIES] = GENMASK(31, 28), [DYNAMIC_MAC_TABLE_ENTRIES] = GENMASK(31, 24),
[DYNAMIC_MAC_TABLE_FID] = GENMASK(19, 16), [DYNAMIC_MAC_TABLE_FID] = GENMASK(19, 16),
[DYNAMIC_MAC_TABLE_SRC_PORT] = GENMASK(21, 20), [DYNAMIC_MAC_TABLE_SRC_PORT] = GENMASK(21, 20),
[DYNAMIC_MAC_TABLE_TIMESTAMP] = GENMASK(23, 22), [DYNAMIC_MAC_TABLE_TIMESTAMP] = GENMASK(23, 22),
...@@ -420,10 +420,10 @@ static u8 ksz8863_shifts[] = { ...@@ -420,10 +420,10 @@ static u8 ksz8863_shifts[] = {
[VLAN_TABLE_MEMBERSHIP_S] = 16, [VLAN_TABLE_MEMBERSHIP_S] = 16,
[STATIC_MAC_FWD_PORTS] = 16, [STATIC_MAC_FWD_PORTS] = 16,
[STATIC_MAC_FID] = 22, [STATIC_MAC_FID] = 22,
[DYNAMIC_MAC_ENTRIES_H] = 3, [DYNAMIC_MAC_ENTRIES_H] = 8,
[DYNAMIC_MAC_ENTRIES] = 24, [DYNAMIC_MAC_ENTRIES] = 24,
[DYNAMIC_MAC_FID] = 16, [DYNAMIC_MAC_FID] = 16,
[DYNAMIC_MAC_TIMESTAMP] = 24, [DYNAMIC_MAC_TIMESTAMP] = 22,
[DYNAMIC_MAC_SRC_PORT] = 20, [DYNAMIC_MAC_SRC_PORT] = 20,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册