1. 23 7月, 2020 1 次提交
  2. 20 7月, 2020 1 次提交
  3. 30 6月, 2020 1 次提交
    • T
      gpio: omap: Add missing PM ops for suspend · f02a0398
      Tony Lindgren 提交于
      We've had the legacy platform code take care of suspend for us but
      this no longer is the case when probed without legacy mode with
      ti-sysc. We need to configure PM ops like standard Linux device
      drivers do.
      
      As we still have some SoCs booting also the legacy mode, we need to
      add omap_gpio_suspend() and omap_gpio_resume(), and check for the
      is_suspended flag to avoid legacy _od_suspend_noirq() calling them
      on an already suspended GPIO instance.
      
      Once we have no SoCs booting in legacy mode, we can just switch to
      using the standard PM ops with pm_runtime_force_suspend() and
      pm_runtime_force_resume().
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      f02a0398
  4. 09 3月, 2020 2 次提交
  5. 07 11月, 2019 1 次提交
  6. 19 6月, 2019 1 次提交
  7. 12 6月, 2019 21 次提交
  8. 11 4月, 2019 2 次提交
    • R
      gpio: gpio-omap: Remove conditional pm_runtime handling for GPIO interrupts · 044e499a
      Russell King 提交于
      Commit b764a586 ("gpio: omap: Remove custom PM calls and use cpu_pm
      instead") moved interrupt using GPIO banks to idle with cpu_pm in order
      to drop the use of pm_runtime_irq_safe() in a later patch. The GPIO
      banks with no interrupts claimed are still being idled based on PM
      runtime calls. However this caused a regression for am437x suspend for
      rtc+ddr idle mode where the device cannot enter idle state as reported
      by Keerthy <j-keerthy@ti.com>.
      
      To fix the issue, we must not fail the pm_runtime callbacks. For GPIO
      interrupts, we already have irq_chip_pm_get increment the PM runtime
      use count as pointed out by Grygorii Strashko <grygorii.strashko@ti.com>.
      
      So all we need to do is remove the conditional handling in the
      runtime_suspend and resume functions and let the CPU PM notifier idle
      the GPIO banks.
      
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Fixes: b764a586 ("gpio: omap: Remove custom PM calls and use cpu_pm instead")
      Reported-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      [tony@atomide.com: updated patch description, dropped runtime count changes]
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NKeerthy <j-keerthy@ti.com>
      Reviewed-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      044e499a
    • R
      gpio: gpio-omap: configure edge detection for level IRQs for idle wakeup · e6818d29
      Russell King 提交于
      The GPIO block can enter idle independently of the CPU power management
      calls via smart-idle.  When the GPIO block enters idle, level detection
      stops working due to clocks being shut off, and an alternative form of
      edge detection is used.  However, this needs the edge detection
      registers set to mark the appropriate edges.
      
      Arrange to configure the edge detection enables along with the level
      detection to ensure that any transition to active interrupt state that
      occurs while the block is idle is detected as a wake-up event.
      
      Since we enable the edge detection when configuring the IRQ, both
      omap2_gpio_enable_level_quirk() nor omap2_gpio_disable_level_quirk()
      become redundant, which also means OMAP_GPIO_QUIRK_IDLE_REMOVE_TRIGGER
      can be removed. This can be now done without regressions as patch
      "gpio: gpio-omap: fix level interrupt idling" allows level interrupts
      to idle on omap4 without a workaround.
      
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      [tony@atomide.com: update description for the fix dependency]
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      e6818d29
  9. 05 4月, 2019 2 次提交
  10. 27 3月, 2019 3 次提交
    • T
      gpio: gpio-omap: add check for off wake capable gpios · da38ef3e
      Tony Lindgren 提交于
      We are currently assuming all GPIOs are non-wakeup capable GPIOs as we
      not configuring the bank->non_wakeup_gpios like we used to earlier with
      platform_data.
      
      Let's add omap_gpio_is_off_wakeup_capable() to make the handling clearer
      while considering that later patches may want to configure SoC specific
      bank->non_wakeup_gpios for the GPIOs in wakeup domain.
      
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Tero Kristo <t-kristo@ti.com>
      Reported-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      da38ef3e
    • T
      gpio: gpio-omap: always scan for triggered non-wakeup capable interrupts · 06dce84e
      Tony Lindgren 提交于
      The bank->workaround_enabled should be for omap24xx erratum 1.101 but is not
      needed any longer as erratum 1.101 handling only needs to happen based on
      !bank->loses_context with patch "gpio: omap: Limit errata 1.101 handling to
      wkup domain gpios only".
      
      Further Grygorii Strashko <grygorii.strashko@ti.com> points out that we are
      now tagging all edge GPIOs as non-wakeup GPIOs and rely on original erratum
      1.101 handling for scacnning for edge interrupts that have triggered during
      idle.
      
      Also the TI Android kernel tree has an earlier commit "GPIO: OMAP: Always
      scan gpios during runtime resume" by Tero Kristo <t-kristo@ti.com> saying:
      
       "This allows the driver to generate interrupts for GPIOs that can't
        wakeup but have changed state during runtime suspend. We cannot
        depend on the decision based on no need to restore, as the system
        state might change and pending events could gather up."
      
      So let's remove bank->workaround_enabled and always scan for triggered edge
      interrupts on resume. We do that based on bank->enabled_non_wakeup_gpios.
      
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Tero Kristo <t-kristo@ti.com>
      Reported-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      06dce84e
    • T
      gpio: gpio-omap: limit errata 1.101 handling to wkup domain gpios only · 21e2118f
      Tony Lindgren 提交于
      We need to only apply errata 1.101 handling to clear non-wakeup edge gpios
      for idle to the gpio bank(s) in the wkup domain to prevent spurious wake-up
      events.
      
      And we must restore what we did after idle manually as the gpio bank in
      wkup domain is not restored otherwise.
      
      Let's keep bank->saved_datain register reading separate, that's not related
      to the 1.101 errata and is used separately on restore.
      
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Tero Kristo <t-kristo@ti.com>
      Reported-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NBartosz Golaszewski <bgolaszewski@baylibre.com>
      21e2118f
  11. 08 3月, 2019 1 次提交
    • R
      gpio: gpio-omap: fix level interrupt idling · d01849f7
      Russell King 提交于
      Tony notes that the GPIO module does not idle when level interrupts are
      in use, as the wakeup appears to get stuck.
      
      After extensive investigation, it appears that the wakeup will only be
      cleared if the interrupt status register is cleared while the interrupt
      is enabled. However, we are currently clearing it with the interrupt
      disabled for level-based interrupts.
      
      It is acknowledged that this observed behaviour conflicts with a
      statement in the TRM:
      
      CAUTION
        After servicing the interrupt, the status bit in the interrupt status
        register (GPIOi.GPIO_IRQSTATUS_0 or GPIOi.GPIO_IRQSTATUS_1) must be
        reset and the interrupt line released (by setting the corresponding
        bit of the interrupt status register to 1) before enabling an
        interrupt for the GPIO channel in the interrupt-enable register
        (GPIOi.GPIO_IRQSTATUS_SET_0 or GPIOi.GPIO_IRQSTATUS_SET_1) to prevent
        the occurrence of unexpected interrupts when enabling an interrupt
        for the GPIO channel.
      
      However, this does not appear to be a practical problem.
      
      Further, as reported by Grygorii Strashko <grygorii.strashko@ti.com>,
      the TI Android kernel tree has an earlier similar patch as "GPIO: OMAP:
      Fix the sequence to clear the IRQ status" saying:
      
       if the status is cleared after disabling the IRQ then sWAKEUP will not
       be cleared and gates the module transition
      
      When we unmask the level interrupt after the interrupt has been handled,
      enable the interrupt and only then clear the interrupt. If the interrupt
      is still pending, the hardware will re-assert the interrupt status.
      
      Should the caution note in the TRM prove to be a problem, we could
      use a clear-enable-clear sequence instead.
      
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      [tony@atomide.com: updated comments based on an earlier TI patch]
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Acked-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      d01849f7
  12. 21 12月, 2018 1 次提交
    • T
      gpio: gpio-omap: Revert deferred wakeup quirk handling for regressions · 00ded24c
      Tony Lindgren 提交于
      Commit ec0daae6 ("gpio: omap: Add level wakeup handling for omap4
      based SoCs") attempted to fix omap4 GPIO wakeup handling as it was
      blocking deeper SoC idle states. However this caused a regression for
      GPIOs during runtime having over second long latencies for Ethernet
      GPIO interrupt as reportedy by Russell King <rmk+kernel@armlinux.org.uk>.
      
      Let's fix this issue by doing a partial revert of the breaking commit.
      We still want to keep the quirk handling around as it is also used for
      OMAP_GPIO_QUIRK_IDLE_REMOVE_TRIGGER.
      
      The real fix for omap4 GPIO wakeup handling involves fixes for
      omap_set_gpio_trigger() and omap_gpio_unmask_irq() and will be posted
      separately. And we must keep the wakeup bit enabled during runtime
      because of module doing clock autogating with autoidle configured.
      Reported-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Fixes: ec0daae6 ("gpio: omap: Add level wakeup handling for omap4
      based SoCs")
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Ladislav Michl <ladis@linux-mips.org>
      Cc: Russell King <rmk+kernel@armlinux.org.uk>
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      00ded24c
  13. 05 11月, 2018 1 次提交
  14. 01 10月, 2018 2 次提交