linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/7] net: dsa: mv88e6xxx: add 88E6361 support
@ 2023-05-24 13:01 Alexis Lothoré
  2023-05-24 13:01 ` [PATCH net-next v3 1/7] dt-bindings: net: dsa: marvell: add MV88E6361 switch to compatibility list Alexis Lothoré
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Alexis Lothoré @ 2023-05-24 13:01 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Russell King
  Cc: linux-kernel, netdev, devicetree, Thomas Petazzoni, paul.arola,
	scott.roberts, Marek Behún, Alexis Lothoré

This series brings initial support for Marvell 88E6361 switch.

MV88E6361 is a 8 ports switch with 5 integrated Gigabit PHYs and 3
2.5Gigabit SerDes interfaces. It is in fact a new variant in the
88E639X/88E6193X/88E6191X family with a subset of existing features:
- port 0: MII, RMII, RGMII, 1000BaseX, 2500BaseX
- port 3 to 7: triple speed internal phys
- port 9 and 10: 1000BaseX, 25000BaseX

Since said family is already well supported in mv88e6xxx driver, adding
initial support for this new switch mostly consists in finding the ID
exposed in its identification register, adding a proper description
in switch description tables in mv88e6xxx driver, and enforcing 88E6361
specificities in mv88e6393x_XXX methods.

- first 4 commits introduce an internal phy offset field for switches which
  have internal phys but not starting from port 0
- 5th commit is a fix on existing switches based on first commits
- 6th commit is a slight modification to prepare 886361 support
- last commit introduces 88E6361 support in 88E6393X family

This initial support has been tested with two samples of a custom board
with the following hardware configuration:
- a main CPU connected to MV88E6361 using port 0 as CPU port
- port 9 wired to a SFP cage
- port 10 wired to a G.Hn transceiver

The following setup was used:
PC <-ethernet-> (copper SFP) - Board 1 - (G.hn) <-phone line(RJ11)-> (G.hn) Board 2

The unit 1 has been configured to bridge SFP port and G.hn port together,
which allowed to successfully ping Board 2 from PC.

Changes since v2:
- add Reviewed-By tags for untouched patches
- remove whitespace
- reorganized some conditions to avoid weird line split

Changes since v1:
- rework mv88e6xxx_port_ppu_updates to use internal helper
- add internal phys offset field to manage switches which do not have
  internal PHYs right on first ports
- fix 88E639X/88E6193X/88E6191X internal phy layout
- enforce 88E6361 features in mv88e6393x_port_set_speed_duplex
- enforce 88E6361 features in mv88e6393x_port_max_speed_mode
- enforce 88E6361 features in mv88e6393x_phylink_get_caps
- add Reviewed-By and Acked-By on untouched patch

Alexis Lothoré (7):
  dt-bindings: net: dsa: marvell: add MV88E6361 switch to compatibility
    list
  net: dsa: mv88e6xxx: pass directly chip structure to
    mv88e6xxx_phy_is_internal
  net: dsa: mv88e6xxx: use mv88e6xxx_phy_is_internal in
    mv88e6xxx_port_ppu_updates
  net: dsa: mv88e6xxx: add field to specify internal phys layout
  net: dsa: mv88e6xxx: fix 88E6393X family internal phys layout
  net: dsa: mv88e6xxx: pass mv88e6xxx_chip structure to
    port_max_speed_mode
  net: dsa: mv88e6xxx: enable support for 88E6361 switch

 .../devicetree/bindings/net/dsa/marvell.txt   |  2 +-
 drivers/net/dsa/mv88e6xxx/chip.c              | 69 ++++++++++++++-----
 drivers/net/dsa/mv88e6xxx/chip.h              | 11 ++-
 drivers/net/dsa/mv88e6xxx/global2.c           |  5 +-
 drivers/net/dsa/mv88e6xxx/port.c              | 26 +++++--
 drivers/net/dsa/mv88e6xxx/port.h              | 13 ++--
 6 files changed, 94 insertions(+), 32 deletions(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH net-next v3 1/7] dt-bindings: net: dsa: marvell: add MV88E6361 switch to compatibility list
  2023-05-24 13:01 [PATCH net-next v3 0/7] net: dsa: mv88e6xxx: add 88E6361 support Alexis Lothoré
@ 2023-05-24 13:01 ` Alexis Lothoré
  2023-05-24 13:01 ` [PATCH net-next v3 2/7] net: dsa: mv88e6xxx: pass directly chip structure to mv88e6xxx_phy_is_internal Alexis Lothoré
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Alexis Lothoré @ 2023-05-24 13:01 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Russell King
  Cc: linux-kernel, netdev, devicetree, Thomas Petazzoni, paul.arola,
	scott.roberts, Marek Behún, Alexis Lothoré,
	Conor Dooley

Marvell MV88E6361 is an 8-port switch derived from the
88E6393X/88E9193X/88E6191X switches family. Since its functional behavior
is very close to switches from this family, it can benefit from existing
drivers for this family, so add it to the list of compatible switches

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

---
Changes since v1:
- add reviewed-by and acked-by tags

Changes since v2:
- add reviewed-by tag

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 Documentation/devicetree/bindings/net/dsa/marvell.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/dsa/marvell.txt b/Documentation/devicetree/bindings/net/dsa/marvell.txt
index 2363b412410c..33726134f5c9 100644
--- a/Documentation/devicetree/bindings/net/dsa/marvell.txt
+++ b/Documentation/devicetree/bindings/net/dsa/marvell.txt
@@ -20,7 +20,7 @@ which is at a different MDIO base address in different switch families.
 			  6171, 6172, 6175, 6176, 6185, 6240, 6320, 6321,
 			  6341, 6350, 6351, 6352
 - "marvell,mv88e6190"	: Switch has base address 0x00. Use with models:
-			  6190, 6190X, 6191, 6290, 6390, 6390X
+			  6163, 6190, 6190X, 6191, 6290, 6390, 6390X
 - "marvell,mv88e6250"	: Switch has base address 0x08 or 0x18. Use with model:
 			  6220, 6250
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next v3 2/7] net: dsa: mv88e6xxx: pass directly chip structure to mv88e6xxx_phy_is_internal
  2023-05-24 13:01 [PATCH net-next v3 0/7] net: dsa: mv88e6xxx: add 88E6361 support Alexis Lothoré
  2023-05-24 13:01 ` [PATCH net-next v3 1/7] dt-bindings: net: dsa: marvell: add MV88E6361 switch to compatibility list Alexis Lothoré
@ 2023-05-24 13:01 ` Alexis Lothoré
  2023-05-24 13:18   ` Russell King (Oracle)
  2023-05-24 13:01 ` [PATCH net-next v3 3/7] net: dsa: mv88e6xxx: use mv88e6xxx_phy_is_internal in mv88e6xxx_port_ppu_updates Alexis Lothoré
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Alexis Lothoré @ 2023-05-24 13:01 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Russell King
  Cc: linux-kernel, netdev, devicetree, Thomas Petazzoni, paul.arola,
	scott.roberts, Marek Behún, Alexis Lothoré,
	Russell King

Since this function is a simple helper, we do not need to pass a full
dsa_switch structure, we can directly pass the mv88e6xxx_chip structure.
Doing so will allow to share this function with any other function
not manipulating dsa_switch structure but needing info about number of
internal phys

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

---
Changes since v2:
- add reviewed-by tags

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 64a2f2f83735..93bcfa5c80e1 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -463,10 +463,8 @@ static int mv88e6xxx_port_setup_mac(struct mv88e6xxx_chip *chip, int port,
 	return err;
 }
 
-static int mv88e6xxx_phy_is_internal(struct dsa_switch *ds, int port)
+static int mv88e6xxx_phy_is_internal(struct mv88e6xxx_chip *chip, int port)
 {
-	struct mv88e6xxx_chip *chip = ds->priv;
-
 	return port < chip->info->num_internal_phys;
 }
 
@@ -584,7 +582,7 @@ static void mv88e6095_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
 
 	config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100;
 
-	if (mv88e6xxx_phy_is_internal(chip->ds, port)) {
+	if (mv88e6xxx_phy_is_internal(chip, port)) {
 		__set_bit(PHY_INTERFACE_MODE_MII, config->supported_interfaces);
 	} else {
 		if (cmode < ARRAY_SIZE(mv88e6185_phy_interface_modes) &&
@@ -832,7 +830,7 @@ static void mv88e6xxx_get_caps(struct dsa_switch *ds, int port,
 	chip->info->ops->phylink_get_caps(chip, port, config);
 	mv88e6xxx_reg_unlock(chip);
 
-	if (mv88e6xxx_phy_is_internal(ds, port)) {
+	if (mv88e6xxx_phy_is_internal(chip, port)) {
 		__set_bit(PHY_INTERFACE_MODE_INTERNAL,
 			  config->supported_interfaces);
 		/* Internal ports with no phy-mode need GMII for PHYLIB */
@@ -853,7 +851,7 @@ static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port,
 
 	mv88e6xxx_reg_lock(chip);
 
-	if (mode != MLO_AN_PHY || !mv88e6xxx_phy_is_internal(ds, port)) {
+	if (mode != MLO_AN_PHY || !mv88e6xxx_phy_is_internal(chip, port)) {
 		/* In inband mode, the link may come up at any time while the
 		 * link is not forced down. Force the link down while we
 		 * reconfigure the interface mode.
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next v3 3/7] net: dsa: mv88e6xxx: use mv88e6xxx_phy_is_internal in mv88e6xxx_port_ppu_updates
  2023-05-24 13:01 [PATCH net-next v3 0/7] net: dsa: mv88e6xxx: add 88E6361 support Alexis Lothoré
  2023-05-24 13:01 ` [PATCH net-next v3 1/7] dt-bindings: net: dsa: marvell: add MV88E6361 switch to compatibility list Alexis Lothoré
  2023-05-24 13:01 ` [PATCH net-next v3 2/7] net: dsa: mv88e6xxx: pass directly chip structure to mv88e6xxx_phy_is_internal Alexis Lothoré
@ 2023-05-24 13:01 ` Alexis Lothoré
  2023-05-24 13:01 ` [PATCH net-next v3 4/7] net: dsa: mv88e6xxx: add field to specify internal phys layout Alexis Lothoré
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Alexis Lothoré @ 2023-05-24 13:01 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Russell King
  Cc: linux-kernel, netdev, devicetree, Thomas Petazzoni, paul.arola,
	scott.roberts, Marek Behún, Alexis Lothoré,
	Russell King

Make sure to use existing helper to get internal PHYs count instead of
redoing it manually

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

---
Changes since v2
- add reviewed-by tags

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 93bcfa5c80e1..c812e52bb5b7 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -477,7 +477,7 @@ static int mv88e6xxx_port_ppu_updates(struct mv88e6xxx_chip *chip, int port)
 	 * report whether the port is internal.
 	 */
 	if (chip->info->family == MV88E6XXX_FAMILY_6250)
-		return port < chip->info->num_internal_phys;
+		return mv88e6xxx_phy_is_internal(chip, port);
 
 	err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_STS, &reg);
 	if (err) {
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next v3 4/7] net: dsa: mv88e6xxx: add field to specify internal phys layout
  2023-05-24 13:01 [PATCH net-next v3 0/7] net: dsa: mv88e6xxx: add 88E6361 support Alexis Lothoré
                   ` (2 preceding siblings ...)
  2023-05-24 13:01 ` [PATCH net-next v3 3/7] net: dsa: mv88e6xxx: use mv88e6xxx_phy_is_internal in mv88e6xxx_port_ppu_updates Alexis Lothoré
@ 2023-05-24 13:01 ` Alexis Lothoré
  2023-05-24 17:10   ` Andrew Lunn
  2023-05-24 13:01 ` [PATCH net-next v3 5/7] net: dsa: mv88e6xxx: fix 88E6393X family " Alexis Lothoré
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Alexis Lothoré @ 2023-05-24 13:01 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Russell King
  Cc: linux-kernel, netdev, devicetree, Thomas Petazzoni, paul.arola,
	scott.roberts, Marek Behún, Alexis Lothoré

mv88e6xxx currently assumes that switch equipped with internal phys have
those phys mapped contiguously starting from port 0 (see
mv88e6xxx_phy_is_internal). However, some switches have internal PHYs but
NOT starting from port 0. For example 88e6393X, 88E6193X and 88E6191X have
integrated PHYs available on ports 1 to 8
To properly support this offset, add a new field to allow specifying an
internal PHYs layout. If field is not set, default layout is assumed (start
at port 0)

---
Changes since v2:
- move start/end computation out of for loop
- remove whitespace

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c    | 4 +++-
 drivers/net/dsa/mv88e6xxx/chip.h    | 5 +++++
 drivers/net/dsa/mv88e6xxx/global2.c | 5 ++++-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index c812e52bb5b7..2716d17c5c49 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -465,7 +465,9 @@ static int mv88e6xxx_port_setup_mac(struct mv88e6xxx_chip *chip, int port,
 
 static int mv88e6xxx_phy_is_internal(struct mv88e6xxx_chip *chip, int port)
 {
-	return port < chip->info->num_internal_phys;
+	return port >= chip->info->internal_phys_offset &&
+		port < chip->info->num_internal_phys +
+			chip->info->internal_phys_offset;
 }
 
 static int mv88e6xxx_port_ppu_updates(struct mv88e6xxx_chip *chip, int port)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
index da6e1339f809..eca51946c100 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.h
+++ b/drivers/net/dsa/mv88e6xxx/chip.h
@@ -167,6 +167,11 @@ struct mv88e6xxx_info {
 
 	/* Supports PTP */
 	bool ptp_support;
+
+	/* Internal PHY start index. 0 means that internal PHYs range starts at
+	 * port 0, 1 means internal PHYs range starts at port 1, etc
+	 */
+	unsigned int internal_phys_offset;
 };
 
 struct mv88e6xxx_atu_entry {
diff --git a/drivers/net/dsa/mv88e6xxx/global2.c b/drivers/net/dsa/mv88e6xxx/global2.c
index 615896893076..937a01f2ba75 100644
--- a/drivers/net/dsa/mv88e6xxx/global2.c
+++ b/drivers/net/dsa/mv88e6xxx/global2.c
@@ -1196,9 +1196,12 @@ int mv88e6xxx_g2_irq_setup(struct mv88e6xxx_chip *chip)
 int mv88e6xxx_g2_irq_mdio_setup(struct mv88e6xxx_chip *chip,
 				struct mii_bus *bus)
 {
+	int phy_start = chip->info->internal_phys_offset;
+	int phy_end = chip->info->internal_phys_offset +
+		      chip->info->num_internal_phys;
 	int phy, irq;
 
-	for (phy = 0; phy < chip->info->num_internal_phys; phy++) {
+	for (phy = phy_start; phy < phy_end; phy++) {
 		irq = irq_find_mapping(chip->g2_irq.domain, phy);
 		if (irq < 0)
 			return irq;
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next v3 5/7] net: dsa: mv88e6xxx: fix 88E6393X family internal phys layout
  2023-05-24 13:01 [PATCH net-next v3 0/7] net: dsa: mv88e6xxx: add 88E6361 support Alexis Lothoré
                   ` (3 preceding siblings ...)
  2023-05-24 13:01 ` [PATCH net-next v3 4/7] net: dsa: mv88e6xxx: add field to specify internal phys layout Alexis Lothoré
@ 2023-05-24 13:01 ` Alexis Lothoré
  2023-05-24 13:01 ` [PATCH net-next v3 6/7] net: dsa: mv88e6xxx: pass mv88e6xxx_chip structure to port_max_speed_mode Alexis Lothoré
  2023-05-24 13:01 ` [PATCH net-next v3 7/7] net: dsa: mv88e6xxx: enable support for 88E6361 switch Alexis Lothoré
  6 siblings, 0 replies; 14+ messages in thread
From: Alexis Lothoré @ 2023-05-24 13:01 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Russell King
  Cc: linux-kernel, netdev, devicetree, Thomas Petazzoni, paul.arola,
	scott.roberts, Marek Behún, Alexis Lothoré

88E6393X/88E6193X/88E6191X swicthes have in fact 8 internal PHYs, but those
are not present starting at port 0: supported ports go from 1 to 8

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

---
Changes since v2:
- add reviewed-by tags

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 2716d17c5c49..f15ca17bf9e2 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -6024,7 +6024,8 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
 		.name = "Marvell 88E6191X",
 		.num_databases = 4096,
 		.num_ports = 11,	/* 10 + Z80 */
-		.num_internal_phys = 9,
+		.num_internal_phys = 8,
+		.internal_phys_offset = 1,
 		.max_vid = 8191,
 		.max_sid = 63,
 		.port_base_addr = 0x0,
@@ -6047,7 +6048,8 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
 		.name = "Marvell 88E6193X",
 		.num_databases = 4096,
 		.num_ports = 11,	/* 10 + Z80 */
-		.num_internal_phys = 9,
+		.num_internal_phys = 8,
+		.internal_phys_offset = 1,
 		.max_vid = 8191,
 		.max_sid = 63,
 		.port_base_addr = 0x0,
@@ -6366,7 +6368,8 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
 		.name = "Marvell 88E6393X",
 		.num_databases = 4096,
 		.num_ports = 11,	/* 10 + Z80 */
-		.num_internal_phys = 9,
+		.num_internal_phys = 8,
+		.internal_phys_offset = 1,
 		.max_vid = 8191,
 		.max_sid = 63,
 		.port_base_addr = 0x0,
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next v3 6/7] net: dsa: mv88e6xxx: pass mv88e6xxx_chip structure to port_max_speed_mode
  2023-05-24 13:01 [PATCH net-next v3 0/7] net: dsa: mv88e6xxx: add 88E6361 support Alexis Lothoré
                   ` (4 preceding siblings ...)
  2023-05-24 13:01 ` [PATCH net-next v3 5/7] net: dsa: mv88e6xxx: fix 88E6393X family " Alexis Lothoré
@ 2023-05-24 13:01 ` Alexis Lothoré
  2023-05-24 13:01 ` [PATCH net-next v3 7/7] net: dsa: mv88e6xxx: enable support for 88E6361 switch Alexis Lothoré
  6 siblings, 0 replies; 14+ messages in thread
From: Alexis Lothoré @ 2023-05-24 13:01 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Russell King
  Cc: linux-kernel, netdev, devicetree, Thomas Petazzoni, paul.arola,
	scott.roberts, Marek Behún, Alexis Lothoré

Some switches families have minor differences on supported link speed for
ports. Instead of redefining a new port_max_speed_mode for each different
configuration, allow to pass mv88e6xxx_chip structure to allow
differentiating those chips by known chip id

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

---
Changes since v2:
- add reviewed-by tag

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c |  2 +-
 drivers/net/dsa/mv88e6xxx/chip.h |  3 ++-
 drivers/net/dsa/mv88e6xxx/port.c | 12 ++++++++----
 drivers/net/dsa/mv88e6xxx/port.h | 12 ++++++++----
 4 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index f15ca17bf9e2..0e6267193ac1 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3311,7 +3311,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
 		caps = pl_config.mac_capabilities;
 
 		if (chip->info->ops->port_max_speed_mode)
-			mode = chip->info->ops->port_max_speed_mode(port);
+			mode = chip->info->ops->port_max_speed_mode(chip, port);
 		else
 			mode = PHY_INTERFACE_MODE_NA;
 
diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
index eca51946c100..dd7c8880e987 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.h
+++ b/drivers/net/dsa/mv88e6xxx/chip.h
@@ -518,7 +518,8 @@ struct mv88e6xxx_ops {
 				     int speed, int duplex);
 
 	/* What interface mode should be used for maximum speed? */
-	phy_interface_t (*port_max_speed_mode)(int port);
+	phy_interface_t (*port_max_speed_mode)(struct mv88e6xxx_chip *chip,
+					       int port);
 
 	int (*port_tag_remap)(struct mv88e6xxx_chip *chip, int port);
 
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
index f79cf716c541..66f1b40b4e96 100644
--- a/drivers/net/dsa/mv88e6xxx/port.c
+++ b/drivers/net/dsa/mv88e6xxx/port.c
@@ -342,7 +342,8 @@ int mv88e6341_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port,
 					       duplex);
 }
 
-phy_interface_t mv88e6341_port_max_speed_mode(int port)
+phy_interface_t mv88e6341_port_max_speed_mode(struct mv88e6xxx_chip *chip,
+					      int port)
 {
 	if (port == 5)
 		return PHY_INTERFACE_MODE_2500BASEX;
@@ -381,7 +382,8 @@ int mv88e6390_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port,
 					       duplex);
 }
 
-phy_interface_t mv88e6390_port_max_speed_mode(int port)
+phy_interface_t mv88e6390_port_max_speed_mode(struct mv88e6xxx_chip *chip,
+					      int port)
 {
 	if (port == 9 || port == 10)
 		return PHY_INTERFACE_MODE_2500BASEX;
@@ -403,7 +405,8 @@ int mv88e6390x_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port,
 					       duplex);
 }
 
-phy_interface_t mv88e6390x_port_max_speed_mode(int port)
+phy_interface_t mv88e6390x_port_max_speed_mode(struct mv88e6xxx_chip *chip,
+					       int port)
 {
 	if (port == 9 || port == 10)
 		return PHY_INTERFACE_MODE_XAUI;
@@ -500,7 +503,8 @@ int mv88e6393x_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port,
 	return 0;
 }
 
-phy_interface_t mv88e6393x_port_max_speed_mode(int port)
+phy_interface_t mv88e6393x_port_max_speed_mode(struct mv88e6xxx_chip *chip,
+					       int port)
 {
 	if (port == 0 || port == 9 || port == 10)
 		return PHY_INTERFACE_MODE_10GBASER;
diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h
index aec9d4fd20e3..3c9fc17abdd2 100644
--- a/drivers/net/dsa/mv88e6xxx/port.h
+++ b/drivers/net/dsa/mv88e6xxx/port.h
@@ -359,10 +359,14 @@ int mv88e6390x_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port,
 int mv88e6393x_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port,
 				     int speed, int duplex);
 
-phy_interface_t mv88e6341_port_max_speed_mode(int port);
-phy_interface_t mv88e6390_port_max_speed_mode(int port);
-phy_interface_t mv88e6390x_port_max_speed_mode(int port);
-phy_interface_t mv88e6393x_port_max_speed_mode(int port);
+phy_interface_t mv88e6341_port_max_speed_mode(struct mv88e6xxx_chip *chip,
+					      int port);
+phy_interface_t mv88e6390_port_max_speed_mode(struct mv88e6xxx_chip *chip,
+					      int port);
+phy_interface_t mv88e6390x_port_max_speed_mode(struct mv88e6xxx_chip *chip,
+					       int port);
+phy_interface_t mv88e6393x_port_max_speed_mode(struct mv88e6xxx_chip *chip,
+					       int port);
 
 int mv88e6xxx_port_set_state(struct mv88e6xxx_chip *chip, int port, u8 state);
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next v3 7/7] net: dsa: mv88e6xxx: enable support for 88E6361 switch
  2023-05-24 13:01 [PATCH net-next v3 0/7] net: dsa: mv88e6xxx: add 88E6361 support Alexis Lothoré
                   ` (5 preceding siblings ...)
  2023-05-24 13:01 ` [PATCH net-next v3 6/7] net: dsa: mv88e6xxx: pass mv88e6xxx_chip structure to port_max_speed_mode Alexis Lothoré
@ 2023-05-24 13:01 ` Alexis Lothoré
  2023-05-24 13:36   ` Russell King (Oracle)
  6 siblings, 1 reply; 14+ messages in thread
From: Alexis Lothoré @ 2023-05-24 13:01 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Russell King
  Cc: linux-kernel, netdev, devicetree, Thomas Petazzoni, paul.arola,
	scott.roberts, Marek Behún, Alexis Lothoré

Marvell 88E6361 is an 8-port switch derived from the
88E6393X/88E9193X/88E6191X switches family. It can benefit from the
existing mv88e6xxx driver by simply adding the proper switch description in
the driver. Main differences with other switches from this
family are:
- 8 ports exposed (instead of 11): ports 1, 2 and 8 not available
- No 5GBase-x nor SFI/USXGMII support

---
Changes since v2:
- use direct chip info comparison instead of intermediate variable to get
  better formatting

Changes since v1:
- define internal phys offset
- enforce 88e6361 features in mv88e6393x_phylink_get_caps
- enforce 88e6361 features in mv88e6393x_port_set_speed_duplex
- enforce 88e6361 features in mv88e6393x_port_max_speed_mode

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 42 ++++++++++++++++++++++++++++----
 drivers/net/dsa/mv88e6xxx/chip.h |  3 ++-
 drivers/net/dsa/mv88e6xxx/port.c | 14 ++++++++---
 drivers/net/dsa/mv88e6xxx/port.h |  1 +
 4 files changed, 51 insertions(+), 9 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 0e6267193ac1..7c77b4b634f9 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -790,6 +790,8 @@ static void mv88e6393x_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
 	unsigned long *supported = config->supported_interfaces;
 	bool is_6191x =
 		chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6191X;
+	bool is_6361 =
+		chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6361;
 
 	mv88e6xxx_translate_cmode(chip->ports[port].cmode, supported);
 
@@ -804,13 +806,17 @@ static void mv88e6393x_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
 		/* 6191X supports >1G modes only on port 10 */
 		if (!is_6191x || port == 10) {
 			__set_bit(PHY_INTERFACE_MODE_2500BASEX, supported);
-			__set_bit(PHY_INTERFACE_MODE_5GBASER, supported);
-			__set_bit(PHY_INTERFACE_MODE_10GBASER, supported);
+			config->mac_capabilities |= MAC_2500FD;
+
+			/* 6361 only supports up to 2500BaseX */
+			if (!is_6361) {
+				__set_bit(PHY_INTERFACE_MODE_5GBASER, supported);
+				__set_bit(PHY_INTERFACE_MODE_10GBASER, supported);
+				config->mac_capabilities |= MAC_5000FD |
+					MAC_10000FD;
+			}
 			/* FIXME: USXGMII is not supported yet */
 			/* __set_bit(PHY_INTERFACE_MODE_USXGMII, supported); */
-
-			config->mac_capabilities |= MAC_2500FD | MAC_5000FD |
-				MAC_10000FD;
 		}
 	}
 
@@ -6311,6 +6317,32 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
 		.ptp_support = true,
 		.ops = &mv88e6352_ops,
 	},
+	[MV88E6361] = {
+		.prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6361,
+		.family = MV88E6XXX_FAMILY_6393,
+		.name = "Marvell 88E6361",
+		.num_databases = 4096,
+		.num_macs = 16384,
+		.num_ports = 11,
+		/* Ports 1, 2 and 8 are not routed */
+		.invalid_port_mask = BIT(1) | BIT(2) | BIT(8),
+		.num_internal_phys = 5,
+		.internal_phys_offset = 3,
+		.max_vid = 4095,
+		.max_sid = 63,
+		.port_base_addr = 0x0,
+		.phy_base_addr = 0x0,
+		.global1_addr = 0x1b,
+		.global2_addr = 0x1c,
+		.age_time_coeff = 3750,
+		.g1_irqs = 10,
+		.g2_irqs = 14,
+		.atu_move_port_mask = 0x1f,
+		.pvt = true,
+		.multi_chip = true,
+		.ptp_support = true,
+		.ops = &mv88e6393x_ops,
+	},
 	[MV88E6390] = {
 		.prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6390,
 		.family = MV88E6XXX_FAMILY_6390,
diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
index dd7c8880e987..79c06ba42c54 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.h
+++ b/drivers/net/dsa/mv88e6xxx/chip.h
@@ -82,6 +82,7 @@ enum mv88e6xxx_model {
 	MV88E6350,
 	MV88E6351,
 	MV88E6352,
+	MV88E6361,
 	MV88E6390,
 	MV88E6390X,
 	MV88E6393X,
@@ -100,7 +101,7 @@ enum mv88e6xxx_family {
 	MV88E6XXX_FAMILY_6351,	/* 6171 6175 6350 6351 */
 	MV88E6XXX_FAMILY_6352,	/* 6172 6176 6240 6352 */
 	MV88E6XXX_FAMILY_6390,  /* 6190 6190X 6191 6290 6390 6390X */
-	MV88E6XXX_FAMILY_6393,	/* 6191X 6193X 6393X */
+	MV88E6XXX_FAMILY_6393,	/* 6191X 6193X 6361 6393X */
 };
 
 /**
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
index 66f1b40b4e96..e9b4a6ea4d09 100644
--- a/drivers/net/dsa/mv88e6xxx/port.c
+++ b/drivers/net/dsa/mv88e6xxx/port.c
@@ -424,6 +424,10 @@ int mv88e6393x_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port,
 	u16 reg, ctrl;
 	int err;
 
+	if (chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6361 &&
+	    speed > 2500)
+		return -EOPNOTSUPP;
+
 	if (speed == 200 && port != 0)
 		return -EOPNOTSUPP;
 
@@ -506,10 +510,14 @@ int mv88e6393x_port_set_speed_duplex(struct mv88e6xxx_chip *chip, int port,
 phy_interface_t mv88e6393x_port_max_speed_mode(struct mv88e6xxx_chip *chip,
 					       int port)
 {
-	if (port == 0 || port == 9 || port == 10)
-		return PHY_INTERFACE_MODE_10GBASER;
 
-	return PHY_INTERFACE_MODE_NA;
+	if (port != 0 && port != 9 && port != 10)
+		return PHY_INTERFACE_MODE_NA;
+
+	if (chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6361)
+		return PHY_INTERFACE_MODE_2500BASEX;
+
+	return PHY_INTERFACE_MODE_10GBASER;
 }
 
 static int mv88e6xxx_port_set_cmode(struct mv88e6xxx_chip *chip, int port,
diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h
index 3c9fc17abdd2..56dfa9d3d4e0 100644
--- a/drivers/net/dsa/mv88e6xxx/port.h
+++ b/drivers/net/dsa/mv88e6xxx/port.h
@@ -138,6 +138,7 @@
 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6141	0x3400
 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6341	0x3410
 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6352	0x3520
+#define MV88E6XXX_PORT_SWITCH_ID_PROD_6361	0x2610
 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6350	0x3710
 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6351	0x3750
 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6390	0x3900
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH net-next v3 2/7] net: dsa: mv88e6xxx: pass directly chip structure to mv88e6xxx_phy_is_internal
  2023-05-24 13:01 ` [PATCH net-next v3 2/7] net: dsa: mv88e6xxx: pass directly chip structure to mv88e6xxx_phy_is_internal Alexis Lothoré
@ 2023-05-24 13:18   ` Russell King (Oracle)
  2023-05-24 14:46     ` Alexis Lothoré
  0 siblings, 1 reply; 14+ messages in thread
From: Russell King (Oracle) @ 2023-05-24 13:18 UTC (permalink / raw)
  To: Alexis Lothoré
  Cc: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-kernel,
	netdev, devicetree, Thomas Petazzoni, paul.arola, scott.roberts,
	Marek Behún

On Wed, May 24, 2023 at 03:01:22PM +0200, Alexis Lothoré wrote:
> Since this function is a simple helper, we do not need to pass a full
> dsa_switch structure, we can directly pass the mv88e6xxx_chip structure.
> Doing so will allow to share this function with any other function
> not manipulating dsa_switch structure but needing info about number of
> internal phys
> 
> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> ---
> Changes since v2:
> - add reviewed-by tags
> 
> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
> ---

It never ceases to amaze me the way human beings can find creative ways
to mess things up, no matter how well things are documented. The above
commit message (and the others that I've looked at) are all broken
because of this creativity.

In effect, because of the really weird format you've come up with here,
your patches are in effect *not* signed off by you.

The patch format is in Documentation/process/submitting-patches.rst
under the section marked "The canonical patch format". Please review.

Please wait a while (a few days) to see if anyone responds to _this_
posting with any other comments. Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net-next v3 7/7] net: dsa: mv88e6xxx: enable support for 88E6361 switch
  2023-05-24 13:01 ` [PATCH net-next v3 7/7] net: dsa: mv88e6xxx: enable support for 88E6361 switch Alexis Lothoré
@ 2023-05-24 13:36   ` Russell King (Oracle)
  0 siblings, 0 replies; 14+ messages in thread
From: Russell King (Oracle) @ 2023-05-24 13:36 UTC (permalink / raw)
  To: Alexis Lothoré
  Cc: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-kernel,
	netdev, devicetree, Thomas Petazzoni, paul.arola, scott.roberts,
	Marek Behún

On Wed, May 24, 2023 at 03:01:27PM +0200, Alexis Lothoré wrote:
> diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h
> index 3c9fc17abdd2..56dfa9d3d4e0 100644
> --- a/drivers/net/dsa/mv88e6xxx/port.h
> +++ b/drivers/net/dsa/mv88e6xxx/port.h
> @@ -138,6 +138,7 @@
>  #define MV88E6XXX_PORT_SWITCH_ID_PROD_6141	0x3400
>  #define MV88E6XXX_PORT_SWITCH_ID_PROD_6341	0x3410
>  #define MV88E6XXX_PORT_SWITCH_ID_PROD_6352	0x3520
> +#define MV88E6XXX_PORT_SWITCH_ID_PROD_6361	0x2610
>  #define MV88E6XXX_PORT_SWITCH_ID_PROD_6350	0x3710
>  #define MV88E6XXX_PORT_SWITCH_ID_PROD_6351	0x3750
>  #define MV88E6XXX_PORT_SWITCH_ID_PROD_6390	0x3900

This list is ordered by the value in the register. The value you are
adding is 0x2610, which is not ordered between 0x3520 and 0x3710.
Please move this to be after the definition for
MV88E6XXX_PORT_SWITCH_ID_PROD_6250. Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net-next v3 2/7] net: dsa: mv88e6xxx: pass directly chip structure to mv88e6xxx_phy_is_internal
  2023-05-24 13:18   ` Russell King (Oracle)
@ 2023-05-24 14:46     ` Alexis Lothoré
  2023-05-24 17:08       ` Andrew Lunn
  0 siblings, 1 reply; 14+ messages in thread
From: Alexis Lothoré @ 2023-05-24 14:46 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Richard Cochran,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-kernel,
	netdev, devicetree, Thomas Petazzoni, paul.arola, scott.roberts,
	Marek Behún

Hello Russell,

On 5/24/23 15:18, Russell King (Oracle) wrote:
> On Wed, May 24, 2023 at 03:01:22PM +0200, Alexis Lothoré wrote:
>> Since this function is a simple helper, we do not need to pass a full
>> dsa_switch structure, we can directly pass the mv88e6xxx_chip structure.
>> Doing so will allow to share this function with any other function
>> not manipulating dsa_switch structure but needing info about number of
>> internal phys
>>
>> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
>> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
>>
>> ---
>> Changes since v2:
>> - add reviewed-by tags
>>
>> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
>> ---
> 
> It never ceases to amaze me the way human beings can find creative ways
> to mess things up, no matter how well things are documented. The above
> commit message (and the others that I've looked at) are all broken
> because of this creativity.
> 
> In effect, because of the really weird format you've come up with here,
> your patches are in effect *not* signed off by you.

Sorry for that. This was an attempt to provide relevant changelog for each
patch, but obviously the way I stored those changelogs was wrong, and I did not
catch the consequent broken Signed-off-by lines after re-generating the series.
I'll do as suggested and hold off a bit before fixing/re-sending.

Kind regards,
> 
> The patch format is in Documentation/process/submitting-patches.rst
> under the section marked "The canonical patch format". Please review.
> 
> Please wait a while (a few days) to see if anyone responds to _this_
> posting with any other comments. Thanks.
> 

-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net-next v3 2/7] net: dsa: mv88e6xxx: pass directly chip structure to mv88e6xxx_phy_is_internal
  2023-05-24 14:46     ` Alexis Lothoré
@ 2023-05-24 17:08       ` Andrew Lunn
  2023-05-25  9:08         ` Alexis Lothoré
  0 siblings, 1 reply; 14+ messages in thread
From: Andrew Lunn @ 2023-05-24 17:08 UTC (permalink / raw)
  To: Alexis Lothoré
  Cc: Russell King (Oracle),
	Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-kernel, netdev,
	devicetree, Thomas Petazzoni, paul.arola, scott.roberts,
	Marek Behún

On Wed, May 24, 2023 at 04:46:35PM +0200, Alexis Lothoré wrote:
> Hello Russell,
> 
> On 5/24/23 15:18, Russell King (Oracle) wrote:
> > On Wed, May 24, 2023 at 03:01:22PM +0200, Alexis Lothoré wrote:
> >> Since this function is a simple helper, we do not need to pass a full
> >> dsa_switch structure, we can directly pass the mv88e6xxx_chip structure.
> >> Doing so will allow to share this function with any other function
> >> not manipulating dsa_switch structure but needing info about number of
> >> internal phys
> >>
> >> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> >> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> >>
> >> ---
> >> Changes since v2:
> >> - add reviewed-by tags
> >>
> >> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
> >> ---
> > 
> > It never ceases to amaze me the way human beings can find creative ways
> > to mess things up, no matter how well things are documented. The above
> > commit message (and the others that I've looked at) are all broken
> > because of this creativity.
> > 
> > In effect, because of the really weird format you've come up with here,
> > your patches are in effect *not* signed off by you.
> 
> Sorry for that. This was an attempt to provide relevant changelog for each
> patch, but obviously the way I stored those changelogs was wrong, and I did not
> catch the consequent broken Signed-off-by lines after re-generating the series.
> I'll do as suggested and hold off a bit before fixing/re-sending.

You can put the changelog in the commit message in git commit, you
just need to add the correct --- separate after the tags. The patch
created with git format-patch will then have two ---, but that is not
a problem.

    Andrew

---
pw-bot: cr

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net-next v3 4/7] net: dsa: mv88e6xxx: add field to specify internal phys layout
  2023-05-24 13:01 ` [PATCH net-next v3 4/7] net: dsa: mv88e6xxx: add field to specify internal phys layout Alexis Lothoré
@ 2023-05-24 17:10   ` Andrew Lunn
  0 siblings, 0 replies; 14+ messages in thread
From: Andrew Lunn @ 2023-05-24 17:10 UTC (permalink / raw)
  To: Alexis Lothoré
  Cc: Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Russell King, linux-kernel,
	netdev, devicetree, Thomas Petazzoni, paul.arola, scott.roberts,
	Marek Behún

On Wed, May 24, 2023 at 03:01:24PM +0200, Alexis Lothoré wrote:
> mv88e6xxx currently assumes that switch equipped with internal phys have
> those phys mapped contiguously starting from port 0 (see
> mv88e6xxx_phy_is_internal). However, some switches have internal PHYs but
> NOT starting from port 0. For example 88e6393X, 88E6193X and 88E6191X have
> integrated PHYs available on ports 1 to 8
> To properly support this offset, add a new field to allow specifying an
> internal PHYs layout. If field is not set, default layout is assumed (start
> at port 0)
> 
> ---
> Changes since v2:
> - move start/end computation out of for loop
> - remove whitespace
> 
> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net-next v3 2/7] net: dsa: mv88e6xxx: pass directly chip structure to mv88e6xxx_phy_is_internal
  2023-05-24 17:08       ` Andrew Lunn
@ 2023-05-25  9:08         ` Alexis Lothoré
  0 siblings, 0 replies; 14+ messages in thread
From: Alexis Lothoré @ 2023-05-25  9:08 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Russell King (Oracle),
	Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-kernel, netdev,
	devicetree, Thomas Petazzoni, paul.arola, scott.roberts,
	Marek Behún

On 5/24/23 19:08, Andrew Lunn wrote:
> On Wed, May 24, 2023 at 04:46:35PM +0200, Alexis Lothoré wrote:
>> Hello Russell,
>>
>> On 5/24/23 15:18, Russell King (Oracle) wrote:
>>> On Wed, May 24, 2023 at 03:01:22PM +0200, Alexis Lothoré wrote:
>>>> Since this function is a simple helper, we do not need to pass a full
>>>> dsa_switch structure, we can directly pass the mv88e6xxx_chip structure.
>>>> Doing so will allow to share this function with any other function
>>>> not manipulating dsa_switch structure but needing info about number of
>>>> internal phys
>>>>
>>>> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
>>>> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
>>>>
>>>> ---
>>>> Changes since v2:
>>>> - add reviewed-by tags
>>>>
>>>> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
>>>> ---
>>>
>>> It never ceases to amaze me the way human beings can find creative ways
>>> to mess things up, no matter how well things are documented. The above
>>> commit message (and the others that I've looked at) are all broken
>>> because of this creativity.
>>>
>>> In effect, because of the really weird format you've come up with here,
>>> your patches are in effect *not* signed off by you.
>>
>> Sorry for that. This was an attempt to provide relevant changelog for each
>> patch, but obviously the way I stored those changelogs was wrong, and I did not
>> catch the consequent broken Signed-off-by lines after re-generating the series.
>> I'll do as suggested and hold off a bit before fixing/re-sending.
> 
> You can put the changelog in the commit message in git commit, you
> just need to add the correct --- separate after the tags. The patch
> created with git format-patch will then have two ---, but that is not
> a problem.

Yes, that is exactly what I intended to do, but digging a bit, I guess the issue
has been that my current configuration relies on git format-patch to insert my
SoB, and it seems to not identify the marker so it inserts the SoB after it
instead of before. Looks like it was broken in the series v2 too.
Fixed my configuration to sign-off right at commit time.

Thanks

> 
>     Andrew
> 
> ---
> pw-bot: cr

-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-05-25  9:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-24 13:01 [PATCH net-next v3 0/7] net: dsa: mv88e6xxx: add 88E6361 support Alexis Lothoré
2023-05-24 13:01 ` [PATCH net-next v3 1/7] dt-bindings: net: dsa: marvell: add MV88E6361 switch to compatibility list Alexis Lothoré
2023-05-24 13:01 ` [PATCH net-next v3 2/7] net: dsa: mv88e6xxx: pass directly chip structure to mv88e6xxx_phy_is_internal Alexis Lothoré
2023-05-24 13:18   ` Russell King (Oracle)
2023-05-24 14:46     ` Alexis Lothoré
2023-05-24 17:08       ` Andrew Lunn
2023-05-25  9:08         ` Alexis Lothoré
2023-05-24 13:01 ` [PATCH net-next v3 3/7] net: dsa: mv88e6xxx: use mv88e6xxx_phy_is_internal in mv88e6xxx_port_ppu_updates Alexis Lothoré
2023-05-24 13:01 ` [PATCH net-next v3 4/7] net: dsa: mv88e6xxx: add field to specify internal phys layout Alexis Lothoré
2023-05-24 17:10   ` Andrew Lunn
2023-05-24 13:01 ` [PATCH net-next v3 5/7] net: dsa: mv88e6xxx: fix 88E6393X family " Alexis Lothoré
2023-05-24 13:01 ` [PATCH net-next v3 6/7] net: dsa: mv88e6xxx: pass mv88e6xxx_chip structure to port_max_speed_mode Alexis Lothoré
2023-05-24 13:01 ` [PATCH net-next v3 7/7] net: dsa: mv88e6xxx: enable support for 88E6361 switch Alexis Lothoré
2023-05-24 13:36   ` Russell King (Oracle)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).