When the periodic output is restarted, the request flags and index are always set to 0. So if a pin other than the first one was used, or if a flag was set in the request that triggered the periodic output, it is lost when the output is restarted. Save the request's flags and index when the periodic output is initialized. Use the save flags and index when the periodic output is reset Cc: stable@vger.kernel.org Fixes: 1f12ae5b6760 ("net: dsa: microchip: ptp: add periodic output signal") Signed-off-by: Bastien Curutchet (Schneider Electric) --- drivers/net/dsa/microchip/ksz_ptp.c | 6 ++++-- drivers/net/dsa/microchip/ksz_ptp.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz_ptp.c b/drivers/net/dsa/microchip/ksz_ptp.c index 39cc70d65900..4f924df9e32b 100644 --- a/drivers/net/dsa/microchip/ksz_ptp.c +++ b/drivers/net/dsa/microchip/ksz_ptp.c @@ -222,6 +222,8 @@ static int ksz_ptp_enable_perout(struct ksz_device *dev, return 0; } + ptp_data->perout_flags = request->flags; + ptp_data->perout_index = request->index; ptp_data->perout_target_time_first.tv_sec = request->start.sec; ptp_data->perout_target_time_first.tv_nsec = request->start.nsec; @@ -795,8 +797,8 @@ static int ksz_ptp_restart_perout(struct ksz_device *dev) request.start.nsec = next.tv_nsec; request.period.sec = ptp_data->perout_period.tv_sec; request.period.nsec = ptp_data->perout_period.tv_nsec; - request.index = 0; - request.flags = 0; + request.index = ptp_data->perout_index; + request.flags = ptp_data->perout_flags; return ksz_ptp_enable_perout(dev, &request, 1); } diff --git a/drivers/net/dsa/microchip/ksz_ptp.h b/drivers/net/dsa/microchip/ksz_ptp.h index 7067ec9bd1e6..da6a2efb23d7 100644 --- a/drivers/net/dsa/microchip/ksz_ptp.h +++ b/drivers/net/dsa/microchip/ksz_ptp.h @@ -31,6 +31,8 @@ struct ksz_ptp_data { enum ksz_ptp_tou_mode tou_mode; struct timespec64 perout_target_time_first; /* start of first pulse */ struct timespec64 perout_period; + unsigned int perout_flags; + unsigned int perout_index; }; int ksz_ptp_clock_register(struct dsa_switch *ds); --- base-commit: cee9395acd8043be0644b25c34bfa86623f2b935 change-id: 20260914-fix-perout-c8c972b89d7f Best regards, -- Bastien Curutchet (Schneider Electric)