From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 82A173254B3; Tue, 13 Oct 2026 12:34:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791894855; cv=none; b=PFQ5T1eTtFakregxVhZny/bOn/BqCRdaw7GfCyaTbuTsSRXNi9/nReEdvUWqYEWHWxcWFyl8i1roWFxzpv1pdTKi5dsOfUHnm3sjvszuy9knm1TjDc+qeF8X0XZkaz/KPC+Sx0KSV+O3PgCAkVWiFHBC8w6GoxxasbNhaNcD6KQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791894855; c=relaxed/simple; bh=N8061sFkC1fovZk79BuZ+z/dCSVr2wwZW/mzUDIYTxg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YtmKBAquvKFM80Vjor95dQFHEUrj6zKH/n2GIm05PsQEoWjo8Ry3tvHeNuAOcJII2mo+REkjrbwqitT9A1GaWXYX2pB0LULNdyoEzAi/MsGmcT3fiIBEnQ35dk0zLjvQJIql8mD5Qfrq4V2WDfcis7OtO+y5L3mFkx9qoG8qge0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VwDKax+N; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="VwDKax+N" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D76841F000FF; Tue, 13 Oct 2026 12:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791894854; bh=/a4lsTKiWKlHs1gBEb+aiDROJPuZ0nAyi0X5fcqtkWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VwDKax+Nmv1MDxG4roZaVEEKeLXxvguVyFOdaAyMh/5ymdVEgGYcRB6Eo0yZJJn3b n8bw5YTB6kFaERJ9V8EdxGq89CYY4h51ikfndDve9JuR/e+q8hwZOaCtOIYCKIAXg2 7Mh6V2T1llyRBSCRlJHXA517OqYpeEMBFnqMDqE0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nicolai Buchwitz , Florian Fainelli , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 077/497] net: systemport: Fix RUNT MIB counter register offset calculation Date: Tue, 13 Oct 2026 13:34:04 +0200 Message-ID: <20261013112909.714633377@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013112907.864180619@linuxfoundation.org> References: <20261013112907.864180619@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Fainelli [ Upstream commit 242935adfeb096f09b29fb2cfcf12f9eb2911fc6 ] In UniMAC hardware, there is a 0xC byte gap between the RX MIB counters and the TX MIB counters, and a second 0xC byte gap between the TX MIB counters and the RX RUNT MIB counters. In bcm_sysport_update_mib_counters(), 'offset' was only set to UMAC_MIB_STAT_OFFSET (0xC) for all non-RX counters, omitting the second 0xC gap for BCM_SYSPORT_STAT_RUNT counters. As a result, all 4 RUNT MIB counters were read from unmapped gap register space. Fix this by setting offset to 2 * UMAC_MIB_STAT_OFFSET (0x18) when reading BCM_SYSPORT_STAT_RUNT counters. Fixes: 80105befdb4b ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver") Reviewed-by: Nicolai Buchwitz Signed-off-by: Florian Fainelli Link: https://patch.msgid.link/20260922232440.598918-6-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bcmsysport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index c0af40cdfd165..2cb3693080744 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c @@ -425,8 +425,10 @@ static void bcm_sysport_update_mib_counters(struct bcm_sysport_priv *priv) if (priv->is_lite) continue; - if (s->type != BCM_SYSPORT_STAT_MIB_RX) + if (s->type == BCM_SYSPORT_STAT_MIB_TX) offset = UMAC_MIB_STAT_OFFSET; + else if (s->type == BCM_SYSPORT_STAT_RUNT) + offset = 2 * UMAC_MIB_STAT_OFFSET; val = umac_readl(priv, UMAC_MIB_START + j + offset); break; case BCM_SYSPORT_STAT_RXCHK: -- 2.53.0