Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: stmmac: rename devlink parameter ts_coarse into phc_coarse_adj

The devlink param "ts_coarse" doesn't indicate that we get coarse
timestamps, but rather that the PHC clock adjusments are coarse as the
frequency won't be continuously adjusted. Adjust the devlink parameter
name to reflect that.

The Coarse terminlogy comes from the dwmac register naming, update the
documentation to better explain what the parameter is about.

With this change, the parameter can now be adjusted using:
devlink dev param set <dev> name phc_coarse_adj value true cmode runtime

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20251030182454.182406-1-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Maxime Chevallier and committed by
Jakub Kicinski
209ff7af 22795871

+16 -7
+15 -6
Documentation/networking/devlink/stmmac.rst
··· 19 19 - Type 20 20 - Mode 21 21 - Description 22 - * - ``ts_coarse`` 22 + * - ``phc_coarse_adj`` 23 23 - Boolean 24 24 - runtime 25 - - Enable the Coarse timestamping mode. In Coarse mode, the ptp clock is 26 - expected to be updated through an external PPS input, but the subsecond 27 - increment used for timestamping is set to 1/ptp_clock_rate. In Fine mode 28 - (i.e. Coarse mode == false), the ptp clock frequency is adjusted more 29 - frequently, but the subsecond increment is set to 2/ptp_clock_rate. 25 + - Enable the Coarse timestamping mode, as defined in the DWMAC TRM. 26 + A detailed explanation of this timestamping mode can be found in the 27 + Socfpga Functionnal Description [1]. 28 + 29 + In Coarse mode, the ptp clock is expected to be fed by a high-precision 30 + clock that is externally adjusted, and the subsecond increment used for 31 + timestamping is set to 1/ptp_clock_rate. 32 + 33 + In Fine mode (i.e. Coarse mode == false), the ptp clock frequency is 34 + continuously adjusted, but the subsecond increment is set to 35 + 2/ptp_clock_rate. 36 + 30 37 Coarse mode is suitable for PTP Grand Master operation. If unsure, leave 31 38 the parameter to False. 39 + 40 + [1] https://www.intel.com/content/www/us/en/docs/programmable/683126/21-2/functional-description-of-the-emac.html
+1 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 7445 7445 } 7446 7446 7447 7447 static const struct devlink_param stmmac_devlink_params[] = { 7448 - DEVLINK_PARAM_DRIVER(STMMAC_DEVLINK_PARAM_ID_TS_COARSE, "ts_coarse", 7448 + DEVLINK_PARAM_DRIVER(STMMAC_DEVLINK_PARAM_ID_TS_COARSE, "phc_coarse_adj", 7449 7449 DEVLINK_PARAM_TYPE_BOOL, 7450 7450 BIT(DEVLINK_PARAM_CMODE_RUNTIME), 7451 7451 stmmac_dl_ts_coarse_get,