1. 12 6月, 2019 19 次提交
  2. 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
  3. 05 4月, 2019 2 次提交
  4. 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
  5. 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
  6. 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
  7. 05 11月, 2018 1 次提交
  8. 01 10月, 2018 3 次提交
  9. 24 9月, 2018 3 次提交
    • T
      gpio: omap: Get rid of pm_runtime_irq_safe() · 5284521a
      Tony Lindgren 提交于
      If a gpio instance has any GPIO bits requested we do a pm_runtime_get()
      on the device. Now with cpu_pm handling the deeper SoC idle state quirks,
      let's just remove pm_runtime_irq_safe() call and add a warning in case we
      ever happen to encounter it.
      
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Ladislav Michl <ladis@linux-mips.org>
      Cc: Tero Kristo <t-kristo@ti.com>
      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>
      5284521a
    • T
      gpio: omap: Remove custom PM calls and use cpu_pm instead · b764a586
      Tony Lindgren 提交于
      For a long time the gpio-omap custom PM calls have been annoying me so
      let's replace them with cpu_pm instead. This will enable GPIO PM for
      deeper idle states on omap4. And we can handle GPIO PM for omap2/3/4
      in the same way.
      
      Note that with this patch we are also slightly changing GPIO PM to be
      less aggressive for omap3 and only will idle GPIO when PER context
      may be lost.
      
      For omap2, we don't need to save context and don't want to remove any
      triggering so let's add a quirk flag for that.
      
      Let's do this all in a single patch to avoid a situation where old
      custom calls still are used with new code.
      
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Ladislav Michl <ladis@linux-mips.org>
      Cc: Tero Kristo <t-kristo@ti.com>
      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>
      b764a586
    • T
      gpio: omap: Add level wakeup handling for omap4 based SoCs · ec0daae6
      Tony Lindgren 提交于
      I noticed that unlike omap2 and 3 based SoCs, omap4 based SoCs keep
      the GPIO clocks enabled for GPIO level interrupts with wakeup enabled.
      This blocks deeper idle states as the whole domain will stay busy.
      
      The GPIO functional clock seems to stay enabled if the wakeup register
      is enabled and a level interrupt is triggered. In that case the only
      way to have the GPIO module idle is to reset it. It is possible this
      has gone unnoticed with OSWR (Open SWitch Retention) and off mode
      during idle resetting GPIO context most GPIO instances in the earlier
      Android trees for example.
      
      Looks like the way to deal with this is to have omap4 based SoCs
      only set wake for the duration of idle for level interrupts, and clear
      level registers for the idle. With level interrupts we can do this as
      the level interrupt from device will be still there on resume.
      
      I've taken the long path to fixing this to avoid yet more hard to
      read code. I've set up a quirks flag, and a struct for function
      pointers so we can use these to clean up other quirk handling easier
      in the later patches. The current level quirk handling is moved to
      the new functions.
      
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Ladislav Michl <ladis@linux-mips.org>
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Acked-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Tested-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ec0daae6
  10. 07 8月, 2018 1 次提交
  11. 24 5月, 2018 1 次提交
  12. 22 2月, 2018 2 次提交
  13. 03 1月, 2018 1 次提交
    • L
      gpio: omap: Give unique labels to each GPIO bank/chip · 088413bc
      Linus Walleij 提交于
      As we need to add GPIO lookup tables to the OMAP platforms, we
      need to reference each GPIO chip with a unique label. Use the GPIO
      base to name each chip, "gpio-0-31", "gpio-32-63" etc.
      
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Santosh Shilimkar <ssantosh@kernel.org>
      Cc: Kevin Hilman <khilman@kernel.org>
      Cc: linux-omap@vger.kernel.org
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      088413bc