Netdev List
 help / color / mirror / Atom feed
From: Zxyan Zhu <zxyan0222@gmail.com>
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 <zxyan0222@gmail.com>
Subject: Re: [PATCH net-next v6] net: stmmac: program the FSM timeout timer
Date: Mon, 30 Nov 2026 15:45:42 +0800	[thread overview]
Message-ID: <20261130074542.3632073-1-zxyan0222@gmail.com> (raw)
In-Reply-To: <179578083166.3135.13505754138480842888@kernel.org>

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

  reply	other threads:[~2026-11-30  7:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 11:59 [PATCH net-next v6] net: stmmac: program the FSM timeout timer Zxyan Zhu
2026-11-27 12:00 ` netdev-bot+sashiko
2026-11-30  7:45   ` Zxyan Zhu [this message]
2026-12-03  4:40 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130074542.3632073-1-zxyan0222@gmail.com \
    --to=zxyan0222@gmail.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox