1. 23 May, 2024 4 commits
  2. 09 May, 2024 2 commits
  3. 08 May, 2024 1 commit
  4. 07 May, 2024 2 commits
  5. 06 May, 2024 2 commits
    • Mark Brown's avatar
      spi: pxa2xx: Drop linux/spi/pxa2xx_spi.h · 21ae190e
      Mark Brown authored
      Merge series from Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
      
      As Arnd suggested we may drop linux/spi/pxa2xx_spi.h as most of
      its content is being used solely internally to SPI subsystem
      (PXA2xx drivers). Hence this refactoring series with the additional
      win of getting rid of legacy documentation.
      
      Note, that we have the only user of a single plain integer field
      in the entire kernel for that. Switching to software nodes does not
      diminish any of type checking as we only pass an integer.
      21ae190e
    • Mark Brown's avatar
      spi: dw: Auto-detect number of native CS · aa9db105
      Mark Brown authored
      Merge series from Serge Semin <fancer.lancer@gmail.com>:
      
      The main goal of the short series is to provide a procedure implementing
      the auto-detection of the number of native Chip-Select signals supported
      by the controller. The suggested algorithm is straightforward. It relies
      on the fact that the SER register writable flags reflects the actual
      number of available native chip-select signals. So the DW APB/AHB SSI
      driver now tests the SER register for having the writable bits,
      calculates the number of CS signals based on the number of set flags and
      then initializes the num_cs private data field based on that, which then
      will be passed to the SPI-core subsystem indicating the number of
      supported hardware chip-selects. The implemented procedure will be useful
      for the DW SSI device nodes not having the explicitly set "num-cs"
      property. In case if the property is specified it will be utilized instead
      of the auto-detection procedure.
      
      Besides of that a small cleanup patch is introduced in the head of the
      series. It converts the driver to using the BITS_TO_BYTES() macro instead
      of the hard-coded DIV_ROUND_UP()-based calculation of the number of
      bytes-per-transfer-word.
      aa9db105
  6. 03 May, 2024 17 commits
  7. 01 May, 2024 4 commits
    • Mark Brown's avatar
      spi: use 'time_left' instead of 'timeout' with · 6be871d5
      Mark Brown authored
      Merge series from Wolfram Sang <wsa+renesas@sang-engineering.com>:
      
      There is a confusing pattern in the kernel to use a variable named 'timeout' to
      store the result of wait_for_*() functions causing patterns like:
      
              timeout = wait_for_completion_timeout(...)
              if (!timeout) return -ETIMEDOUT;
      
      with all kinds of permutations. Use 'time_left' as a variable to make the code
      obvious and self explaining.
      
      This is part of a tree-wide series. The rest of the patches can be found here
      (some parts may still be WIP):
      
      git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/time_left
      
      Because these patches are generated, I audit them before sending. This is why I
      will send series step by step. Build bot is happy with these patches, though.
      No functional changes intended.
      6be871d5
    • Mark Brown's avatar
      Add add SPI-NAND Flash controller driver for EN7581 · 78d94353
      Mark Brown authored
      Merge series from Lorenzo Bianconi <lorenzo@kernel.org>:
      
      Introduce support for SPI-NAND driver of the Airoha NAND Flash Interface
      found on Airoha ARM EN7581 SoCs.
      78d94353
    • Mans Rullgard's avatar
      spi: fix null pointer dereference within spi_sync · 4756fa52
      Mans Rullgard authored
      If spi_sync() is called with the non-empty queue and the same spi_message
      is then reused, the complete callback for the message remains set while
      the context is cleared, leading to a null pointer dereference when the
      callback is invoked from spi_finalize_current_message().
      
      With function inlining disabled, the call stack might look like this:
      
        _raw_spin_lock_irqsave from complete_with_flags+0x18/0x58
        complete_with_flags from spi_complete+0x8/0xc
        spi_complete from spi_finalize_current_message+0xec/0x184
        spi_finalize_current_message from spi_transfer_one_message+0x2a8/0x474
        spi_transfer_one_message from __spi_pump_transfer_message+0x104/0x230
        __spi_pump_transfer_message from __spi_transfer_message_noqueue+0x30/0xc4
        __spi_transfer_message_noqueue from __spi_sync+0x204/0x248
        __spi_sync from spi_sync+0x24/0x3c
        spi_sync from mcp251xfd_regmap_crc_read+0x124/0x28c [mcp251xfd]
        mcp251xfd_regmap_crc_read [mcp251xfd] from _regmap_raw_read+0xf8/0x154
        _regmap_raw_read from _regmap_bus_read+0x44/0x70
        _regmap_bus_read from _regmap_read+0x60/0xd8
        _regmap_read from regmap_read+0x3c/0x5c
        regmap_read from mcp251xfd_alloc_can_err_skb+0x1c/0x54 [mcp251xfd]
        mcp251xfd_alloc_can_err_skb [mcp251xfd] from mcp251xfd_irq+0x194/0xe70 [mcp251xfd]
        mcp251xfd_irq [mcp251xfd] from irq_thread_fn+0x1c/0x78
        irq_thread_fn from irq_thread+0x118/0x1f4
        irq_thread from kthread+0xd8/0xf4
        kthread from ret_from_fork+0x14/0x28
      
      Fix this by also setting message->complete to NULL when the transfer is
      complete.
      
      Fixes: ae7d2346 ("spi: Don't use the message queue if possible in spi_sync")
      Signed-off-by: default avatarMans Rullgard <mans@mansr.com>
      Link: https://lore.kernel.org/r/20240430182705.13019-1-mans@mansr.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      4756fa52
    • David Lechner's avatar
      spi: use spi_valid_{tx,rx}buf() in stats function · 52267fe8
      David Lechner authored
      There are macros spi_valid_txbuf() and spi_valid_rxbuf() for determining
      if an xfer actually intended to send or receive data.
      
      These checks were hard-coded in spi_statistics_add_transfer_stats(). We
      can make use of the macros instead to make the code more readable and
      more robust against potential future changes in case the definition of
      what valid means changes.
      
      The macro takes the spi_message as an argument, so we need to change
      spi_statistics_add_transfer_stats() to take the spi_message as an
      argument instead of the controller.
      Signed-off-by: default avatarDavid Lechner <dlechner@baylibre.com>
      Link: https://lore.kernel.org/r/20240430201530.2138095-3-dlechner@baylibre.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      52267fe8
  8. 30 Apr, 2024 8 commits