]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: dsa: microchip: Disable PTP function of KSZ8463
authorTristram Ha <tristram.ha@microchip.com>
Fri, 25 Jul 2025 00:17:53 +0000 (17:17 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 26 Jul 2025 00:01:56 +0000 (17:01 -0700)
The PTP function of KSZ8463 is on by default.  However, its proprietary
way of storing timestamp directly in a reserved field inside the PTP
message header is not suitable for use with the current Linux PTP stack
implementation.  It is necessary to disable the PTP function to not
interfere the normal operation of the MAC.

Note the PTP driver for KSZ switches does not work for KSZ8463 and is not
activated for it.

Signed-off-by: Tristram Ha <tristram.ha@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250725001753.6330-7-Tristram.Ha@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/microchip/ksz8.c

index 62224426a9bd04558124b7e8bdfa445ba1dcda6b..c400e1c0369e3800d55f841e6d8de9fec1521163 100644 (file)
@@ -1760,6 +1760,17 @@ void ksz8_config_cpu_port(struct dsa_switch *ds)
                                           KSZ8463_REG_DSP_CTRL_6,
                                           COPPER_RECEIVE_ADJUSTMENT, 0);
                }
+
+               /* Turn off PTP function as the switch's proprietary way of
+                * handling timestamp is not supported in current Linux PTP
+                * stack implementation.
+                */
+               regmap_update_bits(ksz_regmap_16(dev),
+                                  KSZ8463_PTP_MSG_CONF1,
+                                  PTP_ENABLE, 0);
+               regmap_update_bits(ksz_regmap_16(dev),
+                                  KSZ8463_PTP_CLK_CTRL,
+                                  PTP_CLK_ENABLE, 0);
        }
 }