From patchwork Fri Aug 9 19:21:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13759181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4816CC3DA4A for ; Fri, 9 Aug 2024 19:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=3zQR5I5Z9YI9eBNAvBlhP8v0AMty41l/RawM3riRFrM=; b=cw5+TXBhhpr9XjlEqCjFX1HLYk YhwmK3S6aqnt+VZCwZQC5Je3FpDGPtyYyNoWHphY3gdXF/8JODTRsAaQCyAP5a5+8od5qp9GXgA98 nmxiyJYtBP38APxPHjVzC10Q5GyGnUg2MtNNjO4auinq9D97ErCFzJHxI6HqPUe02t9lqO9dKPDXF XzLA+7huGGiNDJxP5a4EdFJ6XjmMHGjY+GMpanPYc72oMQ0Yg4l5NtnLvuXXhr+JeD3JSChHWr08p DHVdzExEtPqP8TPjOdz77IO/naxYGUjXIJm5a21DvmgjZ8ZSVDWSVUl7t9CemultZ0jMa40+sB25f t2lp0UkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scVC7-0000000CLbX-05JQ; Fri, 09 Aug 2024 19:22:35 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scVBU-0000000CLVq-3hyD for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 19:21:58 +0000 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2ef1c12ae23so24270351fa.0 for ; Fri, 09 Aug 2024 12:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723231315; x=1723836115; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3zQR5I5Z9YI9eBNAvBlhP8v0AMty41l/RawM3riRFrM=; b=dmlG506D9gN3fOid1xTzkYZtZBEHwnl6Ian0Xyiepxkd2+sxMeVYFz51jjQOhJ0Sqg AkNpy75yy5McACNKmvpJs8qWsgbG9GaewP9Wn7GSAIHHh1GdDI0Wcvy2WLYFBd/serFp MrU4hTn3gepGPt9TmuYcWW77vTU9sohZOYBQGsqXbo+WWmb7KDNgMtmyEn1zozUGxoZq 1bJWQmDfND8EODgIpaLzNi8F1q9gfW6zWgAlPlcY51M8lxgzXoR7Ci95cU+TZaRVSrNy 09BuEVQNM37TQkma6PiHQNEIsOm8x/UoAhdZNdCxhv1EJEn5V6JBsKvk/Zo8S1MkZoz7 XU1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723231315; x=1723836115; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3zQR5I5Z9YI9eBNAvBlhP8v0AMty41l/RawM3riRFrM=; b=Cn4ZXHG59Y+ZCmrb2Cx2arm1Mg5sltYu7Zmt5BiJx7si19Zw3C9Y9yUz1qW+OXvlQ8 CBXcGAciC6XV/JouiA7NN56LAQ97D4fchOliKBkorSWXJ+sgxE9tZ1jAHQTca+W5VO/y veAne7C6X6P7131L8ebE8bI7MIOmrle111MfQGvvYu9sE7TK2u1V0rNR432R3E8CXCzg GlUZo0SOwEdrIgp5uGVWR7Kcgf9wKKeqTJl4B0qD/Kb7rMGH+1ZS7HN5rxKQTsblNHic Xj8D3VD5hQNkcPGvxLBbf11hL7kAOUHe1j00qs3TV1qK3OBVCgg3RC6/jBne8J7tZUeF DfhQ== X-Forwarded-Encrypted: i=1; AJvYcCW415yyD/0QTJNjr0Dc8DRmyt83YwwrxsRF7jjOw/AI1Ov0St1iF8lQOm3nkwZwz2c9x6IGm5TsB/GG0KLGS9FCY4dFIO7yiujSAnhFDjWKmq+zHCA= X-Gm-Message-State: AOJu0YwL+IDtifrAgrONV8HlkKYAbol8mt5d+KMH/nuSo59PGnD/ujdu Tt7osoTafIaRgQdaEQY6aQxEC00mzsvnyG/RfuP98lrbw45d7vdj X-Google-Smtp-Source: AGHT+IFZsdAmeqUUT6dg+xSHUP03KteOOKTe2JhiKfH0J1W1ciDN8u2ABk4LKTPDoact9/vXoMGhSg== X-Received: by 2002:a2e:9dc5:0:b0:2ef:21e5:1f01 with SMTP id 38308e7fff4ca-2f1a6d1da0dmr19326411fa.20.1723231314255; Fri, 09 Aug 2024 12:21:54 -0700 (PDT) Received: from localhost ([109.197.207.99]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f291ddbbb0sm435501fa.8.2024.08.09.12.21.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Aug 2024 12:21:53 -0700 (PDT) From: Serge Semin To: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Giuseppe CAVALLARO Cc: Serge Semin , Russell King , Alexei Starovoitov , Andrew Halaney , 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 Message-ID: <20240809192150.32756-1-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240809_122156_947390_582BCF59 X-CRM114-Status: GOOD ( 19.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Andrew Halaney --- 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) Cc: Alexei Starovoitov Cc: Andrew Halaney --- 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; }