From patchwork Wed Apr 8 09:26:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 1998 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 94A251C00BE for ; Wed, 8 Apr 2026 11:27:50 +0200 (CEST) Authentication-Results: mxe881; dkim=fail header.d=armlinux.org.uk; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-22805-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-22805-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id A5A84300A12C for ; Wed, 8 Apr 2026 09:27:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 596F039DBF4; Wed, 8 Apr 2026 09:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="lSwyiH4l" X-Original-To: linux-sunxi@lists.linux.dev Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 090412EACF2 for ; Wed, 8 Apr 2026 09:27:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640435; cv=none; b=uBJfTlC9xS1Mc5K5kCz7kgtqX2Kesf8CElal858bMDCFrwhkZtXt+P/LSCYYMkqkB1V6Q3cH+p5qjglCDeyiT8EY3t0ptAmbOINL7EyUMMyn2t6h2mekIWuJb4SOv+P0b5mKZRwGE/D2fvtlE/KBHbR3gX9aMZAdCMYbCz7y2fs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640435; c=relaxed/simple; bh=QD1hmmO1cyoUsUck2QKM+8wErs8ZaoXgtPVgG8mgXv4=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=pJCIDQCEvzSB1kLkpEGR8cz84/b84nXOT96jDNCZsjxz6AvMgnkvwkmBEb1cUcMQPsMoCCZ2weuOYeU6eQwe4GUlFX5Ztb8dTZRhpM3qG1+STL62OYoFpSVgkEJQ2zqsbOpIxjrJtZMOKecNoyotRQbvpld/qburejuDIpxCMdE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=lSwyiH4l; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MVPIQsgXNzDIVzZb7L4g65zcVReNq7T7sAr8ZW6erb4=; b=lSwyiH4lcPtm2ZaH5eI5HlAO4j 8x582wyp8D0+XiaTrgjbVdhKPS+I/aI+ellLhqKBMuvKPmvbc3c6hM1NhY24L6yar8Pt+dRR8zHl6 DaP4FdBByBXZIeCuNvJrt42X/X7xnJ+WVslyhAPHWFn8F3KSJLoSY+pu8WsREw2koXVAVHpZSghyh ukm5CKPeWhfpMelT7osVZEuTeImtypXKdaQ4BYtJ/qnc/wR21WAFR9QqisQU20CUDd6dcjBb2liJ6 TfLo3byg3vwDEkDR+A9P/TrHsxtOxfJmr3m7zqld2YjCnkL/eXG3uXvTg0jOGBaYV02YDgfxsbN3J d6R3eC9Q==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:39662 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.98.2) (envelope-from ) id 1wAPBN-0000000022o-13aq; Wed, 08 Apr 2026 10:26:45 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1wAPBM-0000000F7jo-1DIY; Wed, 08 Apr 2026 10:26:44 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , Chen-Yu Tsai , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jitendra Vegiraju , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, netdev@vger.kernel.org, Paolo Abeni , Samuel Holland Subject: [PATCH RFC net-next 01/10] net: stmmac: rename min_id to min_snpsver Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 08 Apr 2026 10:26:44 +0100 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-0.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[armlinux.org.uk : SPF not aligned (relaxed),none]; R_DKIM_REJECT(1.00)[armlinux.org.uk:s=pandora-2019]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; PRECEDENCE_BULK(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[netdev]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo,armlinux.org.uk:email]; FORGED_SENDER_MAILLIST(0.00)[]; RCPT_COUNT_TWELVE(0.00)[14]; RCVD_COUNT_FIVE(0.00)[6]; TAGGED_FROM(0.00)[bounces-22805-noreply=patchwork.local,kernel]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[armlinux.org.uk:-]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[rmk@armlinux.org.uk,linux-sunxi@lists.linux.dev]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 94A251C00BE X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= min_id is the minimum Synopsys IP version that the hwif entry will match. Name it min_snpsver so that it's clear which part of the version ID it is related to. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/hwif.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c index 511b0fd5e834..3774af66db48 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.c +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c @@ -110,7 +110,7 @@ int stmmac_reset(struct stmmac_priv *priv) static const struct stmmac_hwif_entry { enum dwmac_core_type core_type; - u32 min_id; + u32 min_snpsver; u32 dev_id; const struct stmmac_regs_off regs; const void *desc; @@ -129,7 +129,7 @@ static const struct stmmac_hwif_entry { /* NOTE: New HW versions shall go to the end of this table */ { .core_type = DWMAC_CORE_MAC100, - .min_id = 0, + .min_snpsver = 0, .regs = { .ptp_off = PTP_GMAC3_X_OFFSET, .mmc_off = MMC_GMAC3_X_OFFSET, @@ -146,7 +146,7 @@ static const struct stmmac_hwif_entry { .quirks = stmmac_dwmac1_quirks, }, { .core_type = DWMAC_CORE_GMAC, - .min_id = 0, + .min_snpsver = 0, .regs = { .ptp_off = PTP_GMAC3_X_OFFSET, .mmc_off = MMC_GMAC3_X_OFFSET, @@ -163,7 +163,7 @@ static const struct stmmac_hwif_entry { .quirks = stmmac_dwmac1_quirks, }, { .core_type = DWMAC_CORE_GMAC4, - .min_id = 0, + .min_snpsver = 0, .regs = { .ptp_off = PTP_GMAC4_OFFSET, .mmc_off = MMC_GMAC4_OFFSET, @@ -183,7 +183,7 @@ static const struct stmmac_hwif_entry { .quirks = stmmac_dwmac4_quirks, }, { .core_type = DWMAC_CORE_GMAC4, - .min_id = DWMAC_CORE_4_00, + .min_snpsver = DWMAC_CORE_4_00, .regs = { .ptp_off = PTP_GMAC4_OFFSET, .mmc_off = MMC_GMAC4_OFFSET, @@ -204,7 +204,7 @@ static const struct stmmac_hwif_entry { .quirks = NULL, }, { .core_type = DWMAC_CORE_GMAC4, - .min_id = DWMAC_CORE_4_10, + .min_snpsver = DWMAC_CORE_4_10, .regs = { .ptp_off = PTP_GMAC4_OFFSET, .mmc_off = MMC_GMAC4_OFFSET, @@ -225,7 +225,7 @@ static const struct stmmac_hwif_entry { .quirks = NULL, }, { .core_type = DWMAC_CORE_GMAC4, - .min_id = DWMAC_CORE_5_10, + .min_snpsver = DWMAC_CORE_5_10, .regs = { .ptp_off = PTP_GMAC4_OFFSET, .mmc_off = MMC_GMAC4_OFFSET, @@ -246,7 +246,7 @@ static const struct stmmac_hwif_entry { .quirks = NULL, }, { .core_type = DWMAC_CORE_XGMAC, - .min_id = DWXGMAC_CORE_2_10, + .min_snpsver = DWXGMAC_CORE_2_10, .dev_id = DWXGMAC_ID, .regs = { .ptp_off = PTP_XGMAC_OFFSET, @@ -268,7 +268,7 @@ static const struct stmmac_hwif_entry { .quirks = NULL, }, { .core_type = DWMAC_CORE_XGMAC, - .min_id = DWXLGMAC_CORE_2_00, + .min_snpsver = DWXLGMAC_CORE_2_00, .dev_id = DWXLGMAC_ID, .regs = { .ptp_off = PTP_XGMAC_OFFSET, @@ -302,7 +302,7 @@ stmmac_hwif_find(enum dwmac_core_type core_type, u8 snpsver, u8 dev_id) if (core_type != entry->core_type) continue; /* Use synopsys_id var because some setups can override this */ - if (snpsver < entry->min_id) + if (snpsver < entry->min_snpsver) continue; if (core_type == DWMAC_CORE_XGMAC && dev_id != entry->dev_id) From patchwork Wed Apr 8 09:26:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 1999 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 7F07E1C0093 for ; Wed, 8 Apr 2026 11:27:59 +0200 (CEST) Authentication-Results: mxe881; dkim=fail header.d=armlinux.org.uk; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-22806-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-22806-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 39F41301A93B for ; Wed, 8 Apr 2026 09:27:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E8762D9EDC; Wed, 8 Apr 2026 09:27:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="CYoTgO5+" X-Original-To: linux-sunxi@lists.linux.dev Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 EF6902DCF74 for ; Wed, 8 Apr 2026 09:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640439; cv=none; b=gcZONeM0R1g9ohSDQWkMuELYckieIBjyZ5977bgCZbeYHGVeCMcKqe2jUlluyDk9aRDxldh/7+/QW3oRd4KCqCY2ZH2dVHzgX1YFWnfmK9lwhG5bh07gxbUuwypkhCMtsXrwqotUUhBjQDnln26DC6vEHlmyPIA6gKKhrX2sAsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640439; c=relaxed/simple; bh=uTvfl5q8mXcuy4HH0QC8P2V3S6wd/UywonY2WnHQf/A=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=kmbD29hiP6ooS8j3LnNZVMmdN3PvJGAqU/9WbQCw1/zHG3h5N0vjdly9ACJdTceRj+quilDRFT6LYdGRI4uv+XtScJJW4GKPBH0kBUBZNNkcAp/osKGp2JPBNRGy/PtCcHXw7EW/udonmHydl6qb5qGWjo9tBg33AaPMTXhKsvM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=CYoTgO5+; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KZiSegeFsbX6rV73Xt8FKnLevjwV0lgeOtK47cPkIg0=; b=CYoTgO5+QDOiagpHtFAWN1UPNi NMGcLgOokDZZJAwfqyECQs8M0fChSr1K9zLmqyrw+rdqBH2nS3bU4FfoPmO9d2NqovuwGEqdfFtL3 SZ7yT3LzdMEq7U/JYRa+zfD5B4n3NT/dS/V4+OjOfNjEPdxpWO8X80slDWvzmkyRh6DmkU79zgn/u eWZc2lYVOaxP/js+TdShgmRdlTXfYlutJsKi3cmZptASLiEkHw/28RLM6yGVsGQU+U4ST5POBzc30 jP31Vu0ZPj+jh9ebjJq6Vks9q17RgabXWYVHBDmZap4QmrG6QLE7HwqMYkc4kkCQtkYPBySUQbB1M noF8szBw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:35130 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.98.2) (envelope-from ) id 1wAPBV-0000000022y-1HGJ; Wed, 08 Apr 2026 10:26:53 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1wAPBR-0000000F7ju-1fD9; Wed, 08 Apr 2026 10:26:49 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , Chen-Yu Tsai , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jitendra Vegiraju , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, netdev@vger.kernel.org, Paolo Abeni , Samuel Holland Subject: [PATCH RFC net-next 02/10] net: stmmac: rename dev_id to userver Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 08 Apr 2026 10:26:49 +0100 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The Synopsys Databook and several implementation TRMs identify bits 15:8 of the version register in dwmac v3.xx and v4.xx as "userver". We even print its value with "User ID". Rather than using "dev_id", use "userver" instead. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/hwif.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c index 3774af66db48..830ff816ab4f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.c +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c @@ -15,7 +15,7 @@ struct stmmac_version { u8 snpsver; - u8 dev_id; + u8 userver; }; static void stmmac_get_version(struct stmmac_priv *priv, @@ -26,7 +26,7 @@ static void stmmac_get_version(struct stmmac_priv *priv, u32 version; ver->snpsver = 0; - ver->dev_id = 0; + ver->userver = 0; if (core_type == DWMAC_CORE_MAC100) return; @@ -48,7 +48,7 @@ static void stmmac_get_version(struct stmmac_priv *priv, ver->snpsver = FIELD_GET(DWMAC_SNPSVER, version); if (core_type == DWMAC_CORE_XGMAC) - ver->dev_id = FIELD_GET(DWMAC_USERVER, version); + ver->userver = FIELD_GET(DWMAC_USERVER, version); } static void stmmac_dwmac_mode_quirk(struct stmmac_priv *priv) @@ -111,7 +111,7 @@ int stmmac_reset(struct stmmac_priv *priv) static const struct stmmac_hwif_entry { enum dwmac_core_type core_type; u32 min_snpsver; - u32 dev_id; + u32 userver; const struct stmmac_regs_off regs; const void *desc; const void *dma; @@ -247,7 +247,7 @@ static const struct stmmac_hwif_entry { }, { .core_type = DWMAC_CORE_XGMAC, .min_snpsver = DWXGMAC_CORE_2_10, - .dev_id = DWXGMAC_ID, + .userver = DWXGMAC_ID, .regs = { .ptp_off = PTP_XGMAC_OFFSET, .mmc_off = MMC_XGMAC_OFFSET, @@ -269,7 +269,7 @@ static const struct stmmac_hwif_entry { }, { .core_type = DWMAC_CORE_XGMAC, .min_snpsver = DWXLGMAC_CORE_2_00, - .dev_id = DWXLGMAC_ID, + .userver = DWXLGMAC_ID, .regs = { .ptp_off = PTP_XGMAC_OFFSET, .mmc_off = MMC_XGMAC_OFFSET, @@ -291,7 +291,7 @@ static const struct stmmac_hwif_entry { }; static const struct stmmac_hwif_entry * -stmmac_hwif_find(enum dwmac_core_type core_type, u8 snpsver, u8 dev_id) +stmmac_hwif_find(enum dwmac_core_type core_type, u8 snpsver, u8 userver) { const struct stmmac_hwif_entry *entry; int i; @@ -305,7 +305,7 @@ stmmac_hwif_find(enum dwmac_core_type core_type, u8 snpsver, u8 dev_id) if (snpsver < entry->min_snpsver) continue; if (core_type == DWMAC_CORE_XGMAC && - dev_id != entry->dev_id) + userver != entry->userver) continue; return entry; @@ -358,7 +358,7 @@ int stmmac_hwif_init(struct stmmac_priv *priv) /* Fallback to generic HW */ /* Use synopsys_id var because some setups can override this */ - entry = stmmac_hwif_find(core_type, priv->synopsys_id, version.dev_id); + entry = stmmac_hwif_find(core_type, priv->synopsys_id, version.userver); if (!entry) { dev_err(priv->device, "Failed to find HW IF (id=0x%x, gmac=%d/%d)\n", From patchwork Wed Apr 8 09:26:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 2000 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 5DA571C0093 for ; Wed, 8 Apr 2026 11:28:20 +0200 (CEST) Authentication-Results: mxe881; dkim=fail header.d=armlinux.org.uk; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-22807-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-22807-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 3DA3A3006179 for ; Wed, 8 Apr 2026 09:27:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5F7B358384; Wed, 8 Apr 2026 09:27:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="C8O2NmSY" X-Original-To: linux-sunxi@lists.linux.dev Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 A74C82DCF74 for ; Wed, 8 Apr 2026 09:27:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640458; cv=none; b=B40Hw/KgJyBv04anATF/2ifgqVmPvjqysWNi8sFIbwHhzTjRdLtWkY2foqZrZMqlKTlFEZmlD0m7TQ++gpGl9lGqMTk1u4oGP96rcOKz7S7sjyB2mov8SIxwzT2jYHbib7iCG6l8dkE1pW4BdAy4akf7Df5GsCmNnWyMUmbWQKY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640458; c=relaxed/simple; bh=hl0uibg4BOewmLTlthEEI+J48Fn6/Kn7W+cNMYT/9tc=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=PEU5gOpPhQA/zm2vnlN3RWerF+BeD6/duu3EQove1/zn+DVdw2lB/9dzAIrnJky2ODto0ivasGs2GgRi1PVKpRqGUUCnSZJXL27Afn1DhL917vT9w3FdFEYKMozRDTkyHZ4gTHiD8jwJfBV2IOebeIq993xfwldg2TsvHJKLsfU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=C8O2NmSY; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NnhKaayKX2ym3axLouWbyDpq6J08FaMtPXyF8+AIVRQ=; b=C8O2NmSYhN3gcqt/4N8/XEsW4/ 6LCi4AVhCwL+VBVW4gwYUj7fvUauUkWoYfqxGDbxBLMDaF57h4rqm+1+CN+5OPVdYa0LrLiaXYg/a Zh/Rzp2NsVCy/qCU0GbjKtTumihSgCbkR2FA2DVXU7izrvjcbzAHc4yVqNTDAbsBU+wx8abvr1g9c svIr2MjF+6UpTwuFCZkeUUj1wpxhNJ26N0HoCtRU1DLE0huxLLgpHYeVIu4f7s8JLhxvf2lkJ3jzX +NVhjrfz1Sz9EQAPqrE8c9Bp4+zxHF8ndkUpEKQ56tlcNxVq/m/BE2ypKPrX5OvGhVfruBO+RQYVI yz2fA7Ag==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:35142 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.98.2) (envelope-from ) id 1wAPBd-0000000023B-0iEH; Wed, 08 Apr 2026 10:27:01 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1wAPBW-0000000F7k0-2Dr7; Wed, 08 Apr 2026 10:26:54 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , Chen-Yu Tsai , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jitendra Vegiraju , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, netdev@vger.kernel.org, Paolo Abeni , Samuel Holland Subject: [PATCH RFC net-next 03/10] net: stmmac: always fill in ver->userver Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 08 Apr 2026 10:26:54 +0100 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Always fill in ver->userver irrespective of the core type. This has no functional impact but tidies up the code by removing an unnecessary conditional. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/hwif.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c index 830ff816ab4f..aacf78d4a2ee 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.c +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c @@ -47,8 +47,7 @@ static void stmmac_get_version(struct stmmac_priv *priv, FIELD_GET(DWMAC_SNPSVER, version)); ver->snpsver = FIELD_GET(DWMAC_SNPSVER, version); - if (core_type == DWMAC_CORE_XGMAC) - ver->userver = FIELD_GET(DWMAC_USERVER, version); + ver->userver = FIELD_GET(DWMAC_USERVER, version); } static void stmmac_dwmac_mode_quirk(struct stmmac_priv *priv) From patchwork Wed Apr 8 09:26:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 2001 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 1962F1C00B1 for ; Wed, 8 Apr 2026 11:29:06 +0200 (CEST) Authentication-Results: mxe881; dkim=fail header.d=armlinux.org.uk; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-22808-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-22808-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 75C49303C4EF for ; Wed, 8 Apr 2026 09:27:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 988EB3B19D0; Wed, 8 Apr 2026 09:27:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="uH/u34qk" X-Original-To: linux-sunxi@lists.linux.dev Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 03FE639FCDB for ; Wed, 8 Apr 2026 09:27:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640464; cv=none; b=kzkUCboQWwDPJl3d0qKDUs0IN9/qpWGdSqpfp2oOIx+Ov9QmGwdcOaxpkuHVOAdG9ToHurzLaDgSQpw/2moARGkzoqUFxgSY43cUnuF+cROaM2ylHCCtGLPDDjRIApzgOXwFo+WTGLw4qAZgAGtBkGI0wEknatNHeqcI3kg7zVY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640464; c=relaxed/simple; bh=oe/JzikVxLK0wGvqcmdfL0q+oqoBvlznkBKQi6djkQE=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=q3qqyniCctShP6TqiQdvTvpWMICd8iiGtxJRlgxMVzZPWDJljSF3Ulh5bgjTuyHQy7eLXqX8qAGDyNSzNm8qYDLT7sMH/KgLJENN9deV4UmObxIba8sjhooqRE9j47YUI7zcW8Rkk41YpdwfhdsTm6w7nfHG5LMGnXVzOCkPZ0g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=uH/u34qk; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uwM2BKpIP8DPPmF9GEljD2GJ7H5E0kHEdj42FXP3+Cs=; b=uH/u34qk6GM24zIbXzce3UMsVL UmfldgOTD9CAxHzHo77TAr8gaP5peTsoUbEQwZL6lNORhwxQ5vHtQ9rFytveMZ3OUm8y3tP+IHhAF v6EzFmNn+jToBnkiLxR4YArC/ggecfOmEVcT7BXmmhhQWYczVWMBlmhO0ZOfZUDOrEApDuaTNnAjz VmGO7AXmVb2xsiDtwcrl3iHvwJjez50wAM376Ldq56NZ5FgcvL9Sj2QuceQnxgaJrmSFH5wiJXYiI g2/lwRgvGK/jhujIqBkoGo79wPx6vQUq4WwpmKBQ0ZUBoEnYfVPYOR/dzxGoyr+miNsNN3tUku9YB +jBEVZYg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:33374 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.98.2) (envelope-from ) id 1wAPBi-0000000023N-3rkZ; Wed, 08 Apr 2026 10:27:07 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1wAPBb-0000000F7k5-2d0y; Wed, 08 Apr 2026 10:26:59 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , Chen-Yu Tsai , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jitendra Vegiraju , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, netdev@vger.kernel.org, Paolo Abeni , Samuel Holland Subject: [PATCH RFC net-next 04/10] net: stmmac: use ver->userver and ver->snpsver to print version Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 08 Apr 2026 10:26:59 +0100 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-0.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.234.253.10:from]; SUSPICIOUS_RECIPS(1.50)[]; R_DKIM_REJECT(1.00)[armlinux.org.uk:s=pandora-2019]; DMARC_POLICY_SOFTFAIL(1.00)[armlinux.org.uk : SPF not aligned (relaxed),none]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FROM_HAS_DN(0.00)[]; PRECEDENCE_BULK(0.00)[]; TAGGED_RCPT(0.00)[netdev]; DBL_BLOCKED_OPENRESOLVER(0.00)[sea.lore.kernel.org:rdns,sea.lore.kernel.org:helo,armlinux.org.uk:email]; FORGED_SENDER_MAILLIST(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCPT_COUNT_TWELVE(0.00)[14]; RCVD_COUNT_FIVE(0.00)[6]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[armlinux.org.uk:-]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[rmk@armlinux.org.uk,linux-sunxi@lists.linux.dev]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-22808-noreply=patchwork.local,kernel]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 1962F1C00B1 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Rather than using FIELD_GET() twice, reorder the code to extract the version fields into struct stmmac_version, and then print them. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/hwif.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c index aacf78d4a2ee..7f95a2a5be4c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.c +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c @@ -42,12 +42,11 @@ static void stmmac_get_version(struct stmmac_priv *priv, return; } - dev_info(priv->device, "User ID: 0x%x, Synopsys ID: 0x%x\n", - FIELD_GET(DWMAC_USERVER, version), - FIELD_GET(DWMAC_SNPSVER, version)); - ver->snpsver = FIELD_GET(DWMAC_SNPSVER, version); ver->userver = FIELD_GET(DWMAC_USERVER, version); + + dev_info(priv->device, "User ID: 0x%x, Synopsys ID: 0x%x\n", + ver->userver, ver->snpsver); } static void stmmac_dwmac_mode_quirk(struct stmmac_priv *priv) From patchwork Wed Apr 8 09:27:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 2002 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 16ACF1C00A6 for ; Wed, 8 Apr 2026 11:29:41 +0200 (CEST) Authentication-Results: mxe881; dkim=fail header.d=armlinux.org.uk; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-22809-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-22809-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 5147330479FA for ; Wed, 8 Apr 2026 09:27:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0935439F188; Wed, 8 Apr 2026 09:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="jkT/iqKf" X-Original-To: linux-sunxi@lists.linux.dev Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 2DC1933F370 for ; Wed, 8 Apr 2026 09:27:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640465; cv=none; b=KUksu33M4Zu+lChuhTVbYUYMN0BSt46B/WGycteO9iE+WuP0Zkx9XygYnh9ISrAGkoCxVAe7aUugFDFiwOSO9ekFeSFAu/TVaIpEZDc7efrZXvxlIaLaUM/IPFTUmxOaF+o08+FDXlUqU814n8rfLrPJxAmEG7bytmMXI3FYW2c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640465; c=relaxed/simple; bh=DSb2x84v3omcpvD+EyffcKVSzRk4M0A1b7j9iQXUIu0=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=at57KLBUeVQ3wxNVKqilQ90YSZtnNAAQxnPEcPg2oYAOqqlmM1ArM7077AULV0QGhaGVkrTcZyNflZiFa3qqlQuZ1kYRQ6Nk88oYBleAgOeESxy8vjJ8w/EoCuraH5/rq0j0r4kgGYdHJGknfpB9HdN8J6gcfZK5+eKWvGQLjoM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=jkT/iqKf; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=l/uumbg2htkDWqchC9pV2fd0IznYJi1xURkP8jIplg8=; b=jkT/iqKfYIAcIwAFGl/L7H7e6J Atf5/PlrZ4RMNWrgxaX55XnQWRSxSXCT8qBn5QJ4rZxCgNItXhv99FcCqP9m+JmJehLxCurQEP9Sz CqPwq4nD9s5T82umqqPCpwQqEiPyM542xxg2CoaeTEDSGIIWr9nOKsK8GFgLzRWDwJ+ikwkNTPr0t fq5GaLj4BpKC7CDpuc4SJL+LFUc/pjSMkrTtGbCwUlWiXt1574bSCaQYEmJ94xjQI8MwKOOH3yT5v luj8YljJ1ihZMOBNcEaVZkKAKHxafFNqc7e5MOwVVNQxEV4Wk1O+dyAwwsQcj8JBQz42nFTS6jab3 hMDQng9Q==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:33376 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.98.2) (envelope-from ) id 1wAPBn-0000000023T-42Wy; Wed, 08 Apr 2026 10:27:12 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1wAPBg-0000000F7kA-3HFF; Wed, 08 Apr 2026 10:27:04 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , Chen-Yu Tsai , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jitendra Vegiraju , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, netdev@vger.kernel.org, Paolo Abeni , Samuel Holland Subject: [PATCH RFC net-next 05/10] net: stmmac: rename confusing synopsys_id Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 08 Apr 2026 10:27:04 +0100 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-0.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.234.253.10:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[armlinux.org.uk : SPF not aligned (relaxed),none]; R_DKIM_REJECT(1.00)[armlinux.org.uk:s=pandora-2019]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; PRECEDENCE_BULK(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[netdev]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[sea.lore.kernel.org:rdns,sea.lore.kernel.org:helo,armlinux.org.uk:email]; FORGED_SENDER_MAILLIST(0.00)[]; RCPT_COUNT_TWELVE(0.00)[14]; RCVD_COUNT_FIVE(0.00)[6]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[armlinux.org.uk:-]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[rmk@armlinux.org.uk,linux-sunxi@lists.linux.dev]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-22809-noreply=patchwork.local,kernel]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 16ACF1C00A6 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= priv->synopsys_id is the Synopsys IP version, defined by snpsver in the databook. This is made up of the major version in bits 7:4 and the first digit of the minor version in bits 3:0. Change the type for synopsys_id to be a u8 and rename to snpsver. For reference, the values for snpsver: GMAC100 cores do not have a readable snpsver number. GMAC cores generally have a snpsver number less than 0x40. GMAC4 cores may have a version number that overlaps GMAC cores (see first entry for DWMAC_CORE_GMAC4). XGMAC and XLGMAC cores each have an entirely separate IP version number space from GMAC and GMAC4, which are distinguished by their respective userver. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c | 2 +- drivers/net/ethernet/stmicro/stmmac/hwif.c | 10 +++++----- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ++++++------ drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 8 ++++---- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c index eb14c197d6ae..789b384a2838 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c @@ -326,7 +326,7 @@ static int loongson_dwmac_setup(void *apriv, struct mac_device_info *mac) * original value so the correct HW-interface would be selected. */ if (ld->multichan) { - priv->synopsys_id = DWMAC_CORE_3_70; + priv->snpsver = DWMAC_CORE_3_70; *dma = dwmac1000_dma_ops; dma->init_chan = loongson_dwmac_dma_init_channel; dma->dma_interrupt = loongson_dwmac_dma_interrupt; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 48c52eb96233..4bff7592c652 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1069,7 +1069,7 @@ static int sun8i_dwmac_setup(void *ppriv, struct mac_device_info *mac) mac->unicast_filter_entries = 8; /* Synopsys Id is not available */ - priv->synopsys_id = 0; + priv->snpsver = 0; return 0; } diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c index 03437f1cf3df..635d711a554e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c @@ -380,7 +380,7 @@ static int dwxgmac2_get_hw_feature(void __iomem *ioaddr, dma_cap->vlhash = (hw_cap & XGMAC_HWFEAT_VLHASH) >> 4; dma_cap->half_duplex = (hw_cap & XGMAC_HWFEAT_HDSEL) >> 3; dma_cap->mbps_1000 = (hw_cap & XGMAC_HWFEAT_GMIISEL) >> 1; - if (dma_cap->mbps_1000 && priv->synopsys_id >= DWXGMAC_CORE_2_20) + if (dma_cap->mbps_1000 && priv->snpsver >= DWXGMAC_CORE_2_20) dma_cap->mbps_10_100 = 1; /* MAC HW feature 1 */ diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c index 7f95a2a5be4c..e5629afc391f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.c +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c @@ -72,7 +72,7 @@ static int stmmac_dwmac1_quirks(struct stmmac_priv *priv) dev_info(priv->device, "Enhanced/Alternate descriptors\n"); /* GMAC older than 3.50 has no extended descriptors */ - if (priv->synopsys_id >= DWMAC_CORE_3_50) { + if (priv->snpsver >= DWMAC_CORE_3_50) { dev_info(priv->device, "Enabled extended descriptors\n"); priv->extend_desc = true; } else { @@ -299,7 +299,7 @@ stmmac_hwif_find(enum dwmac_core_type core_type, u8 snpsver, u8 userver) if (core_type != entry->core_type) continue; - /* Use synopsys_id var because some setups can override this */ + /* Use snpsver var because some setups can override this */ if (snpsver < entry->min_snpsver) continue; if (core_type == DWMAC_CORE_XGMAC && @@ -324,7 +324,7 @@ int stmmac_hwif_init(struct stmmac_priv *priv) stmmac_get_version(priv, &version); /* Save ID for later use */ - priv->synopsys_id = version.snpsver; + priv->snpsver = version.snpsver; /* Lets assume some safe values first */ if (core_type == DWMAC_CORE_GMAC4) { @@ -355,8 +355,8 @@ int stmmac_hwif_init(struct stmmac_priv *priv) /* Fallback to generic HW */ - /* Use synopsys_id var because some setups can override this */ - entry = stmmac_hwif_find(core_type, priv->synopsys_id, version.userver); + /* Use snpsver var because some setups can override this */ + entry = stmmac_hwif_find(core_type, priv->snpsver, version.userver); if (!entry) { dev_err(priv->device, "Failed to find HW IF (id=0x%x, gmac=%d/%d)\n", diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index 8ba8f03e1ce0..9a5d9c404e4f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h @@ -304,7 +304,7 @@ struct stmmac_priv { struct dma_features dma_cap; struct stmmac_counters mmc; int hw_cap_support; - int synopsys_id; + u8 snpsver; u32 msg_enable; /* Our MAC Wake-on-Lan options */ int wolopts; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index 92585d27ab88..343cf903c0bf 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -553,7 +553,7 @@ static void stmmac_get_ethtool_stats(struct net_device *dev, priv->xstats.phy_eee_wakeup_error_n = val; } - if (priv->synopsys_id >= DWMAC_CORE_3_50) + if (priv->snpsver >= DWMAC_CORE_3_50) stmmac_mac_debug(priv, priv->ioaddr, (void *)&priv->xstats, rx_queues_count, tx_queues_count); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 01a983001ab4..295d31d7b28b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -755,7 +755,7 @@ static int stmmac_hwtstamp_set(struct net_device *dev, config->rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT; ptp_v2 = PTP_TCR_TSVER2ENA; snap_type_sel = PTP_TCR_SNAPTYPSEL_1; - if (priv->synopsys_id < DWMAC_CORE_4_10) + if (priv->snpsver < DWMAC_CORE_4_10) ts_event_en = PTP_TCR_TSEVNTENA; ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA; ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA; @@ -6624,7 +6624,7 @@ static int stmmac_dma_cap_show(struct seq_file *seq, void *v) seq_printf(seq, "\tAV features: %s\n", (priv->dma_cap.av) ? "Y" : "N"); seq_printf(seq, "\tChecksum Offload in TX: %s\n", (priv->dma_cap.tx_coe) ? "Y" : "N"); - if (priv->synopsys_id >= DWMAC_CORE_4_00 || + if (priv->snpsver >= DWMAC_CORE_4_00 || priv->plat->core_type == DWMAC_CORE_XGMAC) { seq_printf(seq, "\tIP Checksum Offload in RX: %s\n", (priv->dma_cap.rx_coe) ? "Y" : "N"); @@ -7454,7 +7454,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv) if (priv->plat->rx_coe) { priv->hw->rx_csum = priv->plat->rx_coe; dev_info(priv->device, "RX Checksum Offload Engine supported\n"); - if (priv->synopsys_id < DWMAC_CORE_4_00) + if (priv->snpsver < DWMAC_CORE_4_00) dev_info(priv->device, "COE Type %d\n", priv->hw->rx_csum); } if (priv->plat->tx_coe) @@ -7520,7 +7520,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv) * has to be disable and this can be done by passing the * riwt_off field from the platform. */ - if ((priv->synopsys_id >= DWMAC_CORE_3_50 || + if ((priv->snpsver >= DWMAC_CORE_3_50 || priv->plat->core_type == DWMAC_CORE_XGMAC) && !priv->plat->riwt_off) { priv->use_riwt = 1; @@ -7897,7 +7897,7 @@ static int __stmmac_dvr_probe(struct device *device, /* Only DWMAC core version 5.20 onwards supports HW descriptor prefetch. */ - if (priv->synopsys_id < DWMAC_CORE_5_20) + if (priv->snpsver < DWMAC_CORE_5_20) priv->plat->dma_cfg->dche = false; stmmac_check_ether_addr(priv); @@ -7997,7 +7997,7 @@ static int __stmmac_dvr_probe(struct device *device, if (priv->plat->core_type == DWMAC_CORE_XGMAC) ndev->max_mtu = XGMAC_JUMBO_LEN; - else if (priv->plat->enh_desc || priv->synopsys_id >= DWMAC_CORE_4_00) + else if (priv->plat->enh_desc || priv->snpsver >= DWMAC_CORE_4_00) ndev->max_mtu = JUMBO_LEN; else ndev->max_mtu = SKB_MAX_HEAD(NET_SKB_PAD + NET_IP_ALIGN); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index afe98ff5bdcb..0107119f68d2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -74,7 +74,7 @@ static void stmmac_xgmac2_c22_format(struct stmmac_priv *priv, int phyaddr, { u32 tmp = 0; - if (priv->synopsys_id < DWXGMAC_CORE_2_20) { + if (priv->snpsver < DWXGMAC_CORE_2_20) { /* Until ver 2.20 XGMAC does not support C22 addr >= 4. Those * bits above bit 3 of XGMAC_MDIO_C22P register are reserved. */ @@ -136,7 +136,7 @@ static int stmmac_xgmac2_mdio_read_c22(struct mii_bus *bus, int phyaddr, u32 addr; /* Until ver 2.20 XGMAC does not support C22 addr >= 4 */ - if (priv->synopsys_id < DWXGMAC_CORE_2_20 && + if (priv->snpsver < DWXGMAC_CORE_2_20 && phyaddr > MII_XGMAC_MAX_C22ADDR) return -ENODEV; @@ -199,7 +199,7 @@ static int stmmac_xgmac2_mdio_write_c22(struct mii_bus *bus, int phyaddr, u32 addr; /* Until ver 2.20 XGMAC does not support C22 addr >= 4 */ - if (priv->synopsys_id < DWXGMAC_CORE_2_20 && + if (priv->snpsver < DWXGMAC_CORE_2_20 && phyaddr > MII_XGMAC_MAX_C22ADDR) return -ENODEV; @@ -625,7 +625,7 @@ int stmmac_mdio_register(struct net_device *ndev) new_bus->read_c45 = &stmmac_xgmac2_mdio_read_c45; new_bus->write_c45 = &stmmac_xgmac2_mdio_write_c45; - if (priv->synopsys_id < DWXGMAC_CORE_2_20) { + if (priv->snpsver < DWXGMAC_CORE_2_20) { /* Right now only C22 phys are supported */ max_addr = MII_XGMAC_MAX_C22ADDR; From patchwork Wed Apr 8 09:27:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 2003 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 57FD31C00A6 for ; Wed, 8 Apr 2026 11:29:59 +0200 (CEST) Authentication-Results: mxe881; dkim=fail header.d=armlinux.org.uk; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-22810-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-22810-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 41F623051160 for ; Wed, 8 Apr 2026 09:27:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 755CB3B0AED; Wed, 8 Apr 2026 09:27:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="eLYN5hjG" X-Original-To: linux-sunxi@lists.linux.dev Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 D179C3B27E8 for ; Wed, 8 Apr 2026 09:27:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640467; cv=none; b=TMtYn3M8kDMXP3P+zA93FFSXUSf9I+l3QYUQzh9bQAwMXh2pqc7YKE+i6eI8Qal14yELsNC/0CCeLo8qntx8f8j/QuUi8DqSUEC/+fwExRneF75nv9ANRvMl2iDKsBjBJSzedrKZ11irMhoVJdkWD16Yz4pt8WTwZfuW2qqsPs0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640467; c=relaxed/simple; bh=REqXr5wLMfj26wRNRYDG7YJyazjTHsxYB64myy/nHFI=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=UvGlji8oyLhFRMTsd91Kc+8YQQU7u1w15Y0K8PTfWyoY9AWCSYIEmsjekj+ZU1ePjbpqbXJsOj1EjhNr2knNOJgK1ebgNvicnMZin0FOAfQsN1kNahhVfOpfuEUFZETxZH0+mf1cu4HONttDeUUuwxOAWFfwa+Ueo3dmtDBO4oo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=eLYN5hjG; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ed7IJ5GSBXEYvfVGQN3rSQE0J19697RZGgHvSAagUwg=; b=eLYN5hjGogoHiOmFImFRlYgYhI gWL4oUX5KiyAxcvm3HY91IWYJDRO1TmqUl+Uh0G8yFcB3J0BEHR1h3PcI+Eba6CTtPCathDQLDFPO OYb1y926ZCokPdP6mJADhAWFaiUdCRFd1gxEajOxE55NhumnfNf11g3T9Q+CT3D/toZgsyAj2FTZP c7LuDKVN/9NxKrLzD89y1UWwKSQNtlqR4VvwPxfcZrt1TyB9+O7qiDiHhm+XlRfouwDr+ElSYZsUB p4SJWGt61fQsmq0OlYVhyBc57rZqpH0dav7lXKSBPuuScBTwSU8MReAMCl1JOxoRxoXzn5Ep8h6AU WDdF0VVw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:43578 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.98.2) (envelope-from ) id 1wAPBw-0000000023h-1TcH; Wed, 08 Apr 2026 10:27:20 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1wAPBl-0000000F7kT-3kSP; Wed, 08 Apr 2026 10:27:09 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , Chen-Yu Tsai , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jitendra Vegiraju , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, netdev@vger.kernel.org, Paolo Abeni , Samuel Holland Subject: [PATCH RFC net-next 06/10] net: stmmac: dche is only for GMAC4 cores Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 08 Apr 2026 10:27:09 +0100 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-0.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.234.253.10:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[armlinux.org.uk : SPF not aligned (relaxed),none]; R_DKIM_REJECT(1.00)[armlinux.org.uk:s=pandora-2019]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; PRECEDENCE_BULK(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[netdev]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[armlinux.org.uk:email,sea.lore.kernel.org:rdns,sea.lore.kernel.org:helo]; FORGED_SENDER_MAILLIST(0.00)[]; RCPT_COUNT_TWELVE(0.00)[14]; RCVD_COUNT_FIVE(0.00)[6]; TAGGED_FROM(0.00)[bounces-22810-noreply=patchwork.local,kernel]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[armlinux.org.uk:-]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[rmk@armlinux.org.uk,linux-sunxi@lists.linux.dev]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 57FD31C00A6 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= dma_cfg->dche is only read by dwmac4_dma_init(), which is only called for the DWMAC_CORE_GMAC4 core type. Rather than having a bare IP version check that can match any core type, make this conditional on DWMAC_CORE_GMAC4 to make it clear that it's a GMAC4 feature. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 295d31d7b28b..e47321119c83 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7895,9 +7895,10 @@ static int __stmmac_dvr_probe(struct device *device, if (ret) goto error_hw_init; - /* Only DWMAC core version 5.20 onwards supports HW descriptor prefetch. + /* Only DWMAC4 core version 5.20 onwards support HW descriptor prefetch. */ - if (priv->snpsver < DWMAC_CORE_5_20) + if (priv->plat->core_type != DWMAC_CORE_GMAC4 || + priv->snpsver < DWMAC_CORE_5_20) priv->plat->dma_cfg->dche = false; stmmac_check_ether_addr(priv); From patchwork Wed Apr 8 09:27:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 2006 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id B970F1C008C for ; Wed, 8 Apr 2026 11:45:47 +0200 (CEST) Authentication-Results: mxe881; dkim=fail header.d=armlinux.org.uk; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-22811-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-22811-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id ADD3B30EB393 for ; Wed, 8 Apr 2026 09:39:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8B1A3B2FDA; Wed, 8 Apr 2026 09:39:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="ixWTzvp4" X-Original-To: linux-sunxi@lists.linux.dev Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 EA7A239E6FC for ; Wed, 8 Apr 2026 09:39:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775641154; cv=none; b=pA8dRS7hrSIP7wQiQpUUjpZJh1sw+teq0qn0mdR8sj5gj0lCKADZXNjwndNkzaQ7tIBh27uShoDsmxS/wI9c0V111PbbkQPrDlV0IwE7uQB6CdWCnUEn2so8tBwjwcF60AtrINBel+4q3/tm3TlpE3e8mtF99l8e7d5q7asjodk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775641154; c=relaxed/simple; bh=kW+XIOa0p1Pv+wOMyQbVRtwv7Ps4FjolTbA8qTfsLVU=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=g93LjC7f+maQlkOTpVzTkCkS6LxW28fVQAPDlWYe4CiJVYDlMdzGHEogRJTUzoYqeJgqtmdrdMUA9nf6PptHqMWDS2oogep5GK+98LdRRXKaDODczX4f2TiYh7PlH7b4QonOR4xsVlBSen40fgxiaiQmmkamf87nSHpKL2Aydro= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=ixWTzvp4; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1HKasakdQPn3aMFJOmu7e2iJDfqBG60iaErJHrMCkJA=; b=ixWTzvp4f+t4GhuXFYTrdH/aRd 3FOKn/IkoHkbFk+C3776O3PX94GwUOmeacik8WLrjYYwBNbDmfMV00pd4hTmlTfGPNDDml1HlupgV uG88xMNXQGMrQFcrtf3jrvoXXH8j7LM3BRalWNTvuEofLcGzekrUAniQ9n/7ZlA2zaALx2cHogePZ fiZvPfiKO85jm1il2ByWPSNfmc0p6VGplrZOB7KtH8Q4XN2zg515QJfiiOiiJv6aAUhUR+CXpugjx FJigfk2Qg64/M4BfcWBsiMSwYXe5UPArYKR7M0Iyf1spmVIFgfYLxwNKLIUVUa/+bTyXDCCLetmxA pPTTWNUQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:43584 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.98.2) (envelope-from ) id 1wAPC1-0000000023p-3pgt; Wed, 08 Apr 2026 10:27:27 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1wAPBr-0000000F7ka-032o; Wed, 08 Apr 2026 10:27:15 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , Chen-Yu Tsai , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jitendra Vegiraju , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, netdev@vger.kernel.org, Paolo Abeni , Samuel Holland Subject: [PATCH RFC net-next 07/10] net: stmmac: limit MAC .debug() to dwmac1000 and dwmac4 Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 08 Apr 2026 10:27:15 +0100 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-0.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; R_DKIM_REJECT(1.00)[armlinux.org.uk:s=pandora-2019]; DMARC_POLICY_SOFTFAIL(1.00)[armlinux.org.uk : SPF not aligned (relaxed),none]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; FROM_HAS_DN(0.00)[]; PRECEDENCE_BULK(0.00)[]; TAGGED_RCPT(0.00)[netdev]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo,armlinux.org.uk:email]; FORGED_SENDER_MAILLIST(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCPT_COUNT_TWELVE(0.00)[14]; RCVD_COUNT_FIVE(0.00)[6]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[armlinux.org.uk:-]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[rmk@armlinux.org.uk,linux-sunxi@lists.linux.dev]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-22811-noreply=patchwork.local,kernel]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: B970F1C008C X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Avoid a bare test against snpsver which has multiple different number spaces depending on the core type by testing for core types that implement the .debug() method. This documents that these statistics are only available on dwmac1000 and dwmac4 cores. Signed-off-by: Russell King (Oracle) --- .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index 343cf903c0bf..0caa5b992519 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -531,7 +531,10 @@ static void stmmac_get_ethtool_stats(struct net_device *dev, } } - /* Update the DMA HW counters for dwmac10/100 */ + /* Update the DMA HW counters for dwmac10/100 (DWMAC_CORE_MAC100), + * where this will return zero. Other core types will have a non-zero + * return value. + */ ret = stmmac_dma_diagnostic_fr(priv, &priv->xstats, priv->ioaddr); if (ret) { /* If supported, for new GMAC chips expose the MMC counters */ @@ -553,7 +556,13 @@ static void stmmac_get_ethtool_stats(struct net_device *dev, priv->xstats.phy_eee_wakeup_error_n = val; } - if (priv->snpsver >= DWMAC_CORE_3_50) + /* Only dwmac1000 and dwmac4 implements the MAC .debug() method. + * As there are different version spaces depending on core_type, + * make this conditional on the appropriate core type. + */ + if ((priv->plat->core_type == DWMAC_CORE_GMAC || + priv->plat->core_type == DWMAC_CORE_GMAC4) && + priv->snpsver >= DWMAC_CORE_3_50) stmmac_mac_debug(priv, priv->ioaddr, (void *)&priv->xstats, rx_queues_count, tx_queues_count); From patchwork Wed Apr 8 09:27:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 2004 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 1C0281C008C for ; Wed, 8 Apr 2026 11:43:39 +0200 (CEST) Authentication-Results: mxe881; dkim=fail header.d=armlinux.org.uk; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-22813-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-22813-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 96FCA3012BEC for ; Wed, 8 Apr 2026 09:43:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0BDD73ACF0B; Wed, 8 Apr 2026 09:43:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="pMmFVqfW" X-Original-To: linux-sunxi@lists.linux.dev Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 3E7933ACEE1 for ; Wed, 8 Apr 2026 09:43:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775641406; cv=none; b=j012laG7sYLI1DXujLkTgfdm4/SxMrcSsV97TtUea3pZWLa/pOjaWVaRLqTI2K82gufW/wD2H7wDz2phBwhZljysl7dfCjW0T2jZTVN/onfuyaGxSBzrgcUGmeRT80yO757bV9HPWb+MazksR7lz4I5jUPMpTz4C6SozLzYwliE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775641406; c=relaxed/simple; bh=42cTnhbRNXDI42kmq2UqvJhTgEsYYP6zV+heY4u/ph4=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=DrmA99AV9fFq7Y2a4V5HF9LJDT1pVSnOV2RPNv7XklLMtJt8QTuow+gCl5vAPXucjis7CsIOXEGTetHD3LZHxIuv7XUazLuqkjNJ8gvrXb1J198svMY/Zqh7EKM7juTm1nITggXvm1PrCBBMW6TGhB2xPJS3XA9R8h9DZ2oaSmI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=pMmFVqfW; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dtVN72wGnZ6TO0cAYb5J7S2eJNnpZu9n4ngwxR3LA7o=; b=pMmFVqfW9d0y0Vunkjgw90tppX e6SHEF9NLrmIAYbhuF6NYMuzwDOppOsK4e22goBrdIiKzvwduIXBRma6wH5ml1NdEv6wFPF46mgjY ZjleLyH++ly3sn9TqN8TkvoxEpyRVEG/JnAG40jPB6MfzSIA1BCj91LVWhBomWJMcd4iaFjqmE6cF 6tn+0yEbovFt6d5tYDwYkcYq2HfcBD6VTd78TXwFg0EDFcrcCsX1oCgXHy24shjczrNA34YJABqLq bWPkQB0TU6h7mui5mHBwDdhMZcH/sVs+TMusmJGUn/E/oJ+/eW9OAIhWiXviE4E+XFLAb9rge0YTg vYTvPrrg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:33734 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.98.2) (envelope-from ) id 1wAPC7-00000000244-1u7L; Wed, 08 Apr 2026 10:27:31 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1wAPBw-0000000F7kf-0VA5; Wed, 08 Apr 2026 10:27:20 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , Chen-Yu Tsai , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jitendra Vegiraju , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, netdev@vger.kernel.org, Paolo Abeni , Samuel Holland Subject: [PATCH RFC net-next 08/10] net: stmmac: simplify stmmac_get_ethtool_stats() Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 08 Apr 2026 10:27:20 +0100 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-0.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[armlinux.org.uk : SPF not aligned (relaxed),none]; R_DKIM_REJECT(1.00)[armlinux.org.uk:s=pandora-2019]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; PRECEDENCE_BULK(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[netdev]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo,armlinux.org.uk:email]; FORGED_SENDER_MAILLIST(0.00)[]; RCPT_COUNT_TWELVE(0.00)[14]; RCVD_COUNT_FIVE(0.00)[6]; TAGGED_FROM(0.00)[bounces-22813-noreply=patchwork.local,kernel]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[armlinux.org.uk:-]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[rmk@armlinux.org.uk,linux-sunxi@lists.linux.dev]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 1C0281C008C X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= As documented, stmmac_dma_diagnostic_fr() will return non-zero for all non-DWMAC_CORE_MAC100 core types. However, as DWMAC_CORE_MAC100 core types do not have DMA capabilities, priv->dma_cap.rmon and priv->dma_cap.eee will be zero, and thus there is no need to make this also conditional on the stmmac_dma_diagnostic_fr() return value. Remove this test and unindent the code, and remove unnecessary parens. Signed-off-by: Russell King (Oracle) --- .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 60 +++++++++---------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index 0caa5b992519..77cb67f4c63c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -519,9 +519,9 @@ static void stmmac_get_ethtool_stats(struct net_device *dev, u32 rx_queues_count = priv->plat->rx_queues_to_use; u32 tx_queues_count = priv->plat->tx_queues_to_use; u64 napi_poll = 0, normal_irq_n = 0; - int i, j = 0, pos, ret; unsigned long count; unsigned int start; + int i, j = 0, pos; if (priv->dma_cap.asp) { for (i = 0; i < STMMAC_SAFETY_FEAT_SIZE; i++) { @@ -531,42 +531,38 @@ static void stmmac_get_ethtool_stats(struct net_device *dev, } } - /* Update the DMA HW counters for dwmac10/100 (DWMAC_CORE_MAC100), - * where this will return zero. Other core types will have a non-zero - * return value. - */ - ret = stmmac_dma_diagnostic_fr(priv, &priv->xstats, priv->ioaddr); - if (ret) { - /* If supported, for new GMAC chips expose the MMC counters */ - if (priv->dma_cap.rmon) { - stmmac_mmc_read(priv, priv->mmcaddr, &priv->mmc); + /* Update the DMA HW counters for dwmac10/100 (DWMAC_CORE_MAC100). */ + stmmac_dma_diagnostic_fr(priv, &priv->xstats, priv->ioaddr); - for (i = 0; i < STMMAC_MMC_STATS_LEN; i++) { - char *p; - p = (char *)priv + stmmac_mmc[i].stat_offset; + /* If supported, for new GMAC chips expose the MMC counters */ + if (priv->dma_cap.rmon) { + stmmac_mmc_read(priv, priv->mmcaddr, &priv->mmc); - data[j++] = (stmmac_mmc[i].sizeof_stat == - sizeof(u64)) ? (*(u64 *)p) : - (*(u32 *)p); - } - } - if (priv->dma_cap.eee) { - int val = phylink_get_eee_err(priv->phylink); - if (val) - priv->xstats.phy_eee_wakeup_error_n = val; + for (i = 0; i < STMMAC_MMC_STATS_LEN; i++) { + char *p = (char *)priv + stmmac_mmc[i].stat_offset; + + data[j++] = stmmac_mmc[i].sizeof_stat == sizeof(u64) ? + *(u64 *)p : *(u32 *)p; } + } - /* Only dwmac1000 and dwmac4 implements the MAC .debug() method. - * As there are different version spaces depending on core_type, - * make this conditional on the appropriate core type. - */ - if ((priv->plat->core_type == DWMAC_CORE_GMAC || - priv->plat->core_type == DWMAC_CORE_GMAC4) && - priv->snpsver >= DWMAC_CORE_3_50) - stmmac_mac_debug(priv, priv->ioaddr, - (void *)&priv->xstats, - rx_queues_count, tx_queues_count); + if (priv->dma_cap.eee) { + int val = phylink_get_eee_err(priv->phylink); + if (val) + priv->xstats.phy_eee_wakeup_error_n = val; } + + /* Only dwmac1000 and dwmac4 implements the MAC .debug() method. + * As there are different version spaces depending on core_type, + * make this conditional on the appropriate core type. + */ + if ((priv->plat->core_type == DWMAC_CORE_GMAC || + priv->plat->core_type == DWMAC_CORE_GMAC4) && + priv->snpsver >= DWMAC_CORE_3_50) + stmmac_mac_debug(priv, priv->ioaddr, + (void *)&priv->xstats, + rx_queues_count, tx_queues_count); + for (i = 0; i < STMMAC_STATS_LEN; i++) { char *p = (char *)priv + stmmac_gstrings_stats[i].stat_offset; data[j++] = (stmmac_gstrings_stats[i].sizeof_stat == From patchwork Wed Apr 8 09:27:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 2005 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 2A0A01C008C for ; Wed, 8 Apr 2026 11:45:03 +0200 (CEST) Authentication-Results: mxe881; dkim=fail header.d=armlinux.org.uk; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-22814-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-22814-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 4BCBB3038A58 for ; Wed, 8 Apr 2026 09:43:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8DCFF3ACA64; Wed, 8 Apr 2026 09:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="LWVCNGgR" X-Original-To: linux-sunxi@lists.linux.dev Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 C254F3AE712 for ; Wed, 8 Apr 2026 09:43:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775641421; cv=none; b=tg8Sr0WoX+Y513EiAkbW/xFEwa6Eqpg3xXRD6v1qfXgW/BTWcpaB913gtMZmn9ciLdaCaYUl1Lzai1oDJMOD3JAyDmAPUKbz8On2x9mvlbX0vBoxN4hF8os5hldckqGQAEBNtBRAPFG9vzHJayid+ELPpL4OX0Wz7omXOZZv3Zs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775641421; c=relaxed/simple; bh=c4FPCC64OLY6uQ7rq6bCkd7CNhC0hCmGm+WzJILpnU8=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=Cmuy3si8UC1ECet4ivS4g+8IDZbPftvb+qblUpaQunRQuf3TEZrnlAMKXd/dXa5tfwb//7HR6/QA+rDxLONcbWRum1azxwkg3gKAQTxb3zT6WugOGWP1zF+8t7NcZfKGXSwYYx/VwUTXS0arYikK02tmJZMjc5HHlByqbMljYVQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=LWVCNGgR; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FhdQTZ4PjxdShoN2GRJESKI6NUEw1EHbjw1nk/1gbzU=; b=LWVCNGgRtCTuIthGvixb61A+O8 C2GNvXJWZ6kxkTafqTGqfuUL71asdjM1C2FYgZxL8iRhdtav91LuRpZsj/TXI9qZZBkvHrFk1Vj5i kbivRDeMv+KpkJm01SUtrvuMNbIS0+Q59yHymN4CAfKBoRgix4wOLmcW7+2gZmX5BimGmv+F8PV3t UcIubeLHH3CpwG9f2+lrHiAvC4NNr0YGeCUycptUVkDaa91iXSLScagfulUk1LMfd9H2SE24BsKZI x+b+iwzDfF8xqRZ3f6q7CB7HOycps5zd8x/ajUNl0ypsIUIjcAPyFbE5v2f1MlEVu7IzzR6F+syg1 S+e4yaew==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:33750 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.98.2) (envelope-from ) id 1wAPC8-00000000246-3oVx; Wed, 08 Apr 2026 10:27:33 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1wAPC1-0000000F7kl-15YL; Wed, 08 Apr 2026 10:27:25 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , Chen-Yu Tsai , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jitendra Vegiraju , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, netdev@vger.kernel.org, Paolo Abeni , Samuel Holland Subject: [PATCH RFC net-next 09/10] net: stmmac: clean up test for rx_coe debug printing Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 08 Apr 2026 10:27:25 +0100 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-0.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.234.253.10:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[armlinux.org.uk : SPF not aligned (relaxed),none]; R_DKIM_REJECT(1.00)[armlinux.org.uk:s=pandora-2019]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; PRECEDENCE_BULK(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[netdev]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[sea.lore.kernel.org:rdns,sea.lore.kernel.org:helo,armlinux.org.uk:email]; FORGED_SENDER_MAILLIST(0.00)[]; RCPT_COUNT_TWELVE(0.00)[14]; RCVD_COUNT_FIVE(0.00)[6]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[armlinux.org.uk:-]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[rmk@armlinux.org.uk,linux-sunxi@lists.linux.dev]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-22814-noreply=patchwork.local,kernel]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 2A0A01C008C X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The test for printing rx_coe as opposed to rx_coe_type[12] and rxfifo_over_2048 has checked for an XGMAC core or the Synopssys IP version (snpsver) >= v4.0. Since the Synopsys IP version depends on the core type, avoid using it. The GMAC4 core type uses dwmac4_get_hw_feature(), which populates rx_coe but not rx_coe_type[12] or rxfifo_over_2048. XGMAC is the same but via dwxgmac2_get_hw_feature(). dwmac-motorcomm populates rx_coe but not the others, and sets the core type to GMAC4. The Synopsys IP version is likely >= 4, but in any case printing rx_coe is clearly more correct. Lastly, dwmac-sun8i is an oddball - it sets rx_coe, but does not set core_type, leaving it as the defeault DWMAC_CORE_MAC100 since as far as I can see, none of the .dtsi files for this platform use any of the versioned snps,gmac-* compatibles. Moreover, sun8i_dwmac_setup() sets snpsver to zero (which stmmac_get_version() will have already done) so this has always used the rx_coe_type[12] path. Change the test to check for GMAC4 or XGMAC which covers the cases where rx_coe is set from the core hardware features. Also add a comment for the GMAC to GMAC4+ rx_coe feature translation in stmmac_hw_init(), and document rx_coe in struct plat_stmmacenet_data. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++++++++-- include/linux/stmmac.h | 7 +++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index e47321119c83..93c031b3cfd5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6624,11 +6624,15 @@ static int stmmac_dma_cap_show(struct seq_file *seq, void *v) seq_printf(seq, "\tAV features: %s\n", (priv->dma_cap.av) ? "Y" : "N"); seq_printf(seq, "\tChecksum Offload in TX: %s\n", (priv->dma_cap.tx_coe) ? "Y" : "N"); - if (priv->snpsver >= DWMAC_CORE_4_00 || - priv->plat->core_type == DWMAC_CORE_XGMAC) { + if (dwmac_is_xmac(priv->plat->core_type)) { + /* gmac4, xgmac, and motorcomm populate this. */ seq_printf(seq, "\tIP Checksum Offload in RX: %s\n", (priv->dma_cap.rx_coe) ? "Y" : "N"); } else { + /* only dwmac1000 has these three. sun8i sets rx_coe, but + * sets snpsver to zero and leaves core_Type as MAC100, so + * uses this path. + */ seq_printf(seq, "\tIP Checksum Offload (type1) in RX: %s\n", (priv->dma_cap.rx_coe_type1) ? "Y" : "N"); seq_printf(seq, "\tIP Checksum Offload (type2) in RX: %s\n", @@ -7441,6 +7445,9 @@ static int stmmac_hw_init(struct stmmac_priv *priv) /* In case of GMAC4 rx_coe is from HW cap register. */ priv->plat->rx_coe = priv->dma_cap.rx_coe; + /* GMAC (dwmac1000) has separate bits for the Rx COE type. + * Translate to the GMAC4/XGMAC rx_coe feature code. + */ if (priv->dma_cap.rx_coe_type2) priv->plat->rx_coe = STMMAC_RX_COE_TYPE2; else if (priv->dma_cap.rx_coe_type1) diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 4430b967abde..c80d45de0067 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -256,6 +256,13 @@ struct plat_stmmacenet_data { bool force_sf_dma_mode; bool force_thresh_dma_mode; bool riwt_off; + /* rx_coe: + * for dwmac100, rx_coe does not appear to be defined. + * for dwmac1000, rx_coe takes one of the STMMAC_RX_COE_* constants, + * which will be derived from the RXTYP[12]COE hardware feature bits. + * for dwmac4 and xgmac, rx_coe is a boolean from the RXCOESEL hardware + * feature bit. + */ int rx_coe; int max_speed; int maxmtu; From patchwork Wed Apr 8 09:27:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 2007 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 5EE5E1C008C for ; Wed, 8 Apr 2026 11:46:31 +0200 (CEST) Authentication-Results: mxe881; dkim=fail header.d=armlinux.org.uk; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-22812-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-22812-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 62FE530711A1 for ; Wed, 8 Apr 2026 09:41:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7227D3AF677; Wed, 8 Apr 2026 09:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="KBRtZISk" X-Original-To: linux-sunxi@lists.linux.dev Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 3218B3AE190 for ; Wed, 8 Apr 2026 09:41:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775641302; cv=none; b=czpw+mkM2w4B//7dhxlXv1wts1svYuvIo7hp/+vizmoMGedy5EudfS8cZmQ/iXsBYLWBrS9tbRVWbejSdHhQFuAGnMTtFwt2C9WNyWCCtb9q+PPYX4tpNZ2MVErwCF4vi8uWLpUu691sMInyU/FNAhrB3cdfFbCWE5OVARwCfAs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775641302; c=relaxed/simple; bh=GtatU7a61TbhaghBTwgqAwUFt/P6h7smjsYWzrNbhgE=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=ThJPdENv301fhQlP6rcPvci/lm3pk+n7tmS7eTN0lnf1wFy3P2aUw8a5IPxZDOz+zoCIXvHqXzBlVwgTpY8HUfE+HmdTanYHDYjctMg5efvTm3uIGmDanyMaYao6BhrtfGbVIt3BdfCmuaG4pm7X12HovCNJFA0tAND2vIsZHGQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=KBRtZISk; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ymap6qnTrcZjA2wjOv/aJIypsrfZm0ThDKHwcJw6fQA=; b=KBRtZISkGajYEF77tW0PaVeWQX cPZnzgBxvtuhhdl0AWKtISEgdRk5ygONloyCeyvc7bShsFUU291gw31NnmZThiKumCavoDUxWZ7ht cVFxKfusOkbLHw7diDcG/m/WO3KmVv7Y38vbfzTiDlCH3hIE7MQt+BAIhGaN+SOZknZvPt/nDFVer nX9Wo9T5rTYa1vxaHQ/lmKiB9p4+CfBiZll05OfJ9M7/jxzZGMStDbGxzi0qdRsZw0SJavADbkyRZ OUT8++lqg326oe/ePFqZ6aNhK2gp3lxLY6XKiSo7EBlX3bdqQV2MVuRQa7MzXTkTRzYo9u5SC8NNU w5ecUjoQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36872 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.98.2) (envelope-from ) id 1wAPCB-0000000024F-27WA; Wed, 08 Apr 2026 10:27:35 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1wAPC6-0000000F7kr-1b7i; Wed, 08 Apr 2026 10:27:30 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , Chen-Yu Tsai , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jitendra Vegiraju , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev, netdev@vger.kernel.org, Paolo Abeni , Samuel Holland Subject: [PATCH RFC net-next 10/10] net: stmmac: only print receive COE type for GMAC cores Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 08 Apr 2026 10:27:30 +0100 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-0.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[armlinux.org.uk : SPF not aligned (relaxed),none]; R_DKIM_REJECT(1.00)[armlinux.org.uk:s=pandora-2019]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; PRECEDENCE_BULK(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[netdev]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[armlinux.org.uk:email,tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo]; FORGED_SENDER_MAILLIST(0.00)[]; RCPT_COUNT_TWELVE(0.00)[14]; RCVD_COUNT_FIVE(0.00)[6]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[armlinux.org.uk:-]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; TO_DN_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[rmk@armlinux.org.uk,linux-sunxi@lists.linux.dev]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[bounces-22812-noreply=patchwork.local,kernel]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 5EE5E1C008C X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= As identified in the previous commit, only GMAC cores have a COE type, but priv->snpsver's numberspace is core specific. Change the test for printing this to check the core type instead of checking for the Synopssys IP version being < v4.0, which will incorrectly match XGMAC cores. Signed-off-by: Russell King (Oracle) --- 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 93c031b3cfd5..f5fe97c1abd4 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7461,7 +7461,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv) if (priv->plat->rx_coe) { priv->hw->rx_csum = priv->plat->rx_coe; dev_info(priv->device, "RX Checksum Offload Engine supported\n"); - if (priv->snpsver < DWMAC_CORE_4_00) + if (priv->plat->core_type == DWMAC_CORE_GMAC) dev_info(priv->device, "COE Type %d\n", priv->hw->rx_csum); } if (priv->plat->tx_coe)