1. 24 11月, 2017 1 次提交
    • R
      spi: xilinx: Detect stall with Unknown commands · 5a1314fa
      Ricardo Ribalda 提交于
      When the core is configured in C_SPI_MODE > 0, it integrates a
      lookup table that automatically configures the core in dual or quad mode
      based on the command (first byte on the tx fifo).
      
      Unfortunately, that list mode_?_memoy_*.mif does not contain all the
      supported commands by the flash.
      
      Since 4.14 spi-nor automatically tries to probe the flash using SFDP
      (command 0x5a), and that command is not part of the list_mode table.
      
      Whit the right combination of C_SPI_MODE and C_SPI_MEMORY this leads
      into a stall that can only be recovered with a soft rest.
      
      This patch detects this kind of stall and returns -EIO to the caller on
      those commands. spi-nor can handle this error properly:
      
      m25p80 spi0.0: Detected stall. Check C_SPI_MODE and C_SPI_MEMORY. 0x21 0x2404
      m25p80 spi0.0: SPI transfer failed: -5
      spi_master spi0: failed to transfer one message from queue
      m25p80 spi0.0: s25sl064p (8192 Kbytes)
      Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      5a1314fa
  2. 15 7月, 2016 2 次提交
  3. 29 10月, 2015 1 次提交
    • R
      spi/spi-xilinx: Fix race condition on last word read · eca37c7c
      Ricardo Ribalda Delgado 提交于
      Some users have reported that in polled mode the driver fails randomly
      to read the last word of the transfer.
      
      The end condition used for the transmissions (in polled and irq mode)
      has been the TX_EMPTY flag. But Lars-Peter Clausen has identified a delay
      from the TX_EMPTY to the actual end of the data rx.
      
      I believe that this race condition has not been detected until now
      because of the latency added by the IRQ handler or the PCIe bridge.
      This bugs affects setups with low latency access to the spi core.
      
      This patch replaces the readout logic:
      
      For all the words, except the last one, the TX_EMPTY flag is used (and
      cached).
      
      If !TX_EMPY or is the last word. The status register is read and the
      RX_EMPTY flag is used.
      
      The performance is not affected: there is an extra read of the
      Status Register, but the readout can start as soon as there is a word
      in the buffer.
      Reported-by: NEdward Kigwana <ekigwana@scires.com>
      Initial-fix-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      eca37c7c
  4. 14 8月, 2015 1 次提交
  5. 13 8月, 2015 1 次提交
  6. 02 2月, 2015 1 次提交
  7. 30 1月, 2015 1 次提交
  8. 29 1月, 2015 15 次提交
  9. 28 1月, 2015 1 次提交
  10. 27 1月, 2015 2 次提交
  11. 17 8月, 2014 1 次提交
  12. 10 7月, 2014 1 次提交
  13. 27 2月, 2014 1 次提交
  14. 23 2月, 2014 1 次提交
  15. 03 2月, 2014 1 次提交
  16. 15 11月, 2013 1 次提交
  17. 07 10月, 2013 1 次提交
    • A
      spi: bitbang: Let spi_bitbang_start() take a reference to master · 702a4879
      Axel Lin 提交于
      Many drivers that use bitbang library have a leak on probe error paths.
      This is because once a spi_master_get() call succeeds, we need an additional
      spi_master_put() call to free the memory.
      
      Fix this issue by moving the code taking a reference to master to
      spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on
      success. With this change, the caller is responsible for calling
      spi_bitbang_stop() to decrement the reference and spi_master_put() as
      counterpart of spi_alloc_master() to prevent a memory leak.
      
      So now we have below patten for drivers using bitbang library:
      
      probe:
      spi_alloc_master        -> Init reference count to 1
      spi_bitbang_start       -> Increment reference count
      remove:
      spi_bitbang_stop        -> Decrement reference count
      spi_master_put          -> Decrement reference count (reference count reaches 0)
      
      Fixup all users accordingly.
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Suggested-by: NUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
      Acked-by: NUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      702a4879
  18. 17 9月, 2013 1 次提交
    • A
      spi: bitbang: Let spi_bitbang_start() take a reference to master · 94c69f76
      Axel Lin 提交于
      Many drivers that use bitbang library have a leak on probe error paths.
      This is because once a spi_master_get() call succeeds, we need an additional
      spi_master_put() call to free the memory.
      
      Fix this issue by moving the code taking a reference to master to
      spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on
      success. With this change, the caller is responsible for calling
      spi_bitbang_stop() to decrement the reference and spi_master_put() as
      counterpart of spi_alloc_master() to prevent a memory leak.
      
      So now we have below patten for drivers using bitbang library:
      
      probe:
      spi_alloc_master        -> Init reference count to 1
      spi_bitbang_start       -> Increment reference count
      remove:
      spi_bitbang_stop        -> Decrement reference count
      spi_master_put          -> Decrement reference count (reference count reaches 0)
      
      Fixup all users accordingly.
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Suggested-by: NUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
      Acked-by: NUwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      94c69f76
  19. 29 8月, 2013 1 次提交
  20. 10 8月, 2013 1 次提交
  21. 18 7月, 2013 1 次提交
  22. 15 7月, 2013 3 次提交