Subject: Re: [PATCH net-next 1/5] ptp: unregister virtual clocks when unregistering physical clock.

From: Miroslav Lichvar <[email-masked]>
Date: Mon, 31 Jan 2022 11:07:52 +0100

On Thu, Jan 27, 2022 at 03:58:02PM -0800, Vinicius Costa Gomes wrote:
> Miroslav Lichvar <[email-masked]> writes:
> 
> > When unregistering a physical clock which has some virtual clocks,
> > unregister the virtual clocks with it.

> I am not against this change, but I think this problem was discussed
> before and the suggestions were to fix it differently:
> 
> https://lore.kernel.org/all/20210807144332.szyazdfl42abwzmd@skbuf/

Is a linked device supposed to be unregistered automatically before
the parent? The referenced document mentions only suspending
and resuming, nothing about unregistering.

I tried

	device_link_add(parent, &ptp->dev, DL_FLAG_AUTOREMOVE_CONSUMER);

and also with no flags specified, but it didn't seem to do anything
for the vclock. It was still oopsing.

Any hints?

-- 
Miroslav Lichvar