mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Serge Semin <fancer.lancer@gmail.com>
To: Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Cc: Serge Semin <fancer.lancer@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrew Halaney <ahalaney@redhat.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net] net: stmmac: Fix false "invalid port speed" warning
Date: Fri,  9 Aug 2024 22:21:39 +0300	[thread overview]
Message-ID: <20240809192150.32756-1-fancer.lancer@gmail.com> (raw)

If the internal SGMII/TBI/RTBI PCS is available in a DW GMAC or DW QoS Eth
instance and there is no "snps,ps-speed" property specified (or the
plat_stmmacenet_data::mac_port_sel_speed field is left zero), then the
next warning will be printed to the system log:

> [  294.611899] stmmaceth 1f060000.ethernet: invalid port speed

By the original intention the "snps,ps-speed" property was supposed to be
utilized on the platforms with the MAC2MAC link setup to fix the link
speed with the specified value. But since it's possible to have a device
with the DW *MAC with the SGMII/TBI/RTBI interface attached to a PHY, then
the property is actually optional (which is also confirmed by the DW MAC
DT-bindings). Thus it's absolutely normal to have the
plat_stmmacenet_data::mac_port_sel_speed field zero initialized indicating
that there is no need in the MAC-speed fixing and the denoted warning is
false.

Fix the warning by permitting the plat_stmmacenet_data::mac_port_sel_speed
field to have the zero value in case if the internal PCS is available.

Fixes: 02e57b9d7c8c ("drivers: net: stmmac: add port selection programming")
Signed-off-by: Serge Semin <fancer.lancer@gmail.com>

---

Note this fix will get to be mainly actual after the next patch is merged
in:
https://lore.kernel.org/netdev/E1sauuS-000tvz-6E@rmk-PC.armlinux.org.uk/

Cc: Russell King (Oracle) <linux@armlinux.org.uk>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrew Halaney <ahalaney@redhat.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f3a1b179aaea..fb63df1b99c0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3422,7 +3422,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
 		if ((speed == SPEED_10) || (speed == SPEED_100) ||
 		    (speed == SPEED_1000)) {
 			priv->hw->ps = speed;
-		} else {
+		} else if (speed) {
 			dev_warn(priv->device, "invalid port speed\n");
 			priv->hw->ps = 0;
 		}
-- 
2.43.0


             reply	other threads:[~2024-08-09 19:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09 19:21 Serge Semin [this message]
2024-08-09 20:41 ` Andrew Halaney
2024-08-12 16:48   ` Serge Semin
2024-08-14  1:05     ` Andrew Halaney
2024-08-19 13:49       ` Serge Semin
2024-08-14  0:42 ` Andrew Halaney

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=20240809192150.32756-1-fancer.lancer@gmail.com \
    --to=fancer.lancer@gmail.com \
    --cc=ahalaney@redhat.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=ast@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    /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

all inboxes | Powered by JetHome®