* [PATCH net-next v4] net: stmmac: program the FSM timeout timer
@ 2026-11-18 2:55 Zxyan Zhu
2026-11-20 21:17 ` netdev-bot+sashiko
0 siblings, 1 reply; 2+ messages in thread
From: Zxyan Zhu @ 2026-11-18 2:55 UTC (permalink / raw)
To: maxime.chevallier, andrew+netdev, davem, edumazet, kuba, pabeni
Cc: netdev, mcoquelin.stm32, alexandre.torgue, linux-stm32,
linux-arm-kernel, linux-kernel, rmk+kernel, Zxyan Zhu
stmmac enables the FSM timeout checker (TMOUTEN) but never programs the
MAC_FSM_ACT_Timer register. Per the databook the checker only fires once
NTMRMD is programmed with a non-zero duration; NTMRMD == 0 disables the
timer, so with TMOUTEN set but the timer left at reset a stuck FSM is
never reported and the advertised timeout protection is ineffective.
Program MAC_FSM_ACT_Timer right after TMOUTEN is enabled, deriving the
TMR field (CSR clocks per 1us tic) from the CSR clock rate and using a
1s timeout.
The NTMRMD field holds a power-of-two microsecond timeout per the
databook: 0x0 disables it, and 0x1..0xa encode 1us, 1.024ms (~1ms),
16.384ms (~16ms), 65.536ms (~64ms), 262.144ms (~256ms), 1.048s (~1s),
4.194s (~4s), 16.777s (~16s), 33.554s (~32s), 67.108s (~64s).
The issue was hit in testing on dwmac4 and dwxgmac, where a stuck FSM was
not reported through the safety interrupt despite TMOUTEN being set.
Signed-off-by: Zxyan Zhu <zxyan0222@gmail.com>
---
v4:
- Drop the warning on a missing CSR clock.
- Drop the ntmrmd field and hardcode the 1s timeout (NTMRMD = 0x6).
v3: https://lore.kernel.org/netdev/20261116114923.1157920-1-zxyan0222@gmail.com/
v2: https://lore.kernel.org/netdev/20261112053321.1103678-1-zxyan0222@gmail.com/
v1: https://lore.kernel.org/netdev/20261111143322.2234321-1-zxyan0222@gmail.com/
drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 17 ++++++++++++++++-
drivers/net/ethernet/stmicro/stmmac/dwmac5.h | 6 +++++-
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 3 +++
.../ethernet/stmicro/stmmac/dwxgmac2_core.c | 18 +++++++++++++++++-
drivers/net/ethernet/stmicro/stmmac/hwif.h | 3 ++-
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 8 +++++++-
include/linux/stmmac.h | 12 ++++++++++++
7 files changed, 62 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c
index f1bb981cab7c..5cf5139f442a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c
@@ -2,6 +2,7 @@
// Copyright (c) 2017 Synopsys, Inc. and/or its affiliates.
// stmmac Support for 5.xx Ethernet QoS cores
+#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/iopoll.h>
#include "common.h"
@@ -184,7 +185,8 @@ static void dwmac5_handle_dma_err(struct net_device *ndev,
}
int dwmac5_safety_feat_config(void __iomem *ioaddr, unsigned int asp,
- struct stmmac_safety_feature_cfg *safety_feat_cfg)
+ struct stmmac_safety_feature_cfg *safety_feat_cfg,
+ unsigned int csr_clk_mhz)
{
struct stmmac_safety_feature_cfg all_safety_feats = {
.tsoee = 1,
@@ -245,6 +247,19 @@ int dwmac5_safety_feat_config(void __iomem *ioaddr, unsigned int asp,
value |= TMOUTEN; /* FSM Timeout Feature */
writel(value, ioaddr + MAC_FSM_CONTROL);
+ /* Program the FSM active timer so the timeout checker actually fires.
+ * TMR is the number of CSR clocks per 1us tic, i.e. csr_clk in MHz.
+ * Use a 1s timeout.
+ */
+ if (safety_feat_cfg->tmouten && csr_clk_mhz) {
+ value = readl(ioaddr + MAC_FSM_ACT_TIMER);
+ value &= ~(MAC_FSM_ACT_TIMER_NTMRMD | MAC_FSM_ACT_TIMER_TMR);
+ value |= FIELD_PREP(MAC_FSM_ACT_TIMER_NTMRMD,
+ STMMAC_NTMRMD_1SEC) |
+ FIELD_PREP(MAC_FSM_ACT_TIMER_TMR, csr_clk_mhz);
+ writel(value, ioaddr + MAC_FSM_ACT_TIMER);
+ }
+
/* 4. Enable Data Parity Protection */
value = readl(ioaddr + MTL_DPP_CONTROL);
if (safety_feat_cfg->edpp)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.h b/drivers/net/ethernet/stmicro/stmmac/dwmac5.h
index 00b151b3b688..734e7630f28d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.h
@@ -8,8 +8,11 @@
#define MAC_DPP_FSM_INT_STATUS 0x00000140
#define MAC_AXI_SLV_DPE_ADDR_STATUS 0x00000144
#define MAC_FSM_CONTROL 0x00000148
+#define MAC_FSM_ACT_TIMER 0x0000014C
#define PRTYEN BIT(1)
#define TMOUTEN BIT(0)
+#define MAC_FSM_ACT_TIMER_TMR GENMASK(9, 0)
+#define MAC_FSM_ACT_TIMER_NTMRMD GENMASK(19, 16)
#define MAC_PPS_CONTROL 0x00000b70
#define PPS_MAXIDX(x) ((((x) + 1) * 8) - 1)
@@ -82,7 +85,8 @@
#define GMAC_INT_FPE_EN BIT(17)
int dwmac5_safety_feat_config(void __iomem *ioaddr, unsigned int asp,
- struct stmmac_safety_feature_cfg *safety_cfg);
+ struct stmmac_safety_feature_cfg *safety_cfg,
+ unsigned int csr_clk_mhz);
int dwmac5_safety_feat_irq_status(struct net_device *ndev,
void __iomem *ioaddr, unsigned int asp,
struct stmmac_safety_stats *stats);
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
index f8ab347f7b5b..1fd501728b18 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
@@ -169,8 +169,11 @@
#define XGMAC_HWFEAT_PCSEL GENMASK(1, 0)
#define XGMAC_MAC_DPP_FSM_INT_STATUS 0x00000150
#define XGMAC_MAC_FSM_CONTROL 0x00000158
+#define XGMAC_MAC_FSM_ACT_TIMER 0x0000015C
#define XGMAC_PRTYEN BIT(1)
#define XGMAC_TMOUTEN BIT(0)
+#define XGMAC_MAC_FSM_ACT_TIMER_TMR GENMASK(9, 0)
+#define XGMAC_MAC_FSM_ACT_TIMER_NTMRMD GENMASK(19, 16)
#define XGMAC_MDIO_ADDR 0x00000200
#define XGMAC_MDIO_DATA 0x00000204
#define XGMAC_MDIO_C22P 0x00000220
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
index 7ad08651675e..3caab23527a1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
@@ -4,6 +4,7 @@
* stmmac XGMAC support.
*/
+#include <linux/bitfield.h>
#include <linux/bitrev.h>
#include <linux/crc32.h>
#include <linux/iopoll.h>
@@ -837,7 +838,8 @@ static void dwxgmac3_handle_dma_err(struct net_device *ndev,
static int
dwxgmac3_safety_feat_config(void __iomem *ioaddr, unsigned int asp,
- struct stmmac_safety_feature_cfg *safety_cfg)
+ struct stmmac_safety_feature_cfg *safety_cfg,
+ unsigned int csr_clk_mhz)
{
u32 value;
@@ -873,6 +875,20 @@ dwxgmac3_safety_feat_config(void __iomem *ioaddr, unsigned int asp,
value |= XGMAC_TMOUTEN; /* FSM Timeout Feature */
writel(value, ioaddr + XGMAC_MAC_FSM_CONTROL);
+ /* Program the FSM active timer so the timeout checker actually fires.
+ * TMR is the number of CSR clocks per 1us tic, i.e. csr_clk in MHz.
+ * Use a 1s timeout.
+ */
+ if (safety_cfg && safety_cfg->tmouten && csr_clk_mhz) {
+ value = readl(ioaddr + XGMAC_MAC_FSM_ACT_TIMER);
+ value &= ~(XGMAC_MAC_FSM_ACT_TIMER_NTMRMD |
+ XGMAC_MAC_FSM_ACT_TIMER_TMR);
+ value |= FIELD_PREP(XGMAC_MAC_FSM_ACT_TIMER_NTMRMD,
+ STMMAC_NTMRMD_1SEC) |
+ FIELD_PREP(XGMAC_MAC_FSM_ACT_TIMER_TMR, csr_clk_mhz);
+ writel(value, ioaddr + XGMAC_MAC_FSM_ACT_TIMER);
+ }
+
/* 5. Enable Data Path Parity Protection */
value = readl(ioaddr + XGMAC_MTL_DPP_CONTROL);
/* already enabled by default, explicit enable it again */
diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h
index 8ae95e91a36a..395655b01ea8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/hwif.h
+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h
@@ -378,7 +378,8 @@ struct stmmac_ops {
bool srgmi_ral);
/* Safety Features */
int (*safety_feat_config)(void __iomem *ioaddr, unsigned int asp,
- struct stmmac_safety_feature_cfg *safety_cfg);
+ struct stmmac_safety_feature_cfg *safety_cfg,
+ unsigned int csr_clk_mhz);
int (*safety_feat_irq_status)(struct net_device *ndev,
void __iomem *ioaddr, unsigned int asp,
struct stmmac_safety_stats *stats);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 4da728962638..5e5c54b58bee 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3691,10 +3691,16 @@ static void stmmac_mtl_configuration(struct stmmac_priv *priv)
static void stmmac_safety_feat_configuration(struct stmmac_priv *priv)
{
+ unsigned int csr_clk_mhz = 0;
+
if (priv->dma_cap.asp) {
netdev_info(priv->dev, "Enabling Safety Features\n");
+ if (priv->plat->stmmac_clk)
+ csr_clk_mhz = clk_get_rate(priv->plat->stmmac_clk) /
+ 1000000;
stmmac_safety_feat_config(priv, priv->ioaddr, priv->dma_cap.asp,
- priv->plat->safety_feat_cfg);
+ priv->plat->safety_feat_cfg,
+ csr_clk_mhz);
} else {
netdev_info(priv->dev, "No Safety Features support found\n");
}
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 00be2df63d22..659f5db528d3 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -170,6 +170,18 @@ struct stmmac_safety_feature_cfg {
u32 tmouten;
};
+/* MAC_FSM_ACT_Timer.NTMRMD timeout durations */
+#define STMMAC_NTMRMD_1US 0x1
+#define STMMAC_NTMRMD_1MS 0x2
+#define STMMAC_NTMRMD_16MS 0x3
+#define STMMAC_NTMRMD_64MS 0x4
+#define STMMAC_NTMRMD_256MS 0x5
+#define STMMAC_NTMRMD_1SEC 0x6
+#define STMMAC_NTMRMD_4SEC 0x7
+#define STMMAC_NTMRMD_16SEC 0x8
+#define STMMAC_NTMRMD_32SEC 0x9
+#define STMMAC_NTMRMD_64SEC 0xa
+
/* Addresses that may be customized by a platform */
struct dwmac4_addrs {
u32 dma_chan;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net-next v4] net: stmmac: program the FSM timeout timer
2026-11-18 2:55 [PATCH net-next v4] net: stmmac: program the FSM timeout timer Zxyan Zhu
@ 2026-11-20 21:17 ` netdev-bot+sashiko
0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sashiko @ 2026-11-20 21:17 UTC (permalink / raw)
To: zxyan0222
Cc: maxime.chevallier, andrew+netdev, davem, edumazet, kuba, pabeni,
netdev, mcoquelin.stm32, alexandre.torgue, linux-stm32,
linux-arm-kernel, linux-kernel, rmk+kernel
Thank you for your contribution! Sashiko AI review found 6 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 2 · Low: 3
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] On every in-tree XGMAC platform, the XGMAC half of the fix never
runs.
- [Medium] csr_clk_mhz is only computed when priv->plat->stmmac_clk is
non-NULL.
- [Medium] The patch turns on an FSM timeout check that resets the
interface, with a hardcoded NTMRMD = 0x6 (about 1 s) for every…
- [Low] The commit is written as a bug fix: the protection is
'ineffective' and a stuck FSM 'was not reported through the safety…
- [Low] The patch adds ten STMMAC_NTMRMD_* register-encoding macros (1US
.. 64SEC) to include/linux/stmmac.h, the platform-data header shared…
- [Low] The same clock (stmmac_clk) is converted into a 'CSR clocks per
1us tic' register value in two places that use different conventions.
--
net: stmmac: program the FSM timeout timer
This patch programs MAC_FSM_ACT_Timer on dwmac5 and dwxgmac3 cores after
TMOUTEN is enabled. TMR is set from the CSR clock rate in MHz, and NTMRMD
is set to a fixed 1s timeout. A csr_clk_mhz argument is added to the
safety_feat_config callback, and NTMRMD encoding macros are added to
include/linux/stmmac.h.
> The issue was hit in testing on dwmac4 and dwxgmac, where a stuck FSM was
> not reported through the safety interrupt despite TMOUTEN being set.
>
> Signed-off-by: Zxyan Zhu <zxyan0222@gmail.com>
[Severity: Low]
This describes a user-visible functional failure, but there is no Fixes:
tag. Should this carry Fixes: tags for the commits that added TMOUTEN to
dwmac5_safety_feat_config() and dwxgmac3_safety_feat_config() without
programming the timer, so stable has a reference for backporting?
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c
> index f1bb981cab7cd..5cf5139f442ad 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c
[ ... ]
> @@ -245,6 +247,19 @@ int dwmac5_safety_feat_config(void __iomem *ioaddr, unsigned int asp,
> value |= TMOUTEN; /* FSM Timeout Feature */
> writel(value, ioaddr + MAC_FSM_CONTROL);
>
> + /* Program the FSM active timer so the timeout checker actually fires.
> + * TMR is the number of CSR clocks per 1us tic, i.e. csr_clk in MHz.
> + * Use a 1s timeout.
> + */
> + if (safety_feat_cfg->tmouten && csr_clk_mhz) {
> + value = readl(ioaddr + MAC_FSM_ACT_TIMER);
> + value &= ~(MAC_FSM_ACT_TIMER_NTMRMD | MAC_FSM_ACT_TIMER_TMR);
> + value |= FIELD_PREP(MAC_FSM_ACT_TIMER_NTMRMD,
> + STMMAC_NTMRMD_1SEC) |
[Severity: Medium]
Is a fixed 1s timeout long enough at every link speed? A link partner can
send PAUSE frames with a quanta of 0xffff. At 10Mb/s that holds off the
transmitter for:
65535 * 512 / 10e6 ~= 3.36s
That is longer than the ~1.048s selected here. At 100Mb/s it is around
335ms.
If the TX FSM timeout is measured against NTMRMD during a flow-control
stall, could a legitimate PAUSE stall at 10Mb/s raise a timeout error?
FSM timeout errors arrive through MCSIS, and
dwmac5_safety_feat_irq_status() always treats them as uncorrectable:
err = (mtl & MCSIS) || (dma & MCSIS);
corr = false;
That would go through stmmac_safety_feat_interrupt()->stmmac_global_err()
and reset the interface. Before this patch the timer was disabled, so this
path could not trigger. dwxgmac3_safety_feat_config() uses the same fixed
value.
Only NTMRMD and TMR are written here. The other fields of
MAC_FSM_ACT_Timer stay at their read-back values. Can the databook confirm
whether pause-stalled TX FSMs are covered by NTMRMD rather than by a
separate large-mode timeout?
> + FIELD_PREP(MAC_FSM_ACT_TIMER_TMR, csr_clk_mhz);
[Severity: Low]
The comment says TMR is csr_clk in MHz. However, dwmac4_core_init()
programs the existing 1us tic counter from the same clock with a minus
one:
writel((clk_rate / 1000000) - 1,
ioaddr + GMAC4_MAC_ONEUS_TIC_COUNTER);
Does TMR use the same minus-one encoding? If it does, each tic would be
one CSR clock too long. If it doesn't, could the comment say why it
differs from GMAC4_MAC_ONEUS_TIC_COUNTER? The same question applies to
the XGMAC_MAC_FSM_ACT_TIMER_TMR write in dwxgmac3_safety_feat_config().
> + writel(value, ioaddr + MAC_FSM_ACT_TIMER);
> + }
> +
[ ... ]
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> index 7ad08651675e8..3caab23527a19 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
[ ... ]
> @@ -873,6 +875,20 @@ dwxgmac3_safety_feat_config(void __iomem *ioaddr, unsigned int asp,
> value |= XGMAC_TMOUTEN; /* FSM Timeout Feature */
> writel(value, ioaddr + XGMAC_MAC_FSM_CONTROL);
>
> + /* Program the FSM active timer so the timeout checker actually fires.
> + * TMR is the number of CSR clocks per 1us tic, i.e. csr_clk in MHz.
> + * Use a 1s timeout.
> + */
> + if (safety_cfg && safety_cfg->tmouten && csr_clk_mhz) {
[Severity: High]
XGMAC_TMOUTEN is set just above without looking at safety_cfg, but the
timer is only programmed when safety_cfg is non-NULL. Does any XGMAC
platform set plat->safety_feat_cfg?
The generic snps,dwxgmac path in stmmac_probe_config_dt(),
dwmac-socfpga.c and dwmac-tegra.c all appear to leave it NULL. Only
dwmac-intel.c, dwmac-mediatek.c and stmmac_pci.c allocate it, and all
three are GMAC4 cores.
In that case stmmac_safety_feat_configuration() passes NULL and this
check short-circuits. NTMRMD stays at 0 with TMOUTEN set, which is the
dwxgmac state the commit message says it fixes.
dwmac5_safety_feat_config() handles a NULL cfg by substituting
all_safety_feats:
if (!safety_feat_cfg)
safety_feat_cfg = &all_safety_feats;
Should the XGMAC check match how TMOUTEN is enabled? For example,
(!safety_cfg || safety_cfg->tmouten) && csr_clk_mhz, or just csr_clk_mhz,
since TMOUTEN is set unconditionally.
> + value = readl(ioaddr + XGMAC_MAC_FSM_ACT_TIMER);
> + value &= ~(XGMAC_MAC_FSM_ACT_TIMER_NTMRMD |
> + XGMAC_MAC_FSM_ACT_TIMER_TMR);
> + value |= FIELD_PREP(XGMAC_MAC_FSM_ACT_TIMER_NTMRMD,
> + STMMAC_NTMRMD_1SEC) |
> + FIELD_PREP(XGMAC_MAC_FSM_ACT_TIMER_TMR, csr_clk_mhz);
> + writel(value, ioaddr + XGMAC_MAC_FSM_ACT_TIMER);
> + }
> +
[ ... ]
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 4da7289626387..5e5c54b58bee0 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -3691,10 +3691,16 @@ static void stmmac_mtl_configuration(struct stmmac_priv *priv)
>
> static void stmmac_safety_feat_configuration(struct stmmac_priv *priv)
> {
> + unsigned int csr_clk_mhz = 0;
> +
> if (priv->dma_cap.asp) {
> netdev_info(priv->dev, "Enabling Safety Features\n");
> + if (priv->plat->stmmac_clk)
> + csr_clk_mhz = clk_get_rate(priv->plat->stmmac_clk) /
> + 1000000;
[Severity: Medium]
When priv->plat->stmmac_clk is NULL, csr_clk_mhz stays 0.
dwmac5_safety_feat_config() then still sets TMOUTEN but silently skips
the MAC_FSM_ACT_Timer write. Doesn't that leave the timer disabled on the
in-tree platforms that explicitly request tmouten?
stmmac_pci_probe() sets plat->safety_feat_cfg->tmouten = 1 for the snps
gmac5 device but never sets plat->stmmac_clk. snps_gmac5_default_data
only sets clk_csr = STMMAC_CSR_250_300M.
mediatek_dwmac_common_data() also sets tmouten = 1, but
stmmac_probe_config_dt() only looks up the "stmmaceth" clock:
plat->stmmac_clk = devm_clk_get(&pdev->dev,
STMMAC_RESOURCE_NAME);
if (IS_ERR(plat->stmmac_clk)) {
dev_warn(&pdev->dev, "Cannot get CSR clock\n");
plat->stmmac_clk = NULL;
The mt2712e/mt8188/mt8195 DTs don't provide a clock with that name.
On both platforms TMOUTEN ends up set with NTMRMD == 0, and nothing is
logged. Could this fall back to plat->clk_csr, or at least report that
the timer could not be programmed?
> stmmac_safety_feat_config(priv, priv->ioaddr, priv->dma_cap.asp,
> - priv->plat->safety_feat_cfg);
> + priv->plat->safety_feat_cfg,
> + csr_clk_mhz);
[ ... ]
> diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
> index 00be2df63d220..659f5db528d3a 100644
> --- a/include/linux/stmmac.h
> +++ b/include/linux/stmmac.h
> @@ -170,6 +170,18 @@ struct stmmac_safety_feature_cfg {
> u32 tmouten;
> };
>
> +/* MAC_FSM_ACT_Timer.NTMRMD timeout durations */
> +#define STMMAC_NTMRMD_1US 0x1
> +#define STMMAC_NTMRMD_1MS 0x2
> +#define STMMAC_NTMRMD_16MS 0x3
> +#define STMMAC_NTMRMD_64MS 0x4
> +#define STMMAC_NTMRMD_256MS 0x5
> +#define STMMAC_NTMRMD_1SEC 0x6
> +#define STMMAC_NTMRMD_4SEC 0x7
> +#define STMMAC_NTMRMD_16SEC 0x8
> +#define STMMAC_NTMRMD_32SEC 0x9
> +#define STMMAC_NTMRMD_64SEC 0xa
[Severity: Low]
This isn't a bug, but only STMMAC_NTMRMD_1SEC is used, and only from
dwmac5.c and dwxgmac2_core.c. Since v4 dropped the ntmrmd field,
platforms can't select any of the other values.
Would it be better to define just the one value next to the
MAC_FSM_ACT_TIMER field definitions in dwmac5.h and dwxgmac2.h, rather
than adding the full table to the shared platform header?
> +
> /* Addresses that may be customized by a platform */
> struct dwmac4_addrs {
> u32 dma_chan;
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118025528.2703790-1-zxyan0222%40gmail.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-20 21:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 2:55 [PATCH net-next v4] net: stmmac: program the FSM timeout timer Zxyan Zhu
2026-11-20 21:17 ` netdev-bot+sashiko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox