1. 07 7月, 2020 3 次提交
  2. 06 7月, 2020 1 次提交
  3. 01 7月, 2020 1 次提交
  4. 25 6月, 2020 1 次提交
  5. 22 6月, 2020 4 次提交
  6. 19 6月, 2020 2 次提交
  7. 17 6月, 2020 1 次提交
  8. 15 6月, 2020 1 次提交
  9. 11 6月, 2020 3 次提交
    • K
      spi: spi-fsl-dspi: Free DMA memory with matching function · 03fe7aaf
      Krzysztof Kozlowski 提交于
      Driver allocates DMA memory with dma_alloc_coherent() but frees it with
      dma_unmap_single().
      
      This causes DMA warning during system shutdown (with DMA debugging) on
      Toradex Colibri VF50 module:
      
          WARNING: CPU: 0 PID: 1 at ../kernel/dma/debug.c:1036 check_unmap+0x3fc/0xb04
          DMA-API: fsl-edma 40098000.dma-controller: device driver frees DMA memory with wrong function
            [device address=0x0000000087040000] [size=8 bytes] [mapped as coherent] [unmapped as single]
          Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
            (unwind_backtrace) from [<8010bb34>] (show_stack+0x10/0x14)
            (show_stack) from [<8011ced8>] (__warn+0xf0/0x108)
            (__warn) from [<8011cf64>] (warn_slowpath_fmt+0x74/0xb8)
            (warn_slowpath_fmt) from [<8017d170>] (check_unmap+0x3fc/0xb04)
            (check_unmap) from [<8017d900>] (debug_dma_unmap_page+0x88/0x90)
            (debug_dma_unmap_page) from [<80601d68>] (dspi_release_dma+0x88/0x110)
            (dspi_release_dma) from [<80601e4c>] (dspi_shutdown+0x5c/0x80)
            (dspi_shutdown) from [<805845f8>] (device_shutdown+0x17c/0x220)
            (device_shutdown) from [<80143ef8>] (kernel_restart+0xc/0x50)
            (kernel_restart) from [<801441cc>] (__do_sys_reboot+0x18c/0x210)
            (__do_sys_reboot) from [<80100060>] (ret_fast_syscall+0x0/0x28)
          DMA-API: Mapped at:
           dma_alloc_attrs+0xa4/0x130
           dspi_probe+0x568/0x7b4
           platform_drv_probe+0x6c/0xa4
           really_probe+0x208/0x348
           driver_probe_device+0x5c/0xb4
      
      Fixes: 90ba3703 ("spi: spi-fsl-dspi: Add DMA support for Vybrid")
      Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Acked-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/1591803717-11218-1-git-send-email-krzk@kernel.orgSigned-off-by: NMark Brown <broonie@kernel.org>
      03fe7aaf
    • Q
      spi: tools: Add macro definitions to fix build errors · 7bb64402
      Qing Zhang 提交于
      Add SPI_TX_OCTAL and SPI_RX_OCTAL to fix the following build errors:
      
      CC       spidev_test.o
      spidev_test.c: In function ‘transfer’:
      spidev_test.c:131:13: error: ‘SPI_TX_OCTAL’ undeclared (first use in this function)
        if (mode & SPI_TX_OCTAL)
                   ^
      spidev_test.c:131:13: note: each undeclared identifier is reported only once for each function it appears in
      spidev_test.c:137:13: error: ‘SPI_RX_OCTAL’ undeclared (first use in this function)
        if (mode & SPI_RX_OCTAL)
                   ^
      spidev_test.c: In function ‘parse_opts’:
      spidev_test.c:290:12: error: ‘SPI_TX_OCTAL’ undeclared (first use in this function)
          mode |= SPI_TX_OCTAL;
                  ^
      spidev_test.c:308:12: error: ‘SPI_RX_OCTAL’ undeclared (first use in this function)
          mode |= SPI_RX_OCTAL;
                  ^
        LD       spidev_test-in.o
      ld: cannot find spidev_test.o: No such file or directory
      
      Additionally, maybe SPI_CS_WORD and SPI_3WIRE_HIZ will be used in the future,
      so add them too.
      
      Fixes: 896fa735 ("spi: spidev_test: Add support for Octal mode data transfers")
      Signed-off-by: NQing Zhang <zhangqing@loongson.cn>
      Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Link: https://lore.kernel.org/r/1591880212-13479-2-git-send-email-zhangqing@loongson.cnSigned-off-by: NMark Brown <broonie@kernel.org>
      7bb64402
    • Q
      spi: tools: Make default_tx/rx and input_tx static · bd207791
      Qing Zhang 提交于
      Fix the following sparse warning:
      
      ./spidev_test.c:50:9: warning: symbol 'default_tx' was not declared. Should it be static?
      ./spidev_test.c:59:9: warning: symbol 'default_rx' was not declared. Should it be static?
      ./spidev_test.c:60:6: warning: symbol 'input_tx' was not declared. Should it be static?
      Signed-off-by: NQing Zhang <zhangqing@loongson.cn>
      Link: https://lore.kernel.org/r/1591880212-13479-1-git-send-email-zhangqing@loongson.cnSigned-off-by: NMark Brown <broonie@kernel.org>
      bd207791
  10. 10 6月, 2020 1 次提交
  11. 09 6月, 2020 1 次提交
  12. 08 6月, 2020 1 次提交
  13. 02 6月, 2020 1 次提交
  14. 30 5月, 2020 10 次提交
    • A
      spi: spi-fsl-dspi: fix native data copy · 263b81dc
      Angelo Dureghello 提交于
      ColdFire is a big-endian cpu with a big-endian dspi hw module,
      so, it uses native access, but memcpy breaks the endianness.
      
      So, if i understand properly, by native copy we would mean
      be(cpu)->be(dspi) or le(cpu)->le(dspi) accesses, so my fix
      shouldn't break anything, but i couldn't test it on LS family,
      so every test is really appreciated.
      
      Fixes: 53fadb4d ("spi: spi-fsl-dspi: Simplify bytes_per_word gymnastics")
      Signed-off-by: NAngelo Dureghello <angelo.dureghello@timesys.com>
      Tested-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Link: https://lore.kernel.org/r/20200529195756.184677-1-angelo.dureghello@timesys.comSigned-off-by: NMark Brown <broonie@kernel.org>
      263b81dc
    • S
      spi: Convert DW SPI binding to DT schema · 164c05f0
      Serge Semin 提交于
      Modern device tree bindings are supposed to be created as YAML-files
      in accordance with dt-schema. This commit replaces two DW SPI legacy
      bare text bindings with YAML file. As before the bindings file states
      that the corresponding dts node is supposed to be compatible either
      with generic DW APB SSI controller or with Microsemi/Amazon/Renesas/Intel
      vendors-specific controllers, to have registers, interrupts and clocks
      properties. Though in case of Microsemi version of the controller
      there must be two registers resources specified. Properties like
      clock-names, reg-io-width, cs-gpio, num-cs, DMA and slave device
      sub-nodes are optional.
      Signed-off-by: NSerge Semin <Sergey.Semin@baikalelectronics.ru>
      Reviewed-by: NRob Herring <robh@kernel.org>
      Cc: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru>
      Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru>
      Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Feng Tang <feng.tang@intel.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: linux-mips@vger.kernel.org
      Link: https://lore.kernel.org/r/20200529182544.9807-1-Sergey.Semin@baikalelectronics.ruSigned-off-by: NMark Brown <broonie@kernel.org>
      164c05f0
    • A
      spi: dw: Refactor mid_spi_dma_setup() to separate DMA and IRQ config · 3d7db0f1
      Andy Shevchenko 提交于
      It's better to understand what bits are set for DMA and for IRQ handling
      in mid_spi_dma_setup() if they are grouped accordingly. Thus,
      refactor mid_spi_dma_setup() to separate DMA and IRQ configuration.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Link: https://lore.kernel.org/r/20200529183150.44149-2-andriy.shevchenko@linux.intel.comSigned-off-by: NMark Brown <broonie@kernel.org>
      3d7db0f1
    • A
      spi: dw: Make DMA request line assignments explicit for Intel Medfield · b3f82dc2
      Andy Shevchenko 提交于
      The 2afccbd2 ("spi: dw: Discard static DW DMA slave structures")
      did a clean up of global variables, which is fine, but messed up with
      the carefully provided information in the custom DMA slave structures.
      There reader can find an assignment of the DMA request lines in use.
      
      Partially revert the above mentioned commit to restore readability
      and maintainability of the code.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Link: https://lore.kernel.org/r/20200529183150.44149-1-andriy.shevchenko@linux.intel.comSigned-off-by: NMark Brown <broonie@kernel.org>
      b3f82dc2
    • M
      spi: bcm2835: Remove shared interrupt support · d62069c2
      Mark Brown 提交于
      This reverts commit ecfbd3cf since Lukas Wunner noticed that we
      start operating on the hardware before we check to see if this is a
      spurious interrupt.
      Reported-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      d62069c2
    • M
      Merge series "spi: dw: Add generic DW DMA controller support" from Serge Semin... · 08ba9306
      Mark Brown 提交于
      Merge series "spi: dw: Add generic DW DMA controller support" from Serge Semin <Sergey.Semin@baikalelectronics.ru>:
      
      Baikal-T1 SoC provides a DW DMA controller to perform low-speed peripherals
      Mem-to-Dev and Dev-to-Mem transaction. This is also applicable to the DW
      APB SSI devices embedded into the SoC. Currently the DMA-based transfers
      are supported by the DW APB SPI driver only as a middle layer code for
      Intel MID/Elkhart PCI devices. Seeing the same code can be used for normal
      platform DMAC device we introduced a set of patches to fix it within this
      series.
      
      First of all we need to add the Tx and Rx DMA channels support into the DW
      APB SSI binding. Then there are several fixes and cleanups provided as a
      initial preparation for the Generic DMA support integration: add Tx/Rx
      finish wait methods, clear DMAC register when done or stopped, Fix native
      CS being unset, enable interrupts in accordance with DMA xfer mode,
      discard static DW DMA slave structures, discard unused void priv pointer
      and dma_width member of the dw_spi structure, provide the DMA Tx/Rx burst
      length parametrisation and make sure it's optionally set in accordance
      with the DMA max-burst capability.
      
      In order to have the DW APB SSI MMIO driver working with DMA we need to
      initialize the paddr field with the physical base address of the DW APB SSI
      registers space. Then we unpin the Intel MID specific code from the
      generic DMA one and placed it into the spi-dw-pci.c driver, which is a
      better place for it anyway. After that the naming cleanups are performed
      since the code is going to be used for a generic DMAC device. Finally the
      Generic DMA initialization can be added to the generic version of the
      DW APB SSI IP.
      
      Last but not least we traditionally convert the legacy plain text-based
      dt-binding file with yaml-based one and as a cherry on a cake replace
      the manually written DebugFS registers read method with a ready-to-use
      for the same purpose regset32 DebugFS interface usage.
      
      This patchset is rebased and tested on the spi/for-next (5.7-rc5):
      base-commit: fe9fce6b2cf3 ("Merge remote-tracking branch 'spi/for-5.8' into spi-next")
      
      Link: https://lore.kernel.org/linux-spi/20200508132943.9826-1-Sergey.Semin@baikalelectronics.ru/
      Changelog v2:
      - Rebase on top of the spi repository for-next branch.
      - Move bindings conversion patch to the tail of the series.
      - Move fixes to the head of the series.
      - Apply as many changes as possible to be applied the Generic DMA
        functionality support is added and the spi-dw-mid is moved to the
        spi-dw-dma driver.
      - Discard patch "spi: dw: Fix dma_slave_config used partly uninitialized"
        since the problem has already been fixed.
      - Add new patch "spi: dw: Discard unused void priv pointer".
      - Add new patch "spi: dw: Discard dma_width member of the dw_spi structure".
        n_bytes member of the DW SPI data can be used instead.
      - Build the DMA functionality into the DW APB SSI core if required instead
        of creating a separate kernel module.
      - Use conditional statement instead of the ternary operator in the ref
        clock getter.
      
      Link: https://lore.kernel.org/linux-spi/20200515104758.6934-1-Sergey.Semin@baikalelectronics.ru/
      Changelog v3:
      - Use spi_delay_exec() method to wait for the DMA operation completion.
      - Explicitly initialize the dw_dma_slave members on stack.
      - Discard the dws->fifo_len utilization in the Tx FIFO DMA threshold
        setting from the patch where we just add the default burst length
        constants.
      - Use min() method to calculate the optimal burst values.
      - Add new patch which moves the spi-dw.c source file to spi-dw-core.c in
        order to preserve the DW APB SSI core driver name.
      - Add commas in the debugfs_reg32 structure initializer and after the last
        entry of the dw_spi_dbgfs_regs array.
      
      Link: https://lore.kernel.org/linux-spi/20200521012206.14472-1-Sergey.Semin@baikalelectronics.ru
      Changelog v4:
      - Get back ndelay() method to wait for an SPI transfer completion.
        spi_delay_exec() isn't suitable for the atomic context.
      
      Link: https://lore.kernel.org/linux-spi/20200522000806.7381-1-Sergey.Semin@baikalelectronics.ru
      Changelog v5:
      - Refactor the Tx/Rx DMA-based SPI transfers wait methods.
      - Add a new patch "spi: dw: Set xfer effective_speed_hz".
      - Add a new patch "spi: dw: Return any value retrieved from the
        dma_transfer callback" as a preparation patch before implementing
        the local DMA, Tx SPI and Rx SPI transfers wait methods.
      - Add a new patch "spi: dw: Locally wait for the DMA transactions
        completion", which provides a local DMA transaction complete
        method
      - Create a dedicated patch which adds the Rx-done wait method:
        "spi: dw: Add SPI Rx-done wait method to DMA-based transfer".
      - Add more detailed description of the problems the Tx/Rx-wait
        methods-related patches fix.
      - Wait for the SPI Tx and Rx transfers being finished in the
        mid_spi_dma_transfer() method executed in the task context.
      - Use spi_delay_exec() to wait for the SPI Tx/Rx completion, since now
        the driver calls the wait methods in the kernel thread context.
      - Use SPI_DELAY_UNIT_SCK spi_delay unit for Tx-wait delay, since SPI
        xfer's are now have the effective_speed_hz initialized.
      - Rx-wait for a delay correlated with the APB/SSI synchronous clock
        rate instead of using the SPI bus clock rate.
      
      Link: https://lore.kernel.org/linux-spi/20200529035915.20790-1-Sergey.Semin@baikalelectronics.ru
      Changelog v6:
      - Provide a more detailed description of the patch:
        2901db35bea1 ("spi: dw: Locally wait for the DMA transfers completion")
      - Calculate the Rx delay with better accuracy by moving 4-multiplication
        to the head of the formulae:
        ns = 4U * NSEC_PER_SEC / dws->max_freq * nents.
      Co-developed-by: NGeorgy Vlasov <Georgy.Vlasov@baikalelectronics.ru>
      Signed-off-by: NGeorgy Vlasov <Georgy.Vlasov@baikalelectronics.ru>
      Co-developed-by: NRamil Zaripov <Ramil.Zaripov@baikalelectronics.ru>
      Signed-off-by: NRamil Zaripov <Ramil.Zaripov@baikalelectronics.ru>
      Signed-off-by: NSerge Semin <Sergey.Semin@baikalelectronics.ru>
      Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
      Cc: Maxim Kaurkin <Maxim.Kaurkin@baikalelectronics.ru>
      Cc: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>
      Cc: Ekaterina Skachko <Ekaterina.Skachko@baikalelectronics.ru>
      Cc: Vadim Vlasov <V.Vlasov@baikalelectronics.ru>
      Cc: Alexey Kolotnikov <Alexey.Kolotnikov@baikalelectronics.ru>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Feng Tang <feng.tang@intel.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: linux-mips@vger.kernel.org
      Cc: linux-spi@vger.kernel.org
      Cc: devicetree@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      
      Serge Semin (16):
        spi: dw: Set xfer effective_speed_hz
        spi: dw: Return any value retrieved from the dma_transfer callback
        spi: dw: Locally wait for the DMA transfers completion
        spi: dw: Add SPI Tx-done wait method to DMA-based transfer
        spi: dw: Add SPI Rx-done wait method to DMA-based transfer
        spi: dw: Parameterize the DMA Rx/Tx burst length
        spi: dw: Use DMA max burst to set the request thresholds
        spi: dw: Fix Rx-only DMA transfers
        spi: dw: Add core suffix to the DW APB SSI core source file
        spi: dw: Move Non-DMA code to the DW PCIe-SPI driver
        spi: dw: Remove DW DMA code dependency from DW_DMAC_PCI
        spi: dw: Add DW SPI DMA/PCI/MMIO dependency on the DW SPI core
        spi: dw: Cleanup generic DW DMA code namings
        spi: dw: Add DMA support to the DW SPI MMIO driver
        spi: dw: Use regset32 DebugFS method to create regdump file
        dt-bindings: spi: Convert DW SPI binding to DT schema
      
       .../bindings/spi/snps,dw-apb-ssi.txt          |  44 --
       .../bindings/spi/snps,dw-apb-ssi.yaml         | 127 +++++
       .../devicetree/bindings/spi/spi-dw.txt        |  24 -
       drivers/spi/Kconfig                           |  15 +-
       drivers/spi/Makefile                          |   5 +-
       drivers/spi/{spi-dw.c => spi-dw-core.c}       |  95 ++--
       drivers/spi/spi-dw-dma.c                      | 482 ++++++++++++++++++
       drivers/spi/spi-dw-mid.c                      | 382 --------------
       drivers/spi/spi-dw-mmio.c                     |   4 +
       drivers/spi/spi-dw-pci.c                      |  50 +-
       drivers/spi/spi-dw.h                          |  20 +-
       11 files changed, 719 insertions(+), 529 deletions(-)
       delete mode 100644 Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.txt
       create mode 100644 Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
       delete mode 100644 Documentation/devicetree/bindings/spi/spi-dw.txt
       rename drivers/spi/{spi-dw.c => spi-dw-core.c} (82%)
       create mode 100644 drivers/spi/spi-dw-dma.c
       delete mode 100644 drivers/spi/spi-dw-mid.c
      
      --
      2.26.2
      08ba9306
    • D
    • D
      spi: dw: add reset control · 7830c0ef
      Dinh Nguyen 提交于
      Add mechanism to get the reset control and deassert it in order to bring
      the IP out of reset.
      Signed-off-by: NLiang Jin J <liang.j.jin@ericsson.com>
      Signed-off-by: NDinh Nguyen <dinguyen@kernel.org>
      Link: https://lore.kernel.org/r/20200529155806.16758-1-dinguyen@kernel.orgSigned-off-by: NMark Brown <broonie@kernel.org>
      7830c0ef
    • M
      spi: bcm2835: Enable shared interrupt support · ecfbd3cf
      Martin Sperl 提交于
      bcm2711, Rasberry Pi 4's SoC, shares one interrupt for multiple
      instances of the bcm2835 SPI controller. So this enables shared
      interrupt support for them.
      
      The early bail out in the interrupt routine avoids messing with buffers
      of transfers being done by other means. Otherwise, the driver can handle
      receiving interrupts asserted by other controllers during an IRQ based
      transfer.
      Signed-off-by: NMartin Sperl <kernel@martin.sperl.org>
      Signed-off-by: NNicolas Saenz Julienne <nsaenzjulienne@suse.de>
      Tested-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20200528185805.28991-1-nsaenzjulienne@suse.deSigned-off-by: NMark Brown <broonie@kernel.org>
      ecfbd3cf
    • F
      spi: bcm2835: Implement shutdown callback · 118eb0e5
      Florian Fainelli 提交于
      Make sure we clear the FIFOs, stop the block, disable the clock and
      release the DMA channel.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20200528190605.24850-1-f.fainelli@gmail.comSigned-off-by: NMark Brown <broonie@kernel.org>
      118eb0e5
  15. 29 5月, 2020 9 次提交