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=1796024750; b=Ga0kaHN5wfL/ik9vSkw6rka0ge9ueuFFfMFnDz0CfivFgymheWkpWNKI8T65EybQzn7p S+LQDSYC69LsCFwp1y/8qoVjR13/8gF/e7N4taicLhpbkzBkTMHXG3lv5MhBSCga0x++s CqUPYnDxpCv8lG9Kd1977k0rgJrYo9T2uIQH7sHgvYbeKdaVrlSARrO1N3cZq9HVzY9QR dDY0ufDIlc9HcuexyH700bcSuzt2aGje+rDN8V0/TMQKr4oVYvJbzfDV1QkOCLJ4fuKw+ AGIDTYhjuGm43XV6q0tXaBOBYrGNz9R0P55YBLWODlB0cmq5zqPJKIcfu1dzS+CxtEw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796024750; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted: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=TcYtYybQYzG/wpZTUN1F+LOtTmAnfgcKrlbGqchPBTnDaE6+Zi9drq+53pFHEx9ziOby 17EaN3SJ3Ls28obBybT/HOCf728Gc0beFqmXt2KQeudObnTggOz9/0cL5nxt1//dtCTEI PMTNxHkjGb+k4kBPaGF5ThUAdhgwnL4AjF/sd4DROxr3m2lNM3wChn5pGzAebPs4v+Ewx VNqFq1AmRXBwB9J4Kq8Cy3mQWr8dhKcrLFbJUR81VMhyUzD0DPTobDaGZ0tybLxDbOLx/ Ln2o1IxGOraYmOc3bDD/yw/MZuTb09dBkC2CtNSRqvBqCmyhfywbgdwswuBgb/Sj3sg== 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 49515606A320 for ; Mon, 30 Nov 2026 07:45:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 49515606A320 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-2f066274caeso48966715ad.2 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=DYwMURGW/GwkuXFTx7U4eNwFib/8Hi8fChBsk5TUXT4QcIljSseR8pTxY14XRJM7/1 3GpWQJWr9VQrhwjnuRADMUDn8YjKyPY83KfAnxHh599nmrh5ZHjyM1KDY3LNWVs6rB9S UDP1KwyBzOBxQ/twyx4bapUf4JreZMlqh94jT1dP/1eXqmbHcuvMjiITa3tlXzppdaAN 4UHsJRssw3grj7/wupLs5uKwEh+Z4riS07WrLzbfoCt+4f8XFV2xE3nAMAD6zox+sn+h FJhdYpu44jH1wX+M6ZjRBCIIBoM5+XiiaID8tGQcckTwBz77ABK+5FiMuJjuDmEsWlJP fx8A== X-Forwarded-Encrypted: i=1; AL+hErGJaurlDRxTFFYRi9E6d4tD7MGdkbAXdzA9UdiJ1favIcZQ7drqhOUig96MqpkwDALX+xDkQd1PBXByqg4=@vger.kernel.org X-Gm-Message-State: APuU4Z+aMlPJfQaA+mQ9DLv3mPunEv+7xV5ZCnen33ZVDPwVql9h0Hls IeCKuAsoiJ1sOzPxLhZl2qtN4tVrYiJCeNWKZjY6wGMwueFxyCdQju21 X-Gm-Gg: AZFdTZfTFKlvGe7dAZY6oAH8ZzfAVtFDRbGEu4x5g+rViGw2FTPODY7d3e+4nLzYacC 7OyVl57oW/3SzhNwRDUw5hj+iNG+AukgeSIe/YesiZBSC5KyOFdUxU2/ZxwLXJpJ/zI/vcWXGoD 0bYR6Jcdq80Bx59p8qJI+7CQT27FpA+E2c5b6ASOz4ZsnxTVH57JNmRSoK0IQIXkoWPkxKQYj0S MlDBYe9xcCQ22VSOyi32KUTaeB84kz5bNBBEFQuLKKc8uBcSNJc7DAR2ggrNDz8eJ9SHJvBXVuV a82/w5LmwjfoYY8YnWsQ3rEGXMLATAUuzqDLTg1NKWiBO5ORyqGUrGiy4bSe4tBqXbK8aYWI6P+ P7Cm981wY7OKGbUTlhi1ETEf8TB2UDI9rsWVFKggkfDFNCz8+BhQxKOkRIxEWsY6IKsN0rBrnfy K1Ya6INozfAZJ7qbA4zR51uwz+O3X1iiy7Wy3HpUZ7NQ2Mq2vN/LAeCufe1SmNIqx+ieCI9HJ4U N9BhA6iSs8LmhAQ+gygHcc/SUyVvKw45+jn9atDPJ0foyCDM1C5CwQl2kQgj5SOgPzKYmTLd5u3 q2eVQeZB14vSjZC4kOp85uelJoBi3lHj5JmrZgbVYcHVlUlJxQ== 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: linux-kernel@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