From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.177 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== 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== 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 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 ; Mon, 30 Nov 2026 07:45:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 494F5606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com 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 Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2f052ae3c86so54521865ad.1 for ; Sun, 29 Nov 2026 23:45:50 -0800 (PST) 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) 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) From: Zxyan Zhu To: maxime.chevallier@bootlin.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, netdev-bot+sashiko@kernel.org 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 Subject: Re: [PATCH net-next v6] net: stmmac: program the FSM timeout timer Date: Mon, 30 Nov 2026 15:45:42 +0800 Message-Id: <20261130074542.3632073-1-zxyan0222@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <179578083166.3135.13505754138480842888@kernel.org> References: <179578083166.3135.13505754138480842888@kernel.org> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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