mbox series

[v3,0/3] renesas: irqchip: Use wakeup_path i.s.o. explicit clock handling

Message ID 1518443713-1835-1-git-send-email-geert+renesas@glider.be
Headers show
Series renesas: irqchip: Use wakeup_path i.s.o. explicit clock handling | expand

Message

Geert Uytterhoeven Feb. 12, 2018, 1:55 p.m. UTC
Hi all,

If an interrupt controller in a Renesas ARM SoC is part of a Clock
Domain, and it is part of the wakeup path, it must be kept active during
system suspend.

Currently this is handled in all interrupt controller drivers by
explicitly increasing the use count of the module clock when the device
is part of the wakeup path.  However, this explicit clock handling is
merely a workaround for a failure to properly communicate wakeup
information to the device core.

Hence this series fixes the affected drivers by setting the devices'
power.wakeup_path fields instead, to indicate they are part of the
wakeup path.  Depending on the PM Domain's active_wakeup configuration,
the genpd core code will keep the device enabled (and the clock running)
during system suspend when needed.

Target trees:
  - Patches 1 and 2 are meant for the irqchip tree,
  - Patch 3 is meant for the GPIO tree.

Changes compared to v2 (sent by Ulf Hanson):
  - Revert to v1, as WAKEUP_PATH didn't make it,
  - Use an atomic_t instead of a boolean flag, as the boolean tracked
    only the status of the last configured GPIO, while multiple interrupt
    sources on the same irqchip may be involved with wake-up,
  - Use new helper device_set_wakeup_path(),
  - Drop checks for CONFIG_PM_SLEEP, as device_set_wakeup_path() is
    always available, unlike dev_pm_info.wakeup_path,
  - Mark suspend functions __maybe_unused.

Changes compared to v1:
  - Convert to use the WAKEUP_PATH driver PM flag (Ulf Hanson).

This has been tested on r8a73a4/ape6evm, r8a7740/armadillo,
r8a7791/koelsch, r8a7795/salvator-x and -xs, r8a7796/salvator-x, and
sh73a0/kzm9g.

Thanks for applying!

Geert Uytterhoeven (3):
  irqchip/renesas-intc-irqpin: Use wakeup_path i.s.o. explicit clock
    handling
  irqchip/renesas-irqc: Use wakeup_path i.s.o. explicit clock handling
  gpio: rcar: Use wakeup_path i.s.o. explicit clock handling

 drivers/gpio/gpio-rcar.c                  | 38 +++++++++++++----------------
 drivers/irqchip/irq-renesas-intc-irqpin.c | 40 +++++++++++++------------------
 drivers/irqchip/irq-renesas-irqc.c        | 30 ++++++++++++-----------
 3 files changed, 48 insertions(+), 60 deletions(-)

Comments

Ulf Hansson Feb. 12, 2018, 2:40 p.m. UTC | #1
On 12 February 2018 at 14:55, Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
>         Hi all,
>
> If an interrupt controller in a Renesas ARM SoC is part of a Clock
> Domain, and it is part of the wakeup path, it must be kept active during
> system suspend.
>
> Currently this is handled in all interrupt controller drivers by
> explicitly increasing the use count of the module clock when the device
> is part of the wakeup path.  However, this explicit clock handling is
> merely a workaround for a failure to properly communicate wakeup
> information to the device core.
>
> Hence this series fixes the affected drivers by setting the devices'
> power.wakeup_path fields instead, to indicate they are part of the
> wakeup path.  Depending on the PM Domain's active_wakeup configuration,
> the genpd core code will keep the device enabled (and the clock running)
> during system suspend when needed.
>
> Target trees:
>   - Patches 1 and 2 are meant for the irqchip tree,
>   - Patch 3 is meant for the GPIO tree.
>
> Changes compared to v2 (sent by Ulf Hanson):
>   - Revert to v1, as WAKEUP_PATH didn't make it,
>   - Use an atomic_t instead of a boolean flag, as the boolean tracked
>     only the status of the last configured GPIO, while multiple interrupt
>     sources on the same irqchip may be involved with wake-up,
>   - Use new helper device_set_wakeup_path(),
>   - Drop checks for CONFIG_PM_SLEEP, as device_set_wakeup_path() is
>     always available, unlike dev_pm_info.wakeup_path,
>   - Mark suspend functions __maybe_unused.
>
> Changes compared to v1:
>   - Convert to use the WAKEUP_PATH driver PM flag (Ulf Hanson).
>
> This has been tested on r8a73a4/ape6evm, r8a7740/armadillo,
> r8a7791/koelsch, r8a7795/salvator-x and -xs, r8a7796/salvator-x, and
> sh73a0/kzm9g.
>
> Thanks for applying!
>
> Geert Uytterhoeven (3):
>   irqchip/renesas-intc-irqpin: Use wakeup_path i.s.o. explicit clock
>     handling
>   irqchip/renesas-irqc: Use wakeup_path i.s.o. explicit clock handling
>   gpio: rcar: Use wakeup_path i.s.o. explicit clock handling
>
>  drivers/gpio/gpio-rcar.c                  | 38 +++++++++++++----------------
>  drivers/irqchip/irq-renesas-intc-irqpin.c | 40 +++++++++++++------------------
>  drivers/irqchip/irq-renesas-irqc.c        | 30 ++++++++++++-----------
>  3 files changed, 48 insertions(+), 60 deletions(-)
>

For the series:

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Marc Zyngier March 1, 2018, 4:12 p.m. UTC | #2
On 12/02/18 13:55, Geert Uytterhoeven wrote:
> 	Hi all,
> 
> If an interrupt controller in a Renesas ARM SoC is part of a Clock
> Domain, and it is part of the wakeup path, it must be kept active during
> system suspend.
> 
> Currently this is handled in all interrupt controller drivers by
> explicitly increasing the use count of the module clock when the device
> is part of the wakeup path.  However, this explicit clock handling is
> merely a workaround for a failure to properly communicate wakeup
> information to the device core.
> 
> Hence this series fixes the affected drivers by setting the devices'
> power.wakeup_path fields instead, to indicate they are part of the
> wakeup path.  Depending on the PM Domain's active_wakeup configuration,
> the genpd core code will keep the device enabled (and the clock running)
> during system suspend when needed.
> 
> Target trees:
>   - Patches 1 and 2 are meant for the irqchip tree,
Patches queued for 4.17.

Thanks,

	M.