Subject: Re: [RFC PATCH net-next 1/2] devlink: Hold a reference on parent device

From: Jakub Kicinski <[email-masked]>
Date: Tue, 20 Jun 2023 10:43:51 -0700

On Tue, 20 Jun 2023 10:05:23 +0300 Ido Schimmel wrote:
> On Tue, Jun 20, 2023 at 08:23:26AM +0200, Jiri Pirko wrote:
> > Mon, Jun 19, 2023 at 02:50:14PM CEST, [email-masked] wrote:  
>  [...]  
> > 
> > Reviewed-by: Jiri Pirko <[email-masked]>  
> 
> Thanks, but I was hoping to get feedback on how to solve the problem
> mentioned in the commit message :p

Do we need to hold the reference on the device until release?
I think you can release it in devlink_free().
The only valid fields for an unregistered devlink instance are:
 - lock
 - refcount
 - index

And obviously unregistered devices can't be reloaded.