[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230810103300.186b42c8@kernel.org>
Date: Thu, 10 Aug 2023 10:33:00 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Shay Drory <shayd@...dia.com>
Cc: <netdev@...r.kernel.org>, <pabeni@...hat.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, Jiri Pirko <jiri@...dia.com>
Subject: Re: [PATCH net v2] devlink: Delay health recover notification until
devlink registered
On Wed, 9 Aug 2023 23:35:21 +0300 Shay Drory wrote:
> From one side, devl_register() is done last in device initialization
> phase, in order to expose devlink to the user only when device is
> ready. From second side, it is valid to create health reporters
> during device initialization, in order to recover and/or notify the
> user.
> As a result, a health recover can be invoked before devl_register().
> However, invoking health recover before devl_register() triggers a
> WARN_ON.
My comment on v1 wasn't clear enough, I guess.
What I was trying to get across is that because drivers can take
devl_lock(), devl_register() does not have to be last.
AFAIU your driver does:
devlink_port_health_reporter_create()
...
devlink_register()
why not change it to do:
devl_lock()
devl_register()
devl_port_health_reporter_create()
...
devl_unlock() # until unlock user space can't access the instance
?
Powered by blists - more mailing lists