From patchwork Wed Jul 3 12:24:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13722182 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 9A4B8C2BD09 for ; Wed, 3 Jul 2024 12:27:36 +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:Date:Message-Id:Content-Type :Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=KbSHbMOBCE90JQVtnf7edu8ZUklrZJRldNFyQDvZE6E=; b=2bcTs+x/9ZOXL0/Omo1exx0QpX Y+RYpK86Ymft7tP8Qyi9p1nuRCfDNqxKV81jsqd+RGmYfDJBg85ot36BCHFjewk1cXJQtP6AQo/g4 g0334hbBPBZpIO9icaY02nS3QHlMM+M/bQF28ZbG/KpBsJjSTYGOdJOB8EerTV1QGkx6dunKDnH6C 2W5m/XZGLCClat7DmL2eUAs2gTekCSMCQ7KFJ3bteGep5dL6ZCy926I8tfHR8GsZlTUt0j5qjDH2k SjfasFq3UqZXYbgbWIlwsJpE8cngWp5BqdIJ4RnDrEy6gjCvuu9JtdknLJZy6aFsp8VrhdY79pFZf mJg/x40g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOz4z-0000000A9cp-3ei3; Wed, 03 Jul 2024 12:27:21 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOz4m-0000000A9PW-3TD4 for linux-arm-kernel@lists.infradead.org; Wed, 03 Jul 2024 12:27:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KbSHbMOBCE90JQVtnf7edu8ZUklrZJRldNFyQDvZE6E=; b=eaea149Edup5ie9i6V5fifOFtX vGGwzR3rvs3QyTZQhoYKwqIt+Vj2e3Dz80G7D3DwJ4YCL/ZVx4wJ2fLQ4uvYMwRNAmzclHLugSs+X HyzGlOelmFHCTmKlLSqx8LVs8DqQxz3j5TU9CtkkmtSnRWbypyjWZn9tN+AJUOHbNawQuIYvrkQVx DQG97K1tVqPYYuOihAF+yHU28JFACYQyvewqCunNGCnuhNk2UW/rO3YSyFngXwZQNsjIs2HSGi9Ly DvFTcnJPmCAqwecTLzB2RD5rZF6JdR1m045MUtUS3lhnCL6zsjwqi/ATcBs7kvxq6G3Es5DQyo8WG vBki/qJQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:37350 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sOz2K-0005Yo-17; Wed, 03 Jul 2024 13:24:36 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sOz2O-00Gm9W-B7; Wed, 03 Jul 2024 13:24:40 +0100 From: "Russell King (Oracle)" To: Serge Semin , Cc: Andrew Lunn , Heiner Kallweit , Andrew Halaney , "Abhishek Chauhan (ABC)" , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net] net: stmmac: dwmac4: fix PCS duplex mode decode MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Wed, 03 Jul 2024 13:24:40 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240703_052709_189500_567B3882 X-CRM114-Status: GOOD ( 11.09 ) 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 dwmac4 was decoding the duplex mode from the GMAC_PHYIF_CONTROL_STATUS register incorrectly, using GMAC_PHYIF_CTRLSTATUS_LNKMOD_MASK (value 1) rather than GMAC_PHYIF_CTRLSTATUS_LNKMOD (bit 16). Fix this. Thanks to Abhishek Chauhan for providing a response on this issue. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Halaney Reviewed-by: Andrew Lunn Reviewed-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index b25774d69195..26d837554a2d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -791,7 +791,7 @@ static void dwmac4_phystatus(void __iomem *ioaddr, struct stmmac_extra_stats *x) else x->pcs_speed = SPEED_10; - x->pcs_duplex = (status & GMAC_PHYIF_CTRLSTATUS_LNKMOD_MASK); + x->pcs_duplex = (status & GMAC_PHYIF_CTRLSTATUS_LNKMOD); pr_info("Link is Up - %d/%s\n", (int)x->pcs_speed, x->pcs_duplex ? "Full" : "Half");