[PATCHPATCH 3/3] pmdomain: renesas: rmobile-sysc: Remove serial console handling

From: Geert Uytterhoeven
Date: Mon May 27 2024 - 08:47:46 EST


Since commit a47cf07f60dcb02d ("serial: core: Call
device_set_awake_path() for console port"), the serial driver properly
handles the case where the serial console is part of the awake path, so
the special serial console handling can be removed from the R-Mobile
SYSC PM Domain driver.

The PM Domain containing the serial port can now be powered down when
none of its devices are in use. Before, it was only powered down during
s2ram without no_console_suspend.

Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
---
drivers/pmdomain/renesas/rmobile-sysc.c | 33 +------------------------
1 file changed, 1 insertion(+), 32 deletions(-)

diff --git a/drivers/pmdomain/renesas/rmobile-sysc.c b/drivers/pmdomain/renesas/rmobile-sysc.c
index 0b77f37787d58f48..cc1f6f8b7a746850 100644
--- a/drivers/pmdomain/renesas/rmobile-sysc.c
+++ b/drivers/pmdomain/renesas/rmobile-sysc.c
@@ -10,7 +10,6 @@
* Copyright (C) 2011 Magnus Damm
*/
#include <linux/clk/renesas.h>
-#include <linux/console.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/iopoll.h>
@@ -31,8 +30,6 @@

struct rmobile_pm_domain {
struct generic_pm_domain genpd;
- struct dev_power_governor *gov;
- int (*suspend)(void);
void __iomem *base;
unsigned int bit_shift;
};
@@ -49,13 +46,6 @@ static int rmobile_pd_power_down(struct generic_pm_domain *genpd)
unsigned int mask = BIT(rmobile_pd->bit_shift);
u32 val;

- if (rmobile_pd->suspend) {
- int ret = rmobile_pd->suspend();
-
- if (ret)
- return ret;
- }
-
if (readl(rmobile_pd->base + PSTR) & mask) {
writel(mask, rmobile_pd->base + SPDCR);

@@ -98,7 +88,6 @@ static int rmobile_pd_power_up(struct generic_pm_domain *genpd)
static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
{
struct generic_pm_domain *genpd = &rmobile_pd->genpd;
- struct dev_power_governor *gov = rmobile_pd->gov;

genpd->flags |= GENPD_FLAG_PM_CLK | GENPD_FLAG_ACTIVE_WAKEUP;
genpd->attach_dev = cpg_mstp_attach_dev;
@@ -110,22 +99,12 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
__rmobile_pd_power_up(rmobile_pd);
}

- pm_genpd_init(genpd, gov ? : &simple_qos_governor, false);
-}
-
-static int rmobile_pd_suspend_console(void)
-{
- /*
- * Serial consoles make use of SCIF hardware located in this domain,
- * hence keep the power domain on if "no_console_suspend" is set.
- */
- return console_suspend_enabled ? 0 : -EBUSY;
+ pm_genpd_init(genpd, &simple_qos_governor, false);
}

enum pd_types {
PD_NORMAL,
PD_CPU,
- PD_CONSOLE,
PD_DEBUG,
PD_MEMCTL,
};
@@ -184,10 +163,6 @@ static void __init get_special_pds(void)
for_each_of_cpu_node(np)
add_special_pd(np, PD_CPU);

- /* PM domain containing console */
- if (of_stdout)
- add_special_pd(of_stdout, PD_CONSOLE);
-
/* PM domains containing other special devices */
for_each_matching_node_and_match(np, special_ids, &id)
add_special_pd(np, (uintptr_t)id->data);
@@ -227,12 +202,6 @@ static void __init rmobile_setup_pm_domain(struct device_node *np,
pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON;
break;

- case PD_CONSOLE:
- pr_debug("PM domain %s contains serial console\n", name);
- pd->gov = &pm_domain_always_on_gov;
- pd->suspend = rmobile_pd_suspend_console;
- break;
-
case PD_DEBUG:
/*
* This domain contains the Coresight-ETM hardware block and
--
2.34.1