diff mbox series

[RESEND,net] net: dsa: mv88e6xxx: Drop serdes methods for 88E6172

Message ID 20240811200759.4830-1-kabel@kernel.org (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series [RESEND,net] net: dsa: mv88e6xxx: Drop serdes methods for 88E6172 | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 29 this patch: 29
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 3 maintainers not CCed: edumazet@google.com pabeni@redhat.com kuba@kernel.org
netdev/build_clang success Errors and warnings before: 29 this patch: 29
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 29 this patch: 29
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 39 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-11--21-00 (tests: 707)

Commit Message

Marek Behún Aug. 11, 2024, 8:07 p.m. UTC
Drop serdes methods for 88E6172. This switch from the 6352 family does
not have serdes. Until commit 85764555442f ("net: dsa: mv88e6xxx:
convert 88e6352 to phylink_pcs") these methods were checking for serdes
presence by looking at port's cmode, but in that commit the check was
dropped, so now the nonexistent serdes registers are being accessed.

Fixes: 85764555442f ("net: dsa: mv88e6xxx: convert 88e6352 to phylink_pcs")
Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
resending since I forgot to add netdev to cc
---
 drivers/net/dsa/mv88e6xxx/chip.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

Comments

Russell King (Oracle) Aug. 12, 2024, 2:49 p.m. UTC | #1
On Sun, Aug 11, 2024 at 10:07:59PM +0200, Marek Behún wrote:
> Drop serdes methods for 88E6172. This switch from the 6352 family does
> not have serdes. Until commit 85764555442f ("net: dsa: mv88e6xxx:
> convert 88e6352 to phylink_pcs") these methods were checking for serdes
> presence by looking at port's cmode, but in that commit the check was
> dropped, so now the nonexistent serdes registers are being accessed.

NAK based on commit message. See my comment on the first one for why.
  	.gpio_ops = &mv88e6352_gpio_ops,
> -	.phylink_get_caps = mv88e6352_phylink_get_caps,
> -	.pcs_ops = &mv88e6352_pcs_ops,
> +	.phylink_get_caps = mv88e6172_phylink_get_caps,
>  };
>  
>  static const struct mv88e6xxx_ops mv88e6175_ops = {
> -- 
> 2.44.2
> 
>
diff mbox series

Patch

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 5b4e2ce5470d..6e410caf9878 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -667,17 +667,25 @@  static int mv88e63xx_get_port_serdes_cmode(struct mv88e6xxx_chip *chip, int port
 	return val & MV88E6XXX_PORT_STS_CMODE_MASK;
 }
 
-static void mv88e6352_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
+static void mv88e6172_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
 				       struct phylink_config *config)
 {
 	unsigned long *supported = config->supported_interfaces;
-	int err, cmode;
 
 	/* Translate the default cmode */
 	mv88e6xxx_translate_cmode(chip->ports[port].cmode, supported);
 
 	config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100 |
 				   MAC_1000FD;
+}
+
+static void mv88e6352_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
+				       struct phylink_config *config)
+{
+	unsigned long *supported = config->supported_interfaces;
+	int err, cmode;
+
+	mv88e6172_phylink_get_caps(chip, port, config);
 
 	/* Port 4 supports automedia if the serdes is associated with it. */
 	if (port == 4) {
@@ -4618,11 +4626,8 @@  static const struct mv88e6xxx_ops mv88e6172_ops = {
 	.vtu_loadpurge = mv88e6352_g1_vtu_loadpurge,
 	.stu_getnext = mv88e6352_g1_stu_getnext,
 	.stu_loadpurge = mv88e6352_g1_stu_loadpurge,
-	.serdes_get_regs_len = mv88e6352_serdes_get_regs_len,
-	.serdes_get_regs = mv88e6352_serdes_get_regs,
 	.gpio_ops = &mv88e6352_gpio_ops,
-	.phylink_get_caps = mv88e6352_phylink_get_caps,
-	.pcs_ops = &mv88e6352_pcs_ops,
+	.phylink_get_caps = mv88e6172_phylink_get_caps,
 };
 
 static const struct mv88e6xxx_ops mv88e6175_ops = {