Re: [net-next, v2, 2/7] ptp: support ptp physical/virtual clocks conversion
From: Richard Cochran <richardcochran@gmail.com>
Date: 2021-05-25 12:28:34
From: Richard Cochran <richardcochran@gmail.com>
Date: 2021-05-25 12:28:34
On Fri, May 21, 2021 at 12:36:14PM +0800, Yangbo Lu wrote:
@@ -76,6 +77,11 @@ static int ptp_clock_settime(struct posix_clock *pc, const struct timespec64 *tp { struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); + if (ptp_guarantee_pclock(ptp)) {
Going to need to protect against concurrency WRT ptp->num_vclocks.
+ pr_err("ptp: virtual clock in use, guarantee physical clock free running\n");
+ return -EBUSY;
+ }
+
return ptp->info->settime64(ptp->info, tp);
}Thanks, Richard