From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel Subject: Re: [PATCH net-next 09/11] devlink: convert occ_get op to separate registration Date: Sun, 1 Apr 2018 10:44:27 +0300 Message-ID: <20180401074427.GA21725@splinter> References: <20180329203334.25575-1-idosch@mellanox.com> <20180329203334.25575-10-idosch@mellanox.com> <5f2dc834-0d8a-77ef-3d33-2228e7bd530c@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, davem@davemloft.net, jiri@mellanox.com, petrm@mellanox.com, mlxsw@mellanox.com To: David Ahern Return-path: Received: from mail-ve1eur01on0042.outbound.protection.outlook.com ([104.47.1.42]:43903 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750953AbeDAHog (ORCPT ); Sun, 1 Apr 2018 03:44:36 -0400 Content-Disposition: inline In-Reply-To: <5f2dc834-0d8a-77ef-3d33-2228e7bd530c@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, Mar 30, 2018 at 08:45:50AM -0600, David Ahern wrote: > On 3/29/18 2:33 PM, Ido Schimmel wrote: > > From: Jiri Pirko > > > > This resolves race during initialization where the resources with > > ops are registered before driver and the structures used by occ_get > > op is initialized. So keep occ_get callbacks registered only when > > all structs are initialized. > > Why can't the occ_get handler look at some flag in an mlxsw struct to > know if the system has initialized? > > Separate registration here is awkward. You register a resource and then > register its op later. > > Also, this should be a standalone patch rather than embedded in a > 'mlxsw: Various cleanups' set. I'll drop it from v2 and ask Jiri to post it as a standalone patch.