1. 14 10月, 2020 1 次提交
  2. 10 10月, 2020 8 次提交
  3. 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
  4. 29 9月, 2020 19 次提交
  5. 26 9月, 2020 5 次提交
    • J
      ice: add support for flash update overwrite mask · 50db1bca
      Jacob Keller 提交于
      Support the recently added DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK
      parameter in the ice flash update handler. Convert the overwrite mask
      bitfield into the appropriate preservation level used by the firmware
      when updating.
      
      Because there is no equivalent preservation level for overwriting only
      identifiers, this combination is rejected by the driver as not supported
      with an appropriate extended ACK message.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      50db1bca
    • J
      devlink: convert flash_update to use params structure · bc75c054
      Jacob Keller 提交于
      The devlink core recently gained support for checking whether the driver
      supports a flash_update parameter, via `supported_flash_update_params`.
      However, parameters are specified as function arguments. Adding a new
      parameter still requires modifying the signature of the .flash_update
      callback in all drivers.
      
      Convert the .flash_update function to take a new `struct
      devlink_flash_update_params` instead. By using this structure, and the
      `supported_flash_update_params` bit field, a new parameter to
      flash_update can be added without requiring modification to existing
      drivers.
      
      As before, all parameters except file_name will require driver opt-in.
      Because file_name is a necessary field to for the flash_update to make
      sense, no "SUPPORTED" bitflag is provided and it is always considered
      valid. All future additional parameters will require a new bit in the
      supported_flash_update_params bitfield.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJakub Kicinski <kuba@kernel.org>
      Cc: Jiri Pirko <jiri@mellanox.com>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Michael Chan <michael.chan@broadcom.com>
      Cc: Bin Luo <luobin9@huawei.com>
      Cc: Saeed Mahameed <saeedm@mellanox.com>
      Cc: Leon Romanovsky <leon@kernel.org>
      Cc: Ido Schimmel <idosch@mellanox.com>
      Cc: Danielle Ratson <danieller@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bc75c054
    • J
      devlink: check flash_update parameter support in net core · 22ec3d23
      Jacob Keller 提交于
      When implementing .flash_update, drivers which do not support
      per-component update are manually checking the component parameter to
      verify that it is NULL. Without this check, the driver might accept an
      update request with a component specified even though it will not honor
      such a request.
      
      Instead of having each driver check this, move the logic into
      net/core/devlink.c, and use a new `supported_flash_update_params` field
      in the devlink_ops. Drivers which will support per-component update must
      now specify this by setting DEVLINK_SUPPORT_FLASH_UPDATE_COMPONENT in
      the supported_flash_update_params in their devlink_ops.
      
      This helps ensure that drivers do not forget to check for a NULL
      component if they do not support per-component update. This also enables
      a slightly better error message by enabling the core stack to set the
      netlink bad attribute message to indicate precisely the unsupported
      attribute in the message.
      
      Going forward, any new additional parameter to flash update will require
      a bit in the supported_flash_update_params bitfield.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJakub Kicinski <kuba@kernel.org>
      Cc: Jiri Pirko <jiri@mellanox.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Michael Chan <michael.chan@broadcom.com>
      Cc: Bin Luo <luobin9@huawei.com>
      Cc: Saeed Mahameed <saeedm@mellanox.com>
      Cc: Leon Romanovsky <leon@kernel.org>
      Cc: Ido Schimmel <idosch@mellanox.com>
      Cc: Danielle Ratson <danieller@mellanox.com>
      Cc: Shannon Nelson <snelson@pensando.io>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22ec3d23
    • J
      intel: handle unused assignments · 36ec1486
      Jesse Brandeburg 提交于
      Remove variables that were storing a return value from a register
      read or other read, where the return value wasn't used. Those
      conversions to remove the lvalue of the assignment should be safe
      because the readl memory mapped reads are marked volatile and
      should not be optimized out without an lvalue (I suspect a very
      long time ago this wasn't guaranteed as it is today).
      
      These changes are part of a separate patch to make it easier to review.
      
      Warnings Fixed:
      .../intel/e100.c:2596:9: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
      .../intel/ixgb/ixgb_hw.c:101:6: warning: variable ‘icr_reg’ set but not used [-Wunused-but-set-variable]
      .../intel/ixgb/ixgb_hw.c:277:6: warning: variable ‘ctrl_reg’ set but not used [-Wunused-but-set-variable]
      .../intel/ixgb/ixgb_hw.c:952:15: warning: variable ‘temp_reg’ set but not used [-Wunused-but-set-variable]
      .../intel/ixgb/ixgb_hw.c:1164:7: warning: variable ‘mdio_reg’ set but not used [-Wunused-but-set-variable]
      .../intel/e1000/e1000_hw.c:132:6: warning: variable ‘ret_val’ set but not used [-Wunused-but-set-variable]
      .../intel/e1000/e1000_hw.c:380:6: warning: variable ‘icr’ set but not used [-Wunused-but-set-variable]
      .../intel/e1000/e1000_hw.c:2378:6: warning: variable ‘signal’ set but not used [-Wunused-but-set-variable]
      .../intel/e1000/e1000_hw.c:2374:6: warning: variable ‘ctrl’ set but not used [-Wunused-but-set-variable]
      .../intel/e1000/e1000_hw.c:2373:6: warning: variable ‘rxcw’ set but not used [-Wunused-but-set-variable]
      .../intel/e1000/e1000_hw.c:4678:15: warning: variable ‘temp’ set but not used [-Wunused-but-set-variable]
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      36ec1486
    • J
      intel-ethernet: clean up W=1 warnings in kdoc · b50f7bca
      Jesse Brandeburg 提交于
      This takes care of all of the trivial W=1 fixes in the Intel
      Ethernet drivers, which allows developers and maintainers to
      build more of the networking tree with more complete warning
      checks.
      
      There are three classes of kdoc warnings fixed:
       - cannot understand function prototype: 'x'
       - Excess function parameter 'x' description in 'y'
       - Function parameter or member 'x' not described in 'y'
      
      All of the changes were trivial comment updates on
      function headers.
      
      Inspired by Lee Jones' series of wireless work to do the same.
      Compile tested only, and passes simple test of
      $ git ls-files *.[ch] | egrep drivers/net/ethernet/intel | \
        xargs scripts/kernel-doc -none
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b50f7bca
  6. 25 9月, 2020 3 次提交