Skip to content

Commit 6efea51

Browse files
martinwhitakerkuba-moo
authored andcommitted
net: dsa: microchip: fix PTP config failure when using multiple ports
When performing the port_hwtstamp_set operation, ptp_schedule_worker() will be called if hardware timestamoing is enabled on any of the ports. When using multiple ports for PTP, port_hwtstamp_set is executed for each port. When called for the first time ptp_schedule_worker() returns 0. On subsequent calls it returns 1, indicating the worker is already scheduled. Currently the ksz driver treats 1 as an error and fails to complete the port_hwtstamp_set operation, thus leaving the timestamping configuration for those ports unchanged. This patch fixes this by ignoring the ptp_schedule_worker() return value. Cc: [email protected] Link: https://lore.kernel.org/[email protected] Fixes: bb01ad3 ("net: dsa: microchip: ptp: manipulating absolute time using ptp hw clock") Signed-off-by: Martin Whitaker <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Acked-by: Arun Ramadoss <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8aba27c commit 6efea51

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/net/dsa/microchip/ksz_ptp.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ static int ksz_ptp_enable_mode(struct ksz_device *dev)
266266
struct ksz_port *prt;
267267
struct dsa_port *dp;
268268
bool tag_en = false;
269-
int ret;
270269

271270
dsa_switch_for_each_user_port(dp, dev->ds) {
272271
prt = &dev->ports[dp->index];
@@ -277,9 +276,7 @@ static int ksz_ptp_enable_mode(struct ksz_device *dev)
277276
}
278277

279278
if (tag_en) {
280-
ret = ptp_schedule_worker(ptp_data->clock, 0);
281-
if (ret)
282-
return ret;
279+
ptp_schedule_worker(ptp_data->clock, 0);
283280
} else {
284281
ptp_cancel_worker_sync(ptp_data->clock);
285282
}

0 commit comments

Comments
 (0)