🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24467

Re: [PATCH net-next v6] net: stmmac: program the FSM timeout timer

#24467
From: Zxyan Zhu
Date: Mon, 30 Nov 2026 07:45
37 lines
12641 bytes
On the High point (csr_clk_mhz == 0):

> What happens on platforms that request tmouten but have no stmmac_clk,
> or whose stmmac_clk runs below 1 MHz? In that case csr_clk_mhz stays 0.

Nothing changes for those platforms: NTMRMD is left at 0, exactly as it is
today, so the checker stays disabled there and the patch is a strict
improvement (it arms the timer where a CSR clock is available and is a
no-op elsewhere). Falling back to plat->clk_csr is not viable because
clk_csr is a frequency *band* index (STMMAC_CSR_250_300M and friends), not
a rate, so it cannot produce the exact TMR value (CSR clocks per 1us).
Leaving TMOUTEN off when the clock is missing would be a behavioural change
for platforms that already request it, which is worse than the status quo;
Maxime already agreed that ASP without a CSR clock is legitimate (e.g. the
GMAC5 PCI device). The separate observation that stmmac_clk is not always
the CSR clock is theoretical -- as the review notes, no in-tree platform
hits it (Intel has tmouten = 0 and no XGMAC).

On the Medium point (4s timeout and the resulting reset):

A safety timeout is an uncorrectable error by design, so the full reset via
stmmac_global_err() is the existing intended safety response, not something
this patch adds; "reported" in the commit message refers to the safety
interrupt now firing. The 4s value was chosen to exceed a single
maximum-quanta PAUSE frame (~3.36s at 10 Mb/s) with margin. Whether
back-to-back PAUSE frames keep the FSM "active" and thereby suppress the
timeout is undocumented hardware behaviour that cannot be confirmed from
the databook, so longer encodings only shift the threshold and add
detection latency. 4s was acked by Maxime.

The XGMAC side programs the timer whenever csr_clk_mhz is non-zero, without
checking tmouten; that matches how dwxgmac3_safety_feat_config() already
sets XGMAC_PRTYEN and XGMAC_TMOUTEN unconditionally.

Regards,
Zxyan
Technical Details
Message-ID: <20261130074542.3632073-1-zxyan0222@gmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373988-linux-kernel-netdev=dewy.ru
References: <179578083166.3135.13505754138480842888@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373988-linux-kernel-netdev=dewy.ru
From: zxyan0222@gmail.com (Zxyan Zhu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v6] net: stmmac: program the FSM timeout timer
Date: Mon, 30 Nov 2026 15:45:42 +0800
Organization: Usenet Network
Message-ID: <20261130074542.3632073-1-zxyan0222@gmail.com>
References: <179578083166.3135.13505754138480842888@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1368153"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:+IRgl0hYQYtVcDz3LcGl9im4CFU= sha256:iHBFiwG1aCtKeQKaCNaiUPEFZbECz1KRQ1z3cAjVmIk=
	sha1:XogP+zXLDFFQRbkD8PWEEnrHzMc= sha256:5pp4mMO3GoZTL5sTKIFF4BRmkQu38WkE49pJt9a7z3Q=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 5CB54125FC5; Mon, 30 Nov 2026 10:46:07 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id eYIAXoFiDebM;
	Mon, 30 Nov 2026 10:46:04 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-373988-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 43E57125FC8; Mon, 30 Nov 2026 10:45:55 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id A0EC1219E4; Mon, 30 Nov 2026 07:45:52 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796024751;
	b=VqlBclOuATvICId+Bf7NaYQ19fw+yMAeu7WdeDxCTFrVmnt4ZT/usI5n9zuM7At0F7S1
	 632V5mOLVoIBbb2dk0zEZjEpxIhrM19OicyPaC/wnu56vCSPQ/DfUVafHI54Nh5S5BHGU
	 fFC661Out8e5s6A71SWSREwvq8LHjn3iJIl8WI/WSmtKhwhuVMLZPtlA9noYweKptrADB
	 fFz9UUc93OpP5LjBU3uIk0p7p+ZSW++WMVs6eCTon4r98WhLf5BCzOzxS747jN+wRzg1o
	 oXJ3JrsMUy/2RXbPmJX8zNO6HHd8JHJ8MCGZ4rse/2IDJC/URx7zlDRXLlGM1Xwy7Ww==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796024751;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=FoglpP+VbTkm9x6o2wjqN2zRl4XhlKdCxiDEzEMwVgk=;
	b=zpreOVM3aqxIzfiQosz+MlCnOnPHYWXPQeMoNWkQu8otYpKvii2p2d+DDnhzDeLpRm+U
	 l0CgKb/Ms9/IHnigi0vhQ07VLxoxPBR5MmP1SMomVvCkivZpoIRysZfPLCYNjijLRw3cy
	 2DSRUxpq5fH/nopwz/xntILyJ9qPvcPnYEyBzfya1Emh7cnGhV+j2p98SKCVWn2gTvYvT
	 5/XDkSueRNPFJ9F6PIvAiQJxoJuX/6Q2UHDnOVhtLPWp27k4RlxNzQ+DNZn4ZHSJdg416
	 ZtYu+OXU/Q6Gpo/94kNDJw/CdU9+Xe7EWN16dk6LV4EtbiQWvkIjtTb3XeAIl24N7/A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=xZvpPmpK;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id C8EFD606A335;
	Mon, 30 Nov 2026 07:45:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=xZvpPmpK
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.177
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796024751;
	b=5mcDUb0K/XmGrB9xhFM9pYsnBhoMJk1URuhoooMxmo6pS+9YTsH3obdxtNOYDlKALmgw
	 LDp4CC90tKq1GHiejtC2A2G0YF1KwjZ8NMoaqgt6V/ja4ZP7iaxkaVLiGPDzYFJQuJLWC
	 mCZYVC9u8XYf+qidklaCsSe2iO9uJGkLztNpzJ4SjQPrn4c/ZUd8Sx5F8eS1hz2gCIvYU
	 /eqJQ4OS3F3GFKzuQBUKIYtXf8KBMPnLc8rqvtXYxP3c+7g+yi7TjM4G1G1L69Gr1fyik
	 7115VbQYL0lSRiLKs0JkSA/tpCcEAz69R5UXGnp0HdCnlL0jfNgNVu+327uNQgVDA4w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796024751;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-Id:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=FoglpP+VbTkm9x6o2wjqN2zRl4XhlKdCxiDEzEMwVgk=;
	b=0810RSJuLuE56aN0HUr2TrYy9E8OFmx28+nPEYbmiD/3SWao/Aq0EO2Pw7pjQ8Smgeni
	 sdQcKepOV3mqkN5fuTRsnQH94cRcTM+8trfuTzz5ojmsaem/RgJzzOZee5WWy20cWtVJV
	 ll8yyr3jG2j2hI0PVQQbs90DCYEOIeYMZeb4efH47ls6pC+Ml792hAJa4JdYGT5RA7hu1
	 gSNXJoebED9/HanlY5nZGSWBR3ubFl59xT0/t2+VG4TOBZTUaF/u8nOUO+c9fXtiHIdgv
	 sUAr+StPmmlr92zz/FWqI17l9idvmlFWBUDk1bi2OT39e2X6USFEa3JcTt/dC8wW9PQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=xZvpPmpK;
	arc=none smtp.remote-ip=209.85.214.177
X-Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 494F5606A31C
	for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 07:45:50 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 494F5606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2f052ae3c86so54521865ad.1
        for <netdev@vger.kernel.org>; Sun, 29 Nov 2026 23:45:50 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796024749; x=1796629549; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=FoglpP+VbTkm9x6o2wjqN2zRl4XhlKdCxiDEzEMwVgk=;
        b=xZvpPmpKe3Y7MBfH7qqBnP7jWOoHg+CNxxL2tQRG4fjbQJLwbcWCdyAnJgBP6Zaz8h
         TfzwpLGtl4OMnnX8cZGzTHzxHOOCHJ4qGwH198qw44XUMTvd30j/CjPr/cuj2L31RXgn
         w2eFCz/52vq01dwJwHrIiTbrOXBzndQ/u0vE39oE4mzX5JLtr9KO1/o0SraNfLC8iPP0
         ud1krpfJ4v9yysmLhNlenDdXummDCcFSUfFJ+eTImsmsjJLXkG+nO25WYcxQ+EilnzTi
         Erl6NVfLu+YKx3NtBwT/xhytL6dwE2XLwSEdd4ktrsXHxsL7glsL5HJlzwbycN+MR+g2
         iShA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796024749; x=1796629549;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=FoglpP+VbTkm9x6o2wjqN2zRl4XhlKdCxiDEzEMwVgk=;
        b=d3shifycYGwJTjd8uuAKI+G5JIarWfGK4Me/bvF21T2rcV7DoHaQARWwslmUDm3U5D
         Uij/qlllKvjzEPNttz64p5QIPXydFbMTwTQHqXVo5520HgVz2/cRnbPg8iJN7F4ebXMx
         xvZxauoDCQ8QTsiqqdV9E71IVIKMzIJowwylPpQ6vZw6jJ/wFVLIfrqVacp4nRtw88Z6
         ihX1e0OvAsIt7d1fhWTF5O+YGyUvUp4bLIJPoL7tY38Uaez4OirbZYmnF7UKufPCLD/2
         OTtdC7BqhaNXp6UTYApYYhrcbdud/TA5eKiU3hrHVeD70Uuj8Uqlv0Qg7P0DlqLwzgZO
         8gAg==
X-Gm-Message-State: APuU4Z/HxrEnXyr7nSp3LRtCGXb5KqX2j14+NiHevy5G04hc2PscSg1q
	HGPf4SPERwMJolAKwaIG7s/PiSpHbrPPV74Zj8/19Ghv3ZyErIxr3oM/
X-Gm-Gg: AZFdTZeM7C0rhJCy5NzOicilNWhWLBshWkWCXvn8PNqb5iSYU0wburVOZ4N1hnfWvWM
	XiReLdtUOWd5CUgdDYQ3nYb2Zjl56srKho8KCc+wP30sZlzRvyfIOaumvNVmhEb8AtmxKI2gifG
	ojS8iDOODYH2jz5rGWbtLz/wfV5LoYXPedGK+BNsB+bFeteiSTg+P/haDXxB3Oe7M1o44c2ZT2i
	k8sce19t/vqoYxACS1F8fV7pZS+lHAfZ6j05uCtjnTwqmpWwldn4UMCoz73nyfLGCel2hDkMQu3
	NItCmLvUulVjaoDJNXaoxsncBmI6MYz0KzcIrf9Xw5aBxMr+Db4bsFgc5U0vXBBKnTBTkbj7lSO
	cMqbDGsJEJpFVWSmy9sYPj57W/0sKrRzspQOJD4mi1JvYowKaDeGL/N8OIqCdihxXZr7rCDirop
	Co4aDumCGfaUlpJjsrQ2x2YbcSdfHyntQ/MjkWKC14Bec4bm/7slurt4EM7vGLwDoIiHtVqwC8f
	M+dTYfr/HaNeH07virDLQjupXazEtJRQmINFPTUJIuvxZnl/md7rYWMPNWLBXd2RDxritCN+YBS
	WWtGoJXWksM3/uUoFRSLB5PziX+lTjEAD1wkgzGS55yYWu/wAQ==
X-Received: by 2002:a17:902:cf08:b0:2f0:59dd:4d07 with SMTP id d9443c01a7336-2f059dd50f7mr307942855ad.38.1796024749495;
        Sun, 29 Nov 2026 23:45:49 -0800 (PST)
X-Received: from server227.. ([39.170.101.209])
        by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f0667679d8sm143284175ad.48.2026.11.29.23.45.45
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Sun, 29 Nov 2026 23:45:49 -0800 (PST)
X-Cc: netdev@vger.kernel.org,
	mcoquelin.stm32@gmail.com,
	alexandre.torgue@foss.st.com,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	rmk+kernel@armlinux.org.uk,
	Zxyan Zhu <zxyan0222@gmail.com>
X-Mailer: git-send-email 2.34.1
X-In-Reply-To: <179578083166.3135.13505754138480842888@kernel.org>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list