1. 21 5月, 2018 1 次提交
    • T
      spi: omap2-mcspi: Remove unnecessary pm_runtime_force_suspend() · d073bfa5
      Tony Lindgren 提交于
      Commit 5a686b2c ("spi: omap2-mcspi: Idle hardware during suspend
      and resume") added calls for pm_runtime_force_suspend() and
      pm_runtime_force_resume() to make sure spi is idled between
      device_prepare() and device_complete().
      
      But testing Linux next, I now noticed that we will get the following:
      
      spi_master spi0: Failed to power device: -13
      
      Looking at things more turns out we can just remove this non-standard
      code. I was probably testing with some extra experimental patches
      earlier when I thought we need pm_runtime_force_suspend() and
      pm_runtime_force_resume().
      
      Fixes: 5a686b2c ("spi: omap2-mcspi: Idle hardware during suspend
      and resume")
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      d073bfa5
  2. 02 5月, 2018 2 次提交
    • T
      spi: omap2-mcspi: Idle hardware during suspend and resume · 5a686b2c
      Tony Lindgren 提交于
      We currently are calling mcspi suspend and resume without considering
      that mcspi might provide resources for other device driver such as
      regulators. This means resume can fail and will produce -EACCES if
      errors if anything calls mcspi functions between device_prepare()
      and device_complete().
      
      To fix the issue, let's do the following changes:
      
      1. Let's add checking for return values for pm_runtime_get calls,
         and call pm_runtime_put_noidle() on errors. Things still fail
         after this change, but at least we see something is wrong as
         we now see -EACCES errors on resume.
      
      2. Let's use noirq level for suspend and resume as other drivers
         can still call SPI related functions on suspend and resume. This
         still won't fix the -EACCES issue, but gets us to something a bit
         saner.
      
      3. Finally, let's modify suspend and resume to call to make sure
         the device is idled properly on suspend. We have device_prepare()
         call pm_runtime_get_noresume() that won't get released until in
         device_complete() when it calls pm_runtime_put(). So if SPI is
         still active on entering suspend, it will never get idled unless
         we add calls to pm_runtime_force_suspend() and resume. This also
         fixes the -EACCES errors on resume together with changes 1 and 2
         above.
      
      And since we're already rewriting suspend resume functions, let's
      arrange the order of suspend and resume functions to be like they
      usually are with suspend first.
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      5a686b2c
    • T
      spi: omap2-mcspi: Restore context always in runtime_resume · 52e9a5bb
      Tony Lindgren 提交于
      We can have the SoC enter off mode also during idle, not just
      during suspend. Currently we are handling the CS restore properly
      for unused CS only for resume and not for runtime resume.
      
      Let's just move all the context related restore to runtime_resume().
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      52e9a5bb
  3. 18 8月, 2017 1 次提交
  4. 26 5月, 2017 1 次提交
  5. 25 3月, 2017 1 次提交
    • A
      spi: omap2-mcspi: poll OMAP2_MCSPI_CHSTAT_RXS for PIO transfer · 81261359
      Akinobu Mita 提交于
      When running the spi-loopback-test with slower clock rate like 10 KHz,
      the test for 251 bytes transfer was failed.  This failure triggered an
      spi-omap2-mcspi's error message "DMA RX last word empty".
      
      This message means that PIO for reading the remaining bytes due to the
      DMA transfer length reduction is failed.  This problem can be fixed by
      polling OMAP2_MCSPI_CHSTAT_RXS bit in channel status register to wait
      until the receive buffer register is filled.
      
      Cc: Mark Brown <broonie@kernel.org>
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      81261359
  6. 24 10月, 2016 1 次提交
  7. 21 10月, 2016 1 次提交
  8. 08 7月, 2016 1 次提交
    • F
      spi: omap2-mcspi: Use the SPI framework to handle DMA mapping · 0ba1870f
      Franklin S Cooper Jr 提交于
      Currently, the driver handles mapping buffers to be used by the DMA.
      However, there are times that the current mapping implementation will
      fail for certain buffers. Fortunately, the SPI framework can detect
      and map buffers so its usable by the DMA.
      
      Update the driver to utilize the SPI framework for buffer
      mapping instead. Also incorporate hooks that the framework uses to
      determine if the DMA can or can not be used.
      
      This will result in the original omap2_mcspi_transfer_one function being
      deleted and omap2_mcspi_work_one being renamed to
      omap2_mcspi_transfer_one. Previously transfer_one was only responsible
      for mapping and work_one handled the transfer. But now only transferring
      needs to be handled by the driver.
      Signed-off-by: NFranklin S Cooper Jr <fcooper@ti.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      0ba1870f
  9. 05 7月, 2016 1 次提交
  10. 30 4月, 2016 1 次提交
  11. 12 4月, 2016 1 次提交
  12. 23 3月, 2016 1 次提交
  13. 13 2月, 2016 1 次提交
    • T
      spi: omap2-mcspi: Fix PM regression with deferred probe for pm_runtime_reinit · 0e6f357a
      Tony Lindgren 提交于
      Commit 5de85b9d ("PM / runtime: Re-init runtime PM states at probe
      error and driver unbind") introduced pm_runtime_reinit() that is used
      to reinitialize PM runtime after -EPROBE_DEFER. This allows shutting
      down the device after a failed probe.
      
      However, for drivers using pm_runtime_use_autosuspend() this can cause
      a state where suspend callback is never called after -EPROBE_DEFER.
      On the following device driver probe, hardware state is different from
      the PM runtime state causing omap_device to produce the following
      error:
      
      omap_device_enable() called from invalid state 1
      
      And with omap_device and omap hardware being picky for PM, this will
      block any deeper idle states in hardware.
      
      The solution is to fix the drivers to follow the PM runtime documentation:
      
      1. For sections of code that needs the device disabled, use
         pm_runtime_put_sync_suspend() if pm_runtime_set_autosuspend() has
         been set.
      
      2. For driver exit code, use pm_runtime_dont_use_autosuspend() before
         pm_runtime_put_sync() if pm_runtime_use_autosuspend() has been
         set.
      
      Fixes: 5de85b9d ("PM / runtime: Re-init runtime PM states at probe
      error and driver unbind")
      Cc: linux-spi@vger.kernel.org
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Nishanth Menon <nm@ti.com>
      Cc: Rafael J. Wysocki <rafael@kernel.org>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      0e6f357a
  14. 02 12月, 2015 1 次提交
  15. 20 11月, 2015 1 次提交
  16. 22 10月, 2015 1 次提交
    • N
      spi: omap2-mcspi: disable other channels CHCONF_FORCE in prepare_message · 468a3208
      Neil Armstrong 提交于
      Since the "Switch driver to use transfer_one" change, the cs_change
      behavior has changed and a channel chip select can still be
      asserted when changing channel from a previous last transfer in a
      message having the cs_change attribute.
      
      Since there is no sense having multiple chip select being asserted at the
      same time, disable all the remaining forced chip selects in a the
      prepare_message called right before a spi_transfer_one_message call.
      It ignores the current channel configuration in order to keep the
      possibility to leave the chip select asserted between messages.
      
      It fixes this bug on a DM8168 SoC ES2.1 Soc and an OMAP4 ES2.1 SoC.
      It was hanging all the other channels transfers when a CHCONF_FORCE
      is present on the wrong channel.
      
      Fixes: b28cb941 ("spi: omap2-mcspi: Switch driver to use transfer_one")
      Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
      Reviewed-by: NMichael Welling <mwelling@ieee.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      468a3208
  17. 25 7月, 2015 1 次提交
  18. 25 5月, 2015 4 次提交
  19. 13 5月, 2015 1 次提交
  20. 09 5月, 2015 1 次提交
  21. 08 5月, 2015 1 次提交
  22. 24 4月, 2015 1 次提交
  23. 22 12月, 2014 1 次提交
  24. 20 10月, 2014 1 次提交
  25. 12 8月, 2014 1 次提交
  26. 04 7月, 2014 1 次提交
    • M
      spi: omap2-mcspi: Configure hardware when slave driver changes mode · 97ca0d6c
      Mark A. Greer 提交于
      Commit id 2bd16e3e
      (spi: omap2-mcspi: Do not configure the controller
      on each transfer unless needed) does its job too
      well so omap2_mcspi_setup_transfer() isn't called
      even when an SPI slave driver changes 'spi->mode'.
      The result is that the mode requested by the SPI
      slave driver never takes effect.
      
      Fix this by adding the 'mode' member to the
      omap2_mcspi_cs structure which holds the mode
      value that the hardware is configured for.
      When the SPI slave driver changes 'spi->mode'
      it will be different than the value of this new
      member and the SPI master driver will know that
      the hardware must be reconfigured (by calling
      omap2_mcspi_setup_transfer()).
      
      Fixes: 2bd16e3e (spi: omap2-mcspi: Do not configure the controller on each transfer unless needed)
      Signed-off-by: NMark A. Greer <mgreer@animalcreek.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      Cc: stable@vger.kernel.org
      97ca0d6c
  27. 03 4月, 2014 1 次提交
  28. 19 2月, 2014 2 次提交
  29. 04 2月, 2014 2 次提交
  30. 03 2月, 2014 1 次提交
  31. 24 11月, 2013 1 次提交
  32. 17 10月, 2013 1 次提交
  33. 10 10月, 2013 1 次提交
  34. 26 9月, 2013 1 次提交