1. 01 10月, 2013 2 次提交
  2. 16 8月, 2013 2 次提交
  3. 31 7月, 2013 3 次提交
  4. 21 7月, 2013 3 次提交
  5. 26 6月, 2013 1 次提交
  6. 17 6月, 2013 1 次提交
  7. 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
  8. 11 4月, 2013 4 次提交
  9. 27 3月, 2013 2 次提交
  10. 06 3月, 2013 2 次提交
  11. 12 2月, 2013 1 次提交
  12. 29 11月, 2012 1 次提交
  13. 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
  14. 16 10月, 2012 1 次提交
  15. 13 9月, 2012 1 次提交
  16. 11 9月, 2012 2 次提交
  17. 18 7月, 2012 1 次提交
  18. 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
  19. 27 6月, 2012 1 次提交
    • G
      gpio/omap: fix irq loss while in idle with debounce on · 9e303f22
      Grazvydas Ignotas 提交于
      It seems that currently GPIO module is not working correctly during idle
      when debounce is enabled - the system almost never responds to button
      presses (observed on OMAP3530 ES2.1 and OMAP3630 ES1.2 pandora boards).
      Even though wakeups are probably working, it seems that the GPIO module
      itself is unable to detect input events and generate interrupts.
      OMAP35x TRM also states that:
        "If the debounce clock is inactive, the debounce cell gates all
         input signals and thus cannot be used."
      
      So whenever we are disabling debounce clocks (for PM or other reasons),
      be sure the module's debounce feature is disabled too.
      
      Cc: Kevin Hilman <khilman@ti.com>
      Signed-off-by: NGrazvydas Ignotas <notasas@gmail.com>
      Signed-off-by: NKevin Hilman <khilman@ti.com>
      9e303f22
  20. 18 5月, 2012 2 次提交
    • K
      gpio/omap: (re)fix wakeups on level-triggered GPIOs · b3c64bc3
      Kevin Hilman 提交于
      commit 1b128703 (gpio/omap: fix missing check in *_runtime_suspend())
      broke wakeups on level-triggered GPIOs by adding the enabled
      non-wakeup GPIO check before the workaround that enables wakeups
      on level-triggered IRQs, effectively disabling that workaround.
      
      To fix, move the enabled non-wakeup GPIO check after the
      level-triggered IRQ workaround.
      Reported-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Acked-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Acked-by: NTarun Kanti DebBarma <tarun.kanti@ti.com>
      Tested-by: NTarun Kanti DebBarma <tarun.kanti@ti.com>
      Signed-off-by: NKevin Hilman <khilman@ti.com>
      b3c64bc3
    • K
      gpio/omap: fix broken context restore for non-OFF mode transitions · 22770de1
      Kevin Hilman 提交于
      The fix in commit 1b128703 (gpio/omap: fix missing check in
      *_runtime_suspend()) exposed another bug in the context restore path.
      
      Currently, the per-bank context restore happens whenever the context
      loss count is different in runtime suspend and runtime resume *and*
      whenever the per-bank contex_loss_count == 0:
      
      	if (context_lost_cnt_after != bank->context_loss_count ||
      					!context_lost_cnt_after) {
      		omap_gpio_restore_context(bank);
      
      Restoring context when the context_lost_cnt_after == 0 is clearly
      wrong, since this will be true until the first off-mode transition
      (which could be never, if off-mode is never enabled.)  This check
      causes the context to be restored on *every* runtime PM transition.
      
      Before commit 1b128703 (gpio/omap: fix missing check in
      *_runtime_suspend()), this code was never executed in non-OFF mode, so
      there were never spurious context restores happening.  After that
      change though, spurious context restores could happen.
      
      To fix, simply remove the !context_lost_cnt_after check. It is not
      needed.
      
      This bug was found when noticing that the smc911x NIC on 3530/Overo
      was not working, and git bisect tracked it down to this patch.  It
      seems that the spurious context restore was causing the smsc911x to
      not be properly probed on this platform.
      Tested-by: NTony Lindgren <tony@atomide.com>
      Acked-by: NTarun Kanti DebBarma <tarun.kanti@ti.com>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: NKevin Hilman <khilman@ti.com>
      22770de1
  21. 12 5月, 2012 7 次提交