Subject: Re: [patch net-next 0/7] devlink: sanitize per-port region creation/destruction

From: Jakub Kicinski <[email-masked]>
Date: Fri, 26 Aug 2022 17:22:43 -0700

On Fri, 26 Aug 2022 10:21:25 +0200 Jiri Pirko wrote:
>> The point of exposing the devlink lock was to avoid forcing drivers 
>> to order object registration in a specific way. I don't like.  
> 
> Well for params, we are also forcing them in a specific way. The
> regions, with the DSA exception which is not voluntary, don't need to be
> created/destroyed during devlink/port being registered.
> 
> I try to bring some order to the a bit messy devlink world. The
> intention is to make everyone's live happier :)

The way I remember it - we had to keep the ordering on resources for
mlx4 because of complicated locking/async nature of events, and since
it's a driver for a part which is much EoL we won't go back now and do
major surgery, that's fine.

But that shouldn't mean that the recommended way of using resources is
"hook them up before register". The overall devlink locking ordering
should converge towards the "hold devl_lock() around registration of
your components, or whenever the device goes out of consistent state".