1. 01 Aug, 2018 4 commits
  2. 31 Jul, 2018 1 commit
  3. 30 Jul, 2018 4 commits
  4. 26 Jul, 2018 1 commit
  5. 24 Jul, 2018 6 commits
  6. 18 Jul, 2018 3 commits
  7. 17 Jul, 2018 2 commits
  8. 02 Jul, 2018 1 commit
    • Krzysztof Kozlowski's avatar
      spi: spi-fsl-dspi: Fix imprecise abort on VF500 during probe · d8ffee2f
      Krzysztof Kozlowski authored
      Registers of DSPI should not be accessed before enabling its clock.  On
      Toradex Colibri VF50 on Iris carrier board this could be seen during
      bootup as imprecise abort:
      
          Unhandled fault: imprecise external abort (0x1c06) at 0x00000000
          Internal error: : 1c06 [#1] ARM
          Modules linked in:
          CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.39-dirty #97
          Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
          Backtrace:
          [<804166a8>] (regmap_write) from [<80466b5c>] (dspi_probe+0x1f0/0x8dc)
          [<8046696c>] (dspi_probe) from [<8040107c>] (platform_drv_probe+0x54/0xb8)
          [<80401028>] (platform_drv_probe) from [<803ff53c>] (driver_probe_device+0x280/0x2f8)
          [<803ff2bc>] (driver_probe_device) from [<803ff674>] (__driver_attach+0xc0/0xc4)
          [<803ff5b4>] (__driver_attach) from [<803fd818>] (bus_for_each_dev+0x70/0xa4)
          [<803fd7a8>] (bus_for_each_dev) from [<803fee74>] (driver_attach+0x24/0x28)
          [<803fee50>] (driver_attach) from [<803fe980>] (bus_add_driver+0x1a0/0x218)
          [<803fe7e0>] (bus_add_driver) from [<803fffe8>] (driver_register+0x80/0x100)
          [<803fff68>] (driver_register) from [<80400fdc>] (__platform_driver_register+0x48/0x50)
          [<80400f94>] (__platform_driver_register) from [<8091cf7c>] (fsl_dspi_driver_init+0x1c/0x20)
          [<8091cf60>] (fsl_dspi_driver_init) from [<8010195c>] (do_one_initcall+0x4c/0x174)
          [<80101910>] (do_one_initcall) from [<80900e8c>] (kernel_init_freeable+0x144/0x1d8)
          [<80900d48>] (kernel_init_freeable) from [<805ff6a8>] (kernel_init+0x10/0x114)
          [<805ff698>] (kernel_init) from [<80107be8>] (ret_from_fork+0x14/0x2c)
      
      Cc: <stable@vger.kernel.org>
      Fixes: 5ee67b58 ("spi: dspi: clear SPI_SR before enable interrupt")
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      d8ffee2f
  9. 28 Jun, 2018 1 commit
  10. 21 Jun, 2018 1 commit
  11. 20 Jun, 2018 13 commits
  12. 19 Jun, 2018 1 commit
    • Jan Kundrát's avatar
      spi: orion: fix CS GPIO handling again · fb9acf5f
      Jan Kundrát authored
      The code did not de-assert any CS GPIOs before probing slaves. This
      means that several CS signals could be active at once, garbling the
      communication. Whether this was actually a problem depended on the type
      of the SPI device attached (so my "spidev" for userspace access worked
      correctly because its probe was effectively a no-op), and on the state
      of the GPIO pins at SoC's boot.
      
      The code was already iterating through all DT children of the SPI
      controller, so this change re-uses that loop for CS GPIO setup as well.
      This means that this might change the number of the HW CS signal which
      is picked for all GPIO CS devices. Previously, the lowest one was used,
      but we now use the first one from the DT.
      
      With this move of the code, we can also finally initialize each GPIO CS
      lane before registering the SPI controller (which in turn probes for
      slaves).
      
      I tried to fix this in 54424862 already, but that only did it half
      way by registering the GPIOs properly. That patch failed to set their
      logic signals early enough, though.
      Signed-off-by: default avatarJan Kundrát <jan.kundrat@cesnet.cz>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      fb9acf5f
  13. 18 Jun, 2018 2 commits
    • Janek Kotas's avatar
      spi: cadence: Change usleep_range() to udelay(), for atomic context · 931c4e9a
      Janek Kotas authored
      The path "spi: cadence: Add usleep_range() for
      cdns_spi_fill_tx_fifo()" added a usleep_range() function call,
      which cannot be used in atomic context.
      However the cdns_spi_fill_tx_fifo() function can be called during
      an interrupt which may result in a kernel panic:
      
      BUG: scheduling while atomic: grep/561/0x00010002
      Modules linked in:
      Preemption disabled at:
      [<ffffff800858ea28>] wait_for_common+0x48/0x178
      CPU: 0 PID: 561 Comm: grep Not tainted 4.17.0 #1
      Hardware name: Cadence CSP (DT)
      Call trace:
       dump_backtrace+0x0/0x198
       show_stack+0x14/0x20
       dump_stack+0x8c/0xac
       __schedule_bug+0x6c/0xb8
       __schedule+0x570/0x5d8
       schedule+0x34/0x98
       schedule_hrtimeout_range_clock+0x98/0x110
       schedule_hrtimeout_range+0x10/0x18
       usleep_range+0x64/0x98
       cdns_spi_fill_tx_fifo+0x70/0xb0
       cdns_spi_irq+0xd0/0xe0
       __handle_irq_event_percpu+0x9c/0x128
       handle_irq_event_percpu+0x34/0x88
       handle_irq_event+0x48/0x78
       handle_fasteoi_irq+0xbc/0x1b0
       generic_handle_irq+0x24/0x38
       __handle_domain_irq+0x84/0xf8
       gic_handle_irq+0xc4/0x180
      
      This patch replaces the function call with udelay() which can be
      used in an atomic context, like an interrupt.
      Signed-off-by: default avatarJan Kotas <jank@cadence.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      931c4e9a
    • Geert Uytterhoeven's avatar
      spi: sh-msiof: Make sure all DMA operations have completed · 08ba7ae3
      Geert Uytterhoeven authored
      In case of a bi-directional transfer, receive DMA may complete in the
      rcar-dmac driver before transmit DMA, due to scheduling latencies.
      As the MSIOF driver waits for completion of the receive DMA only, it may
      submit the next transmit DMA request before the previous one has
      completed.
      
      Make the driver more robust by waiting for the completion of both
      receive and transmit DMA, when applicable.
      
      Based on a patch in the BSP by Ryo Kataoka.
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      08ba7ae3