[PATCH net v1 2/2] net: dsa: microchip: improve port count comments
From: Sven Van Asbroeck <hidden>
Date: 2020-12-05 18:34:16
Also in:
lkml
Subsystem:
microchip ksz series ethernet switch driver, networking drivers, networking [dsa], the rest · Maintainers:
Woojung Huh, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn, Vladimir Oltean, Linus Torvalds
From: Sven Van Asbroeck <redacted>
Port counts in microchip dsa drivers can be quite confusing:
on the ksz8795, ksz_chip_data->port_cnt excludes the cpu port,
yet on the ksz9477, it includes the cpu port.
Add comments to document this situation explicitly.
Fixes: 912aae27c6af ("net: dsa: microchip: really look for phy-mode in port nodes")
Signed-off-by: Sven Van Asbroeck <redacted>
---
Tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git # 905b2032fa42
To: Woojung Huh <woojung.huh@microchip.com>
To: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
To: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <redacted>
To: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Helmut Grohne <redacted>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
drivers/net/dsa/microchip/ksz8795.c | 12 +++++++++---
drivers/net/dsa/microchip/ksz9477.c | 16 ++++++++++++----
2 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c
index f5779e152377..99183347053f 100644
--- a/drivers/net/dsa/microchip/ksz8795.c
+++ b/drivers/net/dsa/microchip/ksz8795.c@@ -1190,7 +1190,9 @@ static const struct ksz_chip_data ksz8795_switch_chips[] = { .num_alus = 0, .num_statics = 8, .cpu_ports = 0x10, /* can be configured as cpu port */ - .port_cnt = 4, /* total physical port count */ + .port_cnt = 4, /* total physical port count, excluding + * the cpu port + */ }, { .chip_id = 0x8794,
@@ -1199,7 +1201,9 @@ static const struct ksz_chip_data ksz8795_switch_chips[] = { .num_alus = 0, .num_statics = 8, .cpu_ports = 0x10, /* can be configured as cpu port */ - .port_cnt = 3, /* total physical port count */ + .port_cnt = 3, /* total physical port count, excluding + * the cpu port + */ }, { .chip_id = 0x8765,
@@ -1208,7 +1212,9 @@ static const struct ksz_chip_data ksz8795_switch_chips[] = { .num_alus = 0, .num_statics = 8, .cpu_ports = 0x10, /* can be configured as cpu port */ - .port_cnt = 4, /* total physical port count */ + .port_cnt = 4, /* total physical port count, excluding + * the cpu port + */ }, };
diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
index 2f5506ac7d19..e56122ffd495 100644
--- a/drivers/net/dsa/microchip/ksz9477.c
+++ b/drivers/net/dsa/microchip/ksz9477.c@@ -1482,7 +1482,9 @@ static const struct ksz_chip_data ksz9477_switch_chips[] = { .num_alus = 4096, .num_statics = 16, .cpu_ports = 0x7F, /* can be configured as cpu port */ - .port_cnt = 7, /* total physical port count */ + .port_cnt = 7, /* total physical port count, including + * the cpu port + */ .phy_errata_9477 = true, }, {
@@ -1492,7 +1494,9 @@ static const struct ksz_chip_data ksz9477_switch_chips[] = { .num_alus = 4096, .num_statics = 16, .cpu_ports = 0x7F, /* can be configured as cpu port */ - .port_cnt = 7, /* total physical port count */ + .port_cnt = 7, /* total physical port count, including + * the cpu port + */ .phy_errata_9477 = true, }, {
@@ -1502,7 +1506,9 @@ static const struct ksz_chip_data ksz9477_switch_chips[] = { .num_alus = 4096, .num_statics = 16, .cpu_ports = 0x07, /* can be configured as cpu port */ - .port_cnt = 3, /* total port count */ + .port_cnt = 3, /* total physical port count, including + * the cpu port + */ }, { .chip_id = 0x00956700,
@@ -1511,7 +1517,9 @@ static const struct ksz_chip_data ksz9477_switch_chips[] = { .num_alus = 4096, .num_statics = 16, .cpu_ports = 0x7F, /* can be configured as cpu port */ - .port_cnt = 7, /* total physical port count */ + .port_cnt = 7, /* total physical port count, including + * the cpu port + */ }, };
--
2.17.1