1. 09 7月, 2014 1 次提交
  2. 16 5月, 2014 1 次提交
  3. 04 5月, 2014 1 次提交
  4. 29 4月, 2014 4 次提交
  5. 24 2月, 2014 1 次提交
  6. 25 11月, 2013 1 次提交
  7. 16 10月, 2013 1 次提交
  8. 01 10月, 2013 2 次提交
  9. 16 8月, 2013 2 次提交
  10. 31 7月, 2013 3 次提交
  11. 21 7月, 2013 3 次提交
  12. 26 6月, 2013 1 次提交
  13. 17 6月, 2013 1 次提交
  14. 14 5月, 2013 1 次提交
    • J
      gpio/omap: ensure gpio context is initialised · 352a2d5b
      Jon Hunter 提交于
      Commit a2797bea (gpio/omap: force restore if context loss is not
      detectable) broke gpio support for OMAP when booting with device-tree
      because a restore of the gpio context being performed without ever
      initialising the gpio context. In other words, the context restored was
      bad.
      
      This problem could also occur in the non device-tree case, however, it
      is much less likely because when booting without device-tree we can
      detect context loss via a platform specific API and so context restore
      is performed less often.
      
      Nevertheless we should ensure that the gpio context is initialised
      on the first pm-runtime resume for gpio banks that could lose their
      state regardless of whether we are booting with device-tree or not.
      
      The context loss count was being initialised on the first pm-runtime
      suspend following a resume, by populating the get_count_loss_count()
      function pointer after the first pm-runtime resume. To make the code
      more readable and logical, initialise the context loss count on the
      first pm-runtime resume if the context is not yet valid.
      Reported-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      Acked-by: Santosh Shilimkar<santosh.shilimkar@ti.com>
      Reviewed-by: NKevin Hilman <khilman@linaro.org>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      352a2d5b
  15. 11 4月, 2013 4 次提交
  16. 27 3月, 2013 2 次提交
  17. 06 3月, 2013 2 次提交
  18. 12 2月, 2013 1 次提交
  19. 29 11月, 2012 1 次提交
  20. 28 10月, 2012 1 次提交
    • J
      gpio/omap: fix off-mode bug: clear debounce settings on free/reset · c9c55d92
      Jon Hunter 提交于
      This change was originally titled "gpio/omap: fix off-mode bug: clear debounce
      clock enable mask on free/reset". The title has been updated slightly to
      reflect (what should be) the final fix.
      
      When a GPIO is freed or shutdown, we need to ensure that any debounce settings
      are cleared and if the GPIO is the only GPIO in the bank that is currently
      using debounce, then disable the debounce clock as well to save power.
      
      Currently, the debounce settings are not cleared on a GPIO free or shutdown and
      so during a context restore on subsequent off-mode transition, the previous
      debounce values are restored from the shadow copies (bank->context.debounce*)
      leading to mismatch state between driver state and hardware state.
      
      This was discovered when board code was doing
      
        gpio_request_one()
        gpio_set_debounce()
        gpio_free()
      
      which was leaving the GPIO debounce settings in a confused state.  If that GPIO
      bank is subsequently used with off-mode enabled, bogus state would be restored,
      leaving GPIO debounce enabled which then prevented the CORE powerdomain from
      transitioning.
      
      To fix this, introduce a new function called _clear_gpio_debounce() to clear
      any debounce settings when the GPIO is freed or shutdown. If this GPIO is the
      last debounce-enabled GPIO in the bank, the debounce will also be cut.
      
      Please note that we cannot use _gpio_dbck_disable() to disable the debounce
      clock because this has been specifically created for the gpio suspend path
      and is intended to shutdown the debounce clock while debounce is enabled.
      
      Special thanks to Kevin Hilman for root causing the bug. This fix is a
      collaborative effort with inputs from Kevin Hilman, Grazvydas Ignotas and
      Santosh Shilimkar.
      
      Testing:
      - This has been unit tested on an OMAP3430 Beagle board, by requesting a gpio,
        enabling debounce and then freeing the gpio and checking the register
        contents, the saved register context and the debounce clock state.
      - Kevin Hilman tested on 37xx/EVM board which configures GPIO debounce for the
        ads7846 touchscreen in its board file using the above sequence, and so was
        failing off-mode tests in dynamic idle. Verified that off-mode tests are
        passing with this patch.
      
      V5 changes:
      - Corrected author
      Reported-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Igor Grinberg <grinberg@compulab.co.il>
      Cc: Grazvydas Ignotas <notasas@gmail.com>
      Cc: Jon Hunter <jon-hunter@ti.com>
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      Reviewed-by: NKevin Hilman <khilman@ti.com>
      Tested-by: NKevin Hilman <khilman@ti.com>
      Acked-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      c9c55d92
  21. 16 10月, 2012 1 次提交
  22. 13 9月, 2012 1 次提交
  23. 11 9月, 2012 2 次提交
  24. 18 7月, 2012 1 次提交
  25. 04 7月, 2012 1 次提交
    • J
      gpio/omap: fix invalid context restore of gpio bank-0 · 7b86cef3
      Jon Hunter 提交于
      Currently the gpio _runtime_resume/suspend functions are calling the
      get_context_loss_count() platform function if the function is populated for
      a gpio bank. This function is used to determine if the gpio bank logic state
      needs to be restored due to a power transition. This function will be populated
      for all banks, but it should only be called for banks that have the
      "loses_context" variable set. It is pointless to call this if loses_context is
      false as we know the context will never be lost and will not need restoring.
      
      For all OMAP2+ devices gpio bank-0 is in an always-on power domain and so will
      never lose context. We found that the get_context_loss_count() was being called
      for bank-0 during the probe and returning 1 instead of 0 indicating that the
      context had been lost. This was causing the context restore function to be
      called at probe time for this bank and because the context had never been saved,
      was restoring an invalid state. This ultimately resulted in a crash [1].
      
      This issue is a regression that was exposed by commit 1b128703 (gpio/omap: fix
      missing check in *_runtime_suspend()).
      
      There are multiple bugs here that need to be addressed ...
      
      1. Why the always-on power domain returns a context loss count of 1? This needs
         to be fixed in the power domain code [2]. However, the gpio driver should not
         assume the loss count is 0 to begin with.
      2. The omap gpio driver should never be calling get_context_loss_count for a
         gpio bank in a always-on domain. This is pointless and adds unneccessary
         overhead.
      3. The OMAP gpio driver assumes that the initial power domain context loss count
         will be 0 at the time the gpio driver is probed. However, it could be
         possible that this is not the case and an invalid context restore could be
         performed during the probe. To avoid this only populate the
         get_context_loss_count() function pointer after the initial call to
         pm_runtime_get() has occurred. This will ensure that the first
         pm_runtime_put() initialised the loss count correctly.
      
      This patch addresses issues 2 and 3 above.
      
      [1] http://marc.info/?l=linux-omap&m=134065775323775&w=2
      [2] http://marc.info/?l=linux-omap&m=134100413303810&w=2
      
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Linus Walleij <linus.walleij@stericsson.com>
      Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>
      Cc: Franky Lin <frankyl@broadcom.com>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Cc: NeilBrown <neilb@suse.de>
      Reported-by: NFranky Lin <frankyl@broadcom.com>
      Reviewed-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: NFranky Lin <frankyl@broadcom.com>
      Acked-by: NKevin Hilman <khilman@ti.com>
      Tested-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      Signed-off-by: NKevin Hilman <khilman@ti.com>
      7b86cef3