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",