1. 11 12月, 2020 1 次提交
  2. 10 12月, 2020 9 次提交
  3. 01 12月, 2020 1 次提交
  4. 25 11月, 2020 3 次提交
  5. 24 11月, 2020 2 次提交
  6. 20 11月, 2020 2 次提交
    • J
      devlink: move flash end and begin to core devlink · 52cc5f3a
      Jacob Keller 提交于
      When performing a flash update via devlink, device drivers may inform
      user space of status updates via
      devlink_flash_update_(begin|end|timeout|status)_notify functions.
      
      It is expected that drivers do not send any status notifications unless
      they send a begin and end message. If a driver sends a status
      notification without sending the appropriate end notification upon
      finishing (regardless of success or failure), the current implementation
      of the devlink userspace program can get stuck endlessly waiting for the
      end notification that will never come.
      
      The current ice driver implementation may send such a status message
      without the appropriate end notification in rare cases.
      
      Fixing the ice driver is relatively simple: we just need to send the
      begin_notify at the start of the function and always send an end_notify
      no matter how the function exits.
      
      Rather than assuming driver authors will always get this right in the
      future, lets just fix the API so that it is not possible to get wrong.
      Make devlink_flash_update_begin_notify and
      devlink_flash_update_end_notify static, and call them in devlink.c core
      code. Always send the begin_notify just before calling the driver's
      flash_update routine. Always send the end_notify just after the routine
      returns regardless of success or failure.
      
      Doing this makes the status notification easier to use from the driver,
      as it no longer needs to worry about catching failures and cleaning up
      by calling devlink_flash_update_end_notify. It is now no longer possible
      to do the wrong thing in this regard. We also save a couple of lines of
      code in each driver.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Acked-by: NVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      52cc5f3a
    • J
      devlink: move request_firmware out of driver · b44cfd4f
      Jacob Keller 提交于
      All drivers which implement the devlink flash update support, with the
      exception of netdevsim, use either request_firmware or
      request_firmware_direct to locate the firmware file. Rather than having
      each driver do this separately as part of its .flash_update
      implementation, perform the request_firmware within net/core/devlink.c
      
      Replace the file_name parameter in the struct devlink_flash_update_params
      with a pointer to the fw object.
      
      Use request_firmware rather than request_firmware_direct. Although most
      Linux distributions today do not have the fallback mechanism
      implemented, only about half the drivers used the _direct request, as
      compared to the generic request_firmware. In the event that
      a distribution does support the fallback mechanism, the devlink flash
      update ought to be able to use it to provide the firmware contents. For
      distributions which do not support the fallback userspace mechanism,
      there should be essentially no difference between request_firmware and
      request_firmware_direct.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Acked-by: NShannon Nelson <snelson@pensando.io>
      Acked-by: NVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      b44cfd4f
  7. 18 11月, 2020 2 次提交
  8. 11 11月, 2020 3 次提交
  9. 21 10月, 2020 1 次提交
  10. 19 10月, 2020 1 次提交
  11. 14 10月, 2020 2 次提交
  12. 10 10月, 2020 8 次提交
  13. 30 9月, 2020 4 次提交
    • J
      ice: preserve NVM capabilities in safe mode · be49b1ad
      Jacob Keller 提交于
      If the driver initializes in safe mode, it will call
      ice_set_safe_mode_caps. This results in clearing the capabilities
      structures, in order to set them up for operating in safe mode, ensuring
      many features are disabled.
      
      This has a side effect of also clearing the capability bits that relate
      to NVM update. The result is that the device driver will not indicate
      support for unified update, even if the firmware is capable.
      
      Fix this by adding the relevant capability fields to the list of values
      we preserve. To simplify the code, use a common_cap structure instead of
      a handful of local variables. To reduce some duplication of the
      capability name, introduce a couple of macros used to restore the
      capabilities values from the cached copy.
      
      Fixes: de9b277e ("ice: Add support for unified NVM update flow capability")
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NBrijesh Behera <brijeshx.behera@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      be49b1ad
    • J
      ice: increase maximum wait time for flash write commands · 0ec86e8e
      Jacob Keller 提交于
      The ice driver needs to wait for a firmware response to each command to
      write a block of data to the scratch area used to update the device
      firmware. The driver currently waits for up to 1 second for this to be
      returned.
      
      It turns out that firmware might take longer than 1 second to return
      a completion in some cases. If this happens, the flash update will fail
      to complete.
      
      Fix this by increasing the maximum time that the driver will wait for
      both writing a block of data, and for activating the new NVM bank. The
      timeout for an erase command is already several minutes, as the firmware
      had to erase the entire bank which was already expected to take a minute
      or more in the worst case.
      
      In the case where firmware really won't respond, we will now take longer
      to fail. However, this ensures that if the firmware is simply slow to
      respond, the flash update can still complete. This new maximum timeout
      should not adversely increase the update time, as the implementation for
      wait_event_interruptible_timeout, and should wake very soon after we get
      a completion event. It is better for a flash update be slow but still
      succeed than to fail because we gave up too quickly.
      
      Fixes: d69ea414 ("ice: implement device flash update via devlink")
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NBrijesh Behera <brijeshx.behera@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      0ec86e8e
    • S
      net: intel: Remove in_interrupt() warnings · 0171f4e8
      Sebastian Andrzej Siewior 提交于
      in_interrupt() is ill defined and does not provide what the name
      suggests. The usage especially in driver code is deprecated and a tree wide
      effort to clean up and consolidate the (ab)usage of in_interrupt() and
      related checks is happening.
      
      In this case the checks cover only parts of the contexts in which these
      functions cannot be called. They fail to detect preemption or interrupt
      disabled invocations.
      
      As the functions which are invoked from the various places contain already
      a broad variety of checks (always enabled or debug option dependent) cover
      all invalid conditions already, there is no point in having inconsistent
      warnings in those drivers.
      
      Just remove them.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NAlexander Duyck <alexander.h.duyck@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0171f4e8
    • S
      net: e100: Remove in_interrupt() usage and pointless GFP_ATOMIC allocation · f127bab4
      Sebastian Andrzej Siewior 提交于
      e100_hw_init() invokes e100_self_test() only if in_interrupt() returns
      false as e100_self_test() uses msleep() which requires sleepable task
      context. The in_interrupt() check is incomplete because in_interrupt()
      cannot catch callers from contexts which have just preemption or interrupts
      disabled.
      
      e100_hw_init() is invoked from:
      
        - e100_loopback_test() which clearly is sleepable task context as the
          function uses msleep() itself.
      
        - e100_up() which clearly is sleepable task context as well because it
          invokes e100_alloc_cbs() abd request_irq() which both require sleepable
          task context due to GFP_KERNEL allocations and mutex_lock() operations.
      
      Remove the pointless in_interrupt() check.
      
      As a side effect of this analysis it turned out that e100_rx_alloc_list()
      which is only invoked from e100_loopback_test() and e100_up() pointlessly
      uses a GFP_ATOMIC allocation. The next invoked function e100_alloc_cbs() is
      using GFP_KERNEL already.
      
      Change the allocation mode in e100_rx_alloc_list() to GFP_KERNEL as well.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f127bab4
  14. 29 9月, 2020 1 次提交