From patchwork Sun Aug 11 20:07:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 13759838 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95E1612B73 for ; Sun, 11 Aug 2024 20:08:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723406885; cv=none; b=H8+q/cm1MMkBEYfJ+/mQwtN0Vph/6Nl+pZhsZNR8tNiB4av070QYFxPh6J2XySTOtpzzY/WD0Nsl5twzNowSRXpAIJOE06nqcWgFeHmybmdCJPlvJDDD6WWJgik8idmIyHRK+rmxBPkM2U4NR0cAX7CJD4aBaNN9gLVttH1t+os= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723406885; c=relaxed/simple; bh=X+wxbmlcEYoYLq8NEZnHHflD/dotEvBESvWdZI/P2wg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=MP9/W2bYsFFbcsF5v/eiGev9KtDLrkk2AyqB2KIsJM/JyaEJZKwZQVNpaIMqgd1Z/mUcik6f36S2B4AdXgjsBytM6ouCV5jAGQLdHJphoqn0GDgPnWrsgC/Ck1oSRTdQKayimQ8kye9NCnpx2GlOqoH5DbSHhbo9xsjIRzlw2aA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tJI6Jz7q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tJI6Jz7q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D8A7C32786; Sun, 11 Aug 2024 20:08:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723406885; bh=X+wxbmlcEYoYLq8NEZnHHflD/dotEvBESvWdZI/P2wg=; h=From:To:Cc:Subject:Date:From; b=tJI6Jz7qvxz/N6Yev66E7GACqLvvV78Ixw+kNYXRw/GlzXUuwEwo/Jj0brqPlEIHm 0FFIFY8vt+GtFfWX7T9Gz8O1AA1P8NRVYhY01XBG0ntP2F3Q6606mkz3w7w1nd5uCh /KA7xMaevlesqo5H2Wr/h2lQynIAPADN156gU73mjmtmQY9e1YlYg2ApSkkKHUQyHz QEnmgHv3Q04Dr26F2uhs7oXgeHp8QiLRRPLKQeMIq1bSa1bHqdA0uuouAA9+ZcP9+q mbglOJYpbaDDZTazxWPFhjMyaFM1TrAvJJHdd2nhhQDq4g7QdFTJVyaBri8wU5phXW +1a2XwciOWFJQ== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Russell King Cc: netdev@vger.kernel.org, =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH RESEND net] net: dsa: mv88e6xxx: Drop serdes methods for 88E6172 Date: Sun, 11 Aug 2024 22:07:59 +0200 Message-ID: <20240811200759.4830-1-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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 Reviewed-by: Andrew Lunn --- 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 = {