[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210807144332.szyazdfl42abwzmd@skbuf>
Date: Sat, 7 Aug 2021 17:43:32 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Richard Cochran <richardcochran@...il.com>
Cc: Vinicius Costa Gomes <vinicius.gomes@...el.com>,
Yangbo Lu <yangbo.lu@....com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
mptcp@...ts.linux.dev, "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Mat Martineau <mathew.j.martineau@...ux.intel.com>,
Matthieu Baerts <matthieu.baerts@...sares.net>,
Shuah Khan <shuah@...nel.org>,
Michal Kubecek <mkubecek@...e.cz>,
Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>, Rui Sousa <rui.sousa@....com>,
Sebastien Laveze <sebastien.laveze@....com>
Subject: Re: [net-next, v5, 02/11] ptp: support ptp physical/virtual clocks
conversion
On Sat, Aug 07, 2021 at 07:22:59AM -0700, Richard Cochran wrote:
> On Fri, Aug 06, 2021 at 06:15:29PM -0700, Vinicius Costa Gomes wrote:
>
> > > int ptp_clock_unregister(struct ptp_clock *ptp)
> > > {
> > > + if (ptp_vclock_in_use(ptp)) {
> > > + pr_err("ptp: virtual clock in use\n");
> > > + return -EBUSY;
> > > + }
> > > +
> >
> > None of the drivers (that I looked) expect ptp_clock_unregister() to
> > return an error.
> >
> > So, what should we do?
> > 1. Fix all the drivers to return an error on module unloading (that's
> > usually the path ptp_clock_unregister() is called)?
> > 2. Remove all the PTP virtual clocks when the physical clock is
> > unregistered?
>
> This:
>
> 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?
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
Powered by blists - more mailing lists