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 176DA51E456; Wed, 30 Sep 2026 18:33:18 +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=1790793199; cv=none; b=eMP3nY724vZQGyThSKUlowk8HTp8KcZZ8OW5A7TI1F63/a3IccLDyNJJM/lm47D2/yjgfJawFSVjERhVrehHhwlZMH5H0UitIJdelQZsPKByO+nXvDfzerPxW1tmMEELMPDdSzh3tTRvUzN7bFl4R66yRVgXBqDfxepcA0yaeHM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790793199; c=relaxed/simple; bh=vPKqfRpPVhrHdIp/TCEhOxXZ9K36bLqfk1i7Vxgfc1E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LMrKBddxucGNtcO2j80Qu5EQfajNu84ysGghTEN77cW7GIv0BjsA4zAtiIN8tcUeN/MYk/ytRY0I2OcLxFAuQHfn7neoCeER+v+Gxra10fOcJZdd9xkaDCuE8GihFbb9QfwgpVWqZrzzWWWtIE2OihI7xwP7I9jnqbcffOOJd00= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZAow8Bz6; 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="ZAow8Bz6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B09A1F000FF; Wed, 30 Sep 2026 18:33:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790793198; bh=Dhs2kGGLz/+EvQ03DCq4Tx3L0G+G/NPTcB+OUBpFXYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZAow8Bz6Vmtt7wT+lk9RyjLX/zE6nSscNZq2sxqA3F+6A9+K3Jd3m0NU63UH3OnYs IzzooitaJg2j44tVhKEnWAX8yUOGULwuNUr8FeccmNrKIU38+ov6gzS2x+hut+1vK2 3OUmCGiZUQtP2sIlfiBIDuR8or4ylqlWRMlZfbgw= 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.18 168/395] net: bcmgenet: mask DMA_TIMEOUT_MASK when reading DMA_RING0_TIMEOUT Date: Wed, 30 Sep 2026 17:27:10 +0200 Message-ID: <20260930152344.295332981@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152340.591469096@linuxfoundation.org> References: <20260930152340.591469096@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Fainelli [ Upstream commit d64e277b955be4506931802837499b62c8f3968a ] bcmgenet_get_coalesce() reads DMA_RING0_TIMEOUT to calculate rx_coalesce_usecs without masking out bits outside DMA_TIMEOUT_MASK (16 bits). If upper bits are non-zero or contain status/flags, the computed value of rx_coalesce_usecs returned to userspace via ethtool becomes corrupted. Mask the register read with DMA_TIMEOUT_MASK before computing the timeout in microseconds. Fixes: 4a29645bfe6c ("net: bcmgenet: Implement RX coalescing control knobs") Reviewed-by: Nicolai Buchwitz Signed-off-by: Florian Fainelli Link: https://patch.msgid.link/20260921220021.281418-6-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index c18702f3dd766..a72e136fd9c38 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -853,7 +853,8 @@ static int bcmgenet_get_coalesce(struct net_device *dev, ec->rx_max_coalesced_frames = bcmgenet_rdma_ring_readl(priv, 0, DMA_MBUF_DONE_THRESH); ec->rx_coalesce_usecs = - bcmgenet_rdma_readl(priv, DMA_RING0_TIMEOUT) * 8192 / 1000; + (bcmgenet_rdma_readl(priv, DMA_RING0_TIMEOUT) & + DMA_TIMEOUT_MASK) * 8192 / 1000; for (i = 0; i <= priv->hw_params->rx_queues; i++) { ring = &priv->rx_rings[i]; -- 2.53.0