Subject: Re: [PATCH net v2] devlink: Delay health recover notification until devlink registered

From: Jakub Kicinski <[email-masked]>
Date: Fri, 11 Aug 2023 14:42:31 -0700

On Fri, 11 Aug 2023 10:05:03 +0200 Jiri Pirko wrote:
> This patch is not about user accessing it, this is about
> notification that would be tried to send before the instance is
> registered. So the lock scheme you suggest is not necessary. What helps
> is to move devl_port_health_reporter_create() call after register.

We moved to a model where the instance is registered early,
why is the driver not registering the instance early?

My first choice would be to fix the driver rather than adjust
the behavior of the core, and I'm hearing no solid reason why
that's not possible.

> We have the same issue with mlxsw where this notification may be called
> before register from mlxsw_core_health_event_work()

mlxsw? I somehow assumed this patch was for mlx5.. 
Quality commit message :|

> Limiting the creation of health reporter only when instance is
> registered does not seem like a good solution to me.
> 
> As with any other object, we postpone the notifications only after
> register is done, that sounds fine, doesn't it?

No, it doesn't. Registering health reporters on a semi-initialized
device is a major foot gun, we should not allow this unless really
necessary.