1. 24 Aug, 2022 1 commit
    • Vadim Pasternak's avatar
      mlxsw: core_linecards: Separate line card init and fini flow · 4be4779b
      Vadim Pasternak authored
      Currently, each line card is initialized using the following steps:
      
      1. Initializing its various fields (e.g., slot index).
      2. Creating the corresponding devlink object.
      3. Enabling events (i.e., traps) for changes in line card status.
      4. Querying and processing line card status.
      
      Unlike traps, the IRQ that notifies the CPU about line card status
      changes cannot be enabled / disabled on a per line card basis.
      
      If a handler is registered before the line cards are initialized, the
      handler risks accessing uninitialized memory.
      
      On the other hand, if the handler is registered after initialization,
      we risk missing events. For example, in step 4, the driver might see
      that a line card is in ready state and will tell the device to enable
      it. When enablement is done, the line card will be activated and the
      IRQ will be triggered. Since a handler was not registered, the event
      will be missed.
      
      Solve this by splitting the initialization sequence into two steps
      (1-2 and 3-4). In a subsequent patch, the handler will be registered
      between both steps.
      Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4be4779b
  2. 23 Aug, 2022 39 commits