1. 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
  2. 14 8月, 2015 1 次提交
  3. 13 8月, 2015 1 次提交
  4. 02 2月, 2015 1 次提交
  5. 30 1月, 2015 1 次提交
  6. 29 1月, 2015 15 次提交
  7. 28 1月, 2015 1 次提交
  8. 27 1月, 2015 2 次提交
  9. 17 8月, 2014 1 次提交
  10. 10 7月, 2014 1 次提交
  11. 27 2月, 2014 1 次提交
  12. 23 2月, 2014 1 次提交
  13. 03 2月, 2014 1 次提交
  14. 15 11月, 2013 1 次提交
  15. 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
  16. 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
  17. 29 8月, 2013 1 次提交
  18. 10 8月, 2013 1 次提交
  19. 18 7月, 2013 1 次提交
  20. 15 7月, 2013 6 次提交