On Sat, Aug 07, 2021 at 05:43:32PM +0300, Vladimir Oltean wrote: > > 3. Let the vclocks hold a reference to the underlying posix dynamic clock. > > So even if the vclock holds a reference to the underlying POSIX clock, > that won't prevent the hardware driver from unbinding, and further > gettime() calls on the vclock from faulting, will it? Oh, your are right. The vclocks call the real PHC clock's methods directly, not through the posix dynamic clock layer. > What about: > > 4. Create a device link with the vclock being a consumer and the parent > clock being a supplier? This way, ptp_vclock_unregister() is > automatically called whenever (and before) ptp_clock_unregister() is. > > https://www.kernel.org/doc/html/latest/driver-api/device_link.html Sounds promising. Thanks, Richard