1. 18 Jul, 2018 1 commit
    • Alexandre Belloni's avatar
      spi: dw: fix possible race condition · 66b19d76
      Alexandre Belloni authored
      It is possible to get an interrupt as soon as it is requested.  dw_spi_irq
      does spi_controller_get_devdata(master) and expects it to be different than
      NULL. However, spi_controller_set_devdata() is called after request_irq(),
      resulting in the following crash:
      
      CPU 0 Unable to handle kernel paging request at virtual address 00000030, epc == 8058e09c, ra == 8018ff90
      [...]
      Call Trace:
      [<8058e09c>] dw_spi_irq+0x8/0x64
      [<8018ff90>] __handle_irq_event_percpu+0x70/0x1d4
      [<80190128>] handle_irq_event_percpu+0x34/0x8c
      [<801901c4>] handle_irq_event+0x44/0x80
      [<801951a8>] handle_level_irq+0xdc/0x194
      [<8018f580>] generic_handle_irq+0x38/0x50
      [<804c6924>] ocelot_irq_handler+0x104/0x1c0
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      66b19d76
  2. 11 Jul, 2018 1 commit
  3. 20 Jun, 2018 1 commit
  4. 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
  5. 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
  6. 04 Jun, 2018 1 commit
  7. 31 May, 2018 1 commit
  8. 24 May, 2018 1 commit
  9. 22 May, 2018 1 commit
  10. 21 May, 2018 2 commits
  11. 17 May, 2018 2 commits
  12. 13 May, 2018 1 commit
  13. 11 May, 2018 6 commits
  14. 10 May, 2018 1 commit
  15. 09 May, 2018 1 commit
    • Rafał Miłecki's avatar
      spi: remove the older/duplicated bcm53xx driver · 331bbcfc
      Rafał Miłecki authored
      This driver was added by commit 0fc6a323 ("spi: bcm53xx: driver for
      SPI controller on Broadcom bcma SoC") back in 2014. It was needed to
      provide a minimal support for SPI controller on BCM5301X (AKA Northstar)
      devices.
      
      An alternative driver was added by Kamal in commit fa236a7e ("spi:
      bcm-qspi: Add Broadcom MSPI driver") 2 years later. It supports the same
      hardware but for some reason a new driver has been developed for it.
      
      At this point the new driver supports: more modes, setting a speed,
      setting bits per word and uses IRQs instead of polling. DTS file for
      BCM5301X has also been updated in the commit 1c8f4065 ("ARM: dts:
      BCM5301X: convert to iProc QSPI") - over a year ago.
      
      That explained I see no reason to keep the old driver alive.
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      331bbcfc
  16. 03 May, 2018 5 commits
  17. 01 May, 2018 5 commits
  18. 27 Apr, 2018 1 commit
  19. 26 Apr, 2018 2 commits
  20. 25 Apr, 2018 1 commit
  21. 24 Apr, 2018 1 commit
  22. 23 Apr, 2018 2 commits