netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Russell King <rmk+kernel@armlinux.org.uk>
Cc: netdev@vger.kernel.org, "Marek Behún" <kabel@kernel.org>
Subject: [PATCH RESEND net] net: dsa: mv88e6xxx: Drop serdes methods for 88E6172
Date: Sun, 11 Aug 2024 22:07:59 +0200	[thread overview]
Message-ID: <20240811200759.4830-1-kabel@kernel.org> (raw)

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(-)

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 = {
-- 
2.44.2


             reply	other threads:[~2024-08-11 20:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-11 20:07 Marek Behún [this message]
2024-08-12 14:49 ` [PATCH RESEND net] net: dsa: mv88e6xxx: Drop serdes methods for 88E6172 Russell King (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240811200759.4830-1-kabel@kernel.org \
    --to=kabel@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=rmk+kernel@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).