Re: [PATCH net-next v9 12/13] net: ethtool: tsinfo: Add support for hwtstamp provider and get/set hwtstamp config

From: Jakub Kicinski
Date: Tue Mar 05 2024 - 13:05:20 EST


On Tue, 5 Mar 2024 17:52:53 +0100 Köry Maincent wrote:
> > > + /* Does the hwtstamp supported in the netdev topology */
> > > + if (mod) {
> > > + hwtstamp.ptp = ptp_clock_get_by_index(phc_index);
> >
> > This just returns a pointer without any refcounting, right?
> > What guarantees the ptp object doesn't disappear?
>
> Could the ptp object disappears within rtnlock?

I believe so, yes.

> Maybe I should add refcounting.