mbox series

[v3,0/3] clk: renesas: cpg-mssr: add never-disable option

Message ID 1589214838-18075-1-git-send-email-uli+renesas@fpond.eu (mailing list archive)
Headers show
Series clk: renesas: cpg-mssr: add never-disable option | expand

Message

Ulrich Hecht May 11, 2020, 4:33 p.m. UTC
Hi!

This revision should work more reliably as it keeps the never-disable
handling in the clock driver instead of relying on the semantics of
CLK_IGNORE_UNUSED, which still allows clocks to be turned off for power
management.

This series adds the option for declaring clocks as "never-disable", i.e. 
clocks that will not be turned on if not used, but also not turned off if
unused. It also enables this option for the RWDT clocks in (almost) all
SoCs.

The point of this is to allow a WDT that has been enabled by the bootloader
to survive these events:

- deferred probing of the WDT device, which can lead the clock driver
  to disable the WDT clock until the WDT is re-probed, giving it a
  blind spot
- probe failure in the WDT driver

There are a number of Gen2 and RZ/G1 SoCs that have the RWDT clock declared
as critical in order to allow SMP bringup code to work. These have been
left as they are.

CU
Uli


Changes since v2:
- use the term "never-disable" instead of "ignore-unused"
- do the handling internally instead of relying on the behavior of
  CLK_IGNORE_UNUSED

Changes since v1:
- rename data structures for clarity
- squash SoC-specific patches into one per family


Ulrich Hecht (3):
  clk: renesas: cpg-mssr: add support for never-disable clocks
  clk: renesas: rcar-gen3: mark RWDT clocks as never-disable
  clk: renesas: rzg2: mark RWDT clock as never-disable

 drivers/clk/renesas/r8a774a1-cpg-mssr.c |  5 +++++
 drivers/clk/renesas/r8a774b1-cpg-mssr.c |  5 +++++
 drivers/clk/renesas/r8a774c0-cpg-mssr.c |  5 +++++
 drivers/clk/renesas/r8a7795-cpg-mssr.c  |  6 +++++-
 drivers/clk/renesas/r8a7796-cpg-mssr.c  |  6 +++++-
 drivers/clk/renesas/r8a77965-cpg-mssr.c |  5 +++++
 drivers/clk/renesas/r8a77970-cpg-mssr.c |  6 +++++-
 drivers/clk/renesas/r8a77980-cpg-mssr.c |  6 +++++-
 drivers/clk/renesas/r8a77990-cpg-mssr.c |  5 +++++
 drivers/clk/renesas/r8a77995-cpg-mssr.c |  6 +++++-
 drivers/clk/renesas/renesas-cpg-mssr.c  | 10 ++++++++++
 drivers/clk/renesas/renesas-cpg-mssr.h  |  9 +++++++++
 12 files changed, 69 insertions(+), 5 deletions(-)

Comments

Geert Uytterhoeven May 11, 2020, 5:50 p.m. UTC | #1
CC clk

Complete series at
http://lore.kernel.org/r/1589214838-18075-1-git-send-email-uli+renesas@fpond.eu

On Mon, May 11, 2020 at 6:34 PM Ulrich Hecht <uli+renesas@fpond.eu> wrote:
> This revision should work more reliably as it keeps the never-disable
> handling in the clock driver instead of relying on the semantics of
> CLK_IGNORE_UNUSED, which still allows clocks to be turned off for power
> management.
>
> This series adds the option for declaring clocks as "never-disable", i.e.
> clocks that will not be turned on if not used, but also not turned off if
> unused. It also enables this option for the RWDT clocks in (almost) all
> SoCs.
>
> The point of this is to allow a WDT that has been enabled by the bootloader
> to survive these events:
>
> - deferred probing of the WDT device, which can lead the clock driver
>   to disable the WDT clock until the WDT is re-probed, giving it a
>   blind spot
> - probe failure in the WDT driver
>
> There are a number of Gen2 and RZ/G1 SoCs that have the RWDT clock declared
> as critical in order to allow SMP bringup code to work. These have been
> left as they are.
>
> CU
> Uli
>
>
> Changes since v2:
> - use the term "never-disable" instead of "ignore-unused"
> - do the handling internally instead of relying on the behavior of
>   CLK_IGNORE_UNUSED
>
> Changes since v1:
> - rename data structures for clarity
> - squash SoC-specific patches into one per family
>
>
> Ulrich Hecht (3):
>   clk: renesas: cpg-mssr: add support for never-disable clocks
>   clk: renesas: rcar-gen3: mark RWDT clocks as never-disable
>   clk: renesas: rzg2: mark RWDT clock as never-disable
>
>  drivers/clk/renesas/r8a774a1-cpg-mssr.c |  5 +++++
>  drivers/clk/renesas/r8a774b1-cpg-mssr.c |  5 +++++
>  drivers/clk/renesas/r8a774c0-cpg-mssr.c |  5 +++++
>  drivers/clk/renesas/r8a7795-cpg-mssr.c  |  6 +++++-
>  drivers/clk/renesas/r8a7796-cpg-mssr.c  |  6 +++++-
>  drivers/clk/renesas/r8a77965-cpg-mssr.c |  5 +++++
>  drivers/clk/renesas/r8a77970-cpg-mssr.c |  6 +++++-
>  drivers/clk/renesas/r8a77980-cpg-mssr.c |  6 +++++-
>  drivers/clk/renesas/r8a77990-cpg-mssr.c |  5 +++++
>  drivers/clk/renesas/r8a77995-cpg-mssr.c |  6 +++++-
>  drivers/clk/renesas/renesas-cpg-mssr.c  | 10 ++++++++++
>  drivers/clk/renesas/renesas-cpg-mssr.h  |  9 +++++++++
>  12 files changed, 69 insertions(+), 5 deletions(-)