• Ido Schimmel's avatar
    mlxsw: core: Register devlink instance before sub-objects · 9d9a90cd
    Ido Schimmel authored
    Recent changes made it possible to register the devlink instance before
    its sub-objects and under the instance lock. Among other things, it
    allows us to avoid warnings such as this one [1]. The warning is
    generated because a buggy firmware is generating a health event during
    driver initialization, before the devlink instance is registered.
    
    Move the registration of the devlink instance to the beginning of the
    initialization flow to avoid such problems.
    
    A similar change was implemented in netdevsim in commit 82a3aef2
    ("netdevsim: move devlink registration under the instance lock").
    
    [1]
    WARNING: CPU: 3 PID: 49 at net/devlink/leftover.c:7509 devlink_recover_notify.constprop.0+0xaf/0xc0
    [...]
    Call Trace:
     <TASK>
     devlink_health_report+0x45/0x1d0
     mlxsw_core_health_event_work+0x24/0x30 [mlxsw_core]
     process_one_work+0x1db/0x390
     worker_thread+0x49/0x3b0
     kthread+0xe5/0x110
     ret_from_fork+0x1f/0x30
     </TASK>
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
    Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
    Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    9d9a90cd
core.c 96 KB