提交 544fed47 编写于 作者: V Vladimir Oltean 提交者: David S. Miller

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.
Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 db99d512
...@@ -371,6 +371,12 @@ int ptp_schedule_worker(struct ptp_clock *ptp, unsigned long delay) ...@@ -371,6 +371,12 @@ int ptp_schedule_worker(struct ptp_clock *ptp, unsigned long delay)
} }
EXPORT_SYMBOL(ptp_schedule_worker); EXPORT_SYMBOL(ptp_schedule_worker);
void ptp_cancel_worker_sync(struct ptp_clock *ptp)
{
kthread_cancel_delayed_work_sync(&ptp->aux_work);
}
EXPORT_SYMBOL(ptp_cancel_worker_sync);
/* module operations */ /* module operations */
static void __exit ptp_exit(void) static void __exit ptp_exit(void)
......
...@@ -243,6 +243,13 @@ int ptp_find_pin(struct ptp_clock *ptp, ...@@ -243,6 +243,13 @@ int ptp_find_pin(struct ptp_clock *ptp,
int ptp_schedule_worker(struct ptp_clock *ptp, unsigned long delay); int ptp_schedule_worker(struct ptp_clock *ptp, unsigned long delay);
/**
* ptp_cancel_worker_sync() - cancel ptp auxiliary clock
*
* @ptp: The clock obtained from ptp_clock_register().
*/
void ptp_cancel_worker_sync(struct ptp_clock *ptp);
#else #else
static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
struct device *parent) struct device *parent)
...@@ -260,6 +267,8 @@ static inline int ptp_find_pin(struct ptp_clock *ptp, ...@@ -260,6 +267,8 @@ static inline int ptp_find_pin(struct ptp_clock *ptp,
static inline int ptp_schedule_worker(struct ptp_clock *ptp, static inline int ptp_schedule_worker(struct ptp_clock *ptp,
unsigned long delay) unsigned long delay)
{ return -EOPNOTSUPP; } { return -EOPNOTSUPP; }
static inline void ptp_cancel_worker_sync(struct ptp_clock *ptp)
{ }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册