History

ptp: introduce ptp_cancel_worker_sync

In order to effectively use the PTP kernel thread for tasks such as timestamping packets, allow the user control over stopping it, which is needed e.g. when the timestamping queues must be drained.

Vladimir Oltean committed 6 years ago

Commit 544fed41 parent db99d512 files · +15 −0Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/ptp_clock_kernel.h+9−0
@@ -243,6 +243,13 @@ int ptp_find_pin(struct ptp_clock *ptp, · 242 unmodified lines
243243
244244 int ptp_schedule_worker(struct ptp_clock *ptp, unsigned long delay);
245245
246+/**
247+ * ptp_cancel_worker_sync() - cancel ptp auxiliary clock
248+ *
249+ * @ptp: The clock obtained from ptp_clock_register().
250+ */
251+void ptp_cancel_worker_sync(struct ptp_clock *ptp);
252+
246253 #else
247254 static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
248255 struct device *parent)
@@ -260,6 +267,8 @@ static inline int ptp_find_pin(struct ptp_clock *ptp, · 11 unmodified lines
260267 static inline int ptp_schedule_worker(struct ptp_clock *ptp,
261268 unsigned long delay)
262269 { return -EOPNOTSUPP; }
270+static inline void ptp_cancel_worker_sync(struct ptp_clock *ptp)
271+{ }
263272
264273 #endif
265274