Skip to contentSkip to conversation

arm: mach-omap2: clkdm/pwrdm: Save/restore context

PATCH New Keerthy 3 participants 13 messages May 16, 2018 – May 18, 2018

Subsystems (5)
lore
Share & tools
lore

Keerthy

author
#0 lore raw

cover arm: mach-omap2: clkdm/pwrdm: Save/restore context

The series adds a save/restore functions for clockdomain and powerdomain. The context is lost only with AM43XX SoCs only in the rtc only mode with ddr in self-refresh.

The other OMAP family do not use the contexts as the PRCM is in WKUP Domain.

Keerthy (2):
omap2: clockdomain: Inroduce cpu_pm notifiers for context save/restore
omap2: powerdomain: Inroduce cpu_pm notifiers for context
save/restore

Russ Dill (2):
ARM: OMAP2: Add functions to save and restore clockdomain context
en-masse.
ARM: OMAP2: Add functions to save and restore powerdomain context

 arch/arm/mach-omap2/clockdomain.c | 73 ++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/clockdomain.h |  8 ++++
 arch/arm/mach-omap2/cm33xx.c      | 53 ++++++++++++++++++++++++
 arch/arm/mach-omap2/cminst44xx.c  | 43 +++++++++++++++++++
 arch/arm/mach-omap2/powerdomain.c | 87 +++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/powerdomain.h |  7 ++++
 arch/arm/mach-omap2/prm33xx.c     | 31 ++++++++++++++
 arch/arm/mach-omap2/prm44xx.c     | 50 ++++++++++++++++++++++
 8 files changed, 352 insertions(+)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/4 ARM: OMAP2: Add functions to save and restore clockdomain context en-masse.

From: Russ Dill <[email protected]>

This is used to support suspend modes like RTC-only and hibernate where the state of the registers controlling clockdomains is lost.

---
 arch/arm/mach-omap2/clockdomain.c | 46 +++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/clockdomain.h |  8 ++++++
 arch/arm/mach-omap2/cm33xx.c      | 53 +++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/cminst44xx.c  | 43 +++++++++++++++++++++++++++++++
 4 files changed, 150 insertions(+)
arch/arm/mach-omap2/clockdomain.c +46 -0
index b79b1ca..0906380 100644
@@ -1307,3 +1307,49 @@ int clkdm_hwmod_disable(struct clockdomain *clkdm, struct omap_hwmod *oh)
 	return 0;
 }
 
+/**
+ * _clkdm_save_context - save the context for the control of this clkdm
+ *
+ * Due to a suspend or hibernation operation, the state of the registers
+ * controlling this clkdm will be lost, save their context.
+ */
+static int _clkdm_save_context(struct clockdomain *clkdm, void *ununsed)
+{
+	if (!arch_clkdm || !arch_clkdm->clkdm_save_context)
+		return -EINVAL;
+
+	return arch_clkdm->clkdm_save_context(clkdm);
+}
+
+/**
+ * _clkdm_restore_context - restore context for control of this clkdm
+ *
+ * Restore the register values for this clockdomain.
+ */
+static int _clkdm_restore_context(struct clockdomain *clkdm, void *ununsed)
+{
+	if (!arch_clkdm || !arch_clkdm->clkdm_restore_context)
+		return -EINVAL;
+
+	return arch_clkdm->clkdm_restore_context(clkdm);
+}
+
+/**
+ * clkdm_save_context - Saves the context for each registered clkdm
+ *
+ * Save the context for each registered clockdomain.
+ */
+void clkdm_save_context(void)
+{
+	clkdm_for_each(_clkdm_save_context, NULL);
+}
+
+/**
+ * clkdm_restore_context - Restores the context for each registered clkdm
+ *
+ * Restore the context for each registered clockdomain.
+ */
+void clkdm_restore_context(void)
+{
+	clkdm_for_each(_clkdm_restore_context, NULL);
+}
arch/arm/mach-omap2/clockdomain.h +8 -0
index 24667a5..c7d0953 100644
@@ -141,6 +141,7 @@ struct clockdomain {
 	int usecount;
 	int forcewake_count;
 	struct list_head node;
+	u32 context;
 };
 
 /**
@@ -159,6 +160,8 @@ struct clockdomain {
  * @clkdm_deny_idle: Disable hw supervised idle transitions for clock domain
  * @clkdm_clk_enable: Put the clkdm in right state for a clock enable
  * @clkdm_clk_disable: Put the clkdm in right state for a clock disable
+ * @clkdm_save_context: Save the current clkdm context
+ * @clkdm_restore_context: Restore the clkdm context
  */
 struct clkdm_ops {
 	int	(*clkdm_add_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
@@ -175,6 +178,8 @@ struct clkdm_ops {
 	void	(*clkdm_deny_idle)(struct clockdomain *clkdm);
 	int	(*clkdm_clk_enable)(struct clockdomain *clkdm);
 	int	(*clkdm_clk_disable)(struct clockdomain *clkdm);
+	int	(*clkdm_save_context)(struct clockdomain *clkdm);
+	int	(*clkdm_restore_context)(struct clockdomain *clkdm);
 };
 
 int clkdm_register_platform_funcs(struct clkdm_ops *co);
@@ -214,6 +219,9 @@ int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user),
 int clkdm_hwmod_enable(struct clockdomain *clkdm, struct omap_hwmod *oh);
 int clkdm_hwmod_disable(struct clockdomain *clkdm, struct omap_hwmod *oh);
 
+void clkdm_save_context(void);
+void clkdm_restore_context(void);
+
 extern void __init omap242x_clockdomains_init(void);
 extern void __init omap243x_clockdomains_init(void);
 extern void __init omap3xxx_clockdomains_init(void);
arch/arm/mach-omap2/cm33xx.c +53 -0

71 lines not on this page · raw message

arch/arm/mach-omap2/cminst44xx.c +43 -0

55 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#2 lore raw

PATCH 2/4 omap2: clockdomain: Inroduce cpu_pm notifiers for context save/restore

In reply to Keerthy

Inroduce cpu_pm notifiers for context save/restore. This will be needed for am43xx family in case of rtc only mode with ddr in self-refresh.

---
 arch/arm/mach-omap2/clockdomain.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
arch/arm/mach-omap2/clockdomain.c +27 -0
index 0906380..6d44fe0 100644
@@ -23,6 +23,7 @@
 #include <linux/limits.h>
 #include <linux/err.h>
 #include <linux/clk-provider.h>
+#include <linux/cpu_pm.h>
 
 #include <linux/io.h>
 
@@ -31,6 +32,7 @@
 #include "soc.h"
 #include "clock.h"
 #include "clockdomain.h"
+#include "pm.h"
 
 /* clkdm_list contains all registered struct clockdomains */
 static LIST_HEAD(clkdm_list);
@@ -39,6 +41,8 @@
 static struct clkdm_autodep *autodeps;
 
 static struct clkdm_ops *arch_clkdm;
+void clkdm_save_context(void);
+void clkdm_restore_context(void);
 
 /* Private functions */
 
@@ -449,6 +453,22 @@ int clkdm_register_autodeps(struct clkdm_autodep *ia)
 	return 0;
 }
 
+static int cpu_notifier(struct notifier_block *nb, unsigned long cmd, void *v)
+{
+	switch (cmd) {
+	case CPU_CLUSTER_PM_ENTER:
+		if (enable_off_mode)
+			clkdm_save_context();
+		break;
+	case CPU_CLUSTER_PM_EXIT:
+		if (enable_off_mode)
+			clkdm_restore_context();
+		break;
+	}
+
+	return NOTIFY_OK;
+}
+
 /**
  * clkdm_complete_init - set up the clockdomain layer
  *
@@ -460,6 +480,7 @@ int clkdm_register_autodeps(struct clkdm_autodep *ia)
 int clkdm_complete_init(void)
 {
 	struct clockdomain *clkdm;
+	static struct notifier_block nb;
 
 	if (list_empty(&clkdm_list))
 		return -EACCES;
@@ -474,6 +495,12 @@ int clkdm_complete_init(void)
 		clkdm_clear_all_sleepdeps(clkdm);
 	}
 
+	/* Only AM43XX can lose clkdm context during rtc-ddr suspend */
+	if (soc_is_am43xx()) {
+		nb.notifier_call = cpu_notifier;
+		cpu_pm_register_notifier(&nb);
+	}
+
 	return 0;
 }
 
Signature · 1 line
1.9.1
maintainer
#3 lore raw

PATCH 2/4 omap2: clockdomain: Inroduce cpu_pm notifiers for context save/restore

Quoted 3 lines · Keerthy

Inroduce cpu_pm notifiers for context save/restore. This will be needed for am43xx family in case of rtc only mode with ddr in self-refresh.

...

Quoted 5 lines
arch/arm/mach-omap2/clockdomain.c +5 -0
+static int cpu_notifier(struct notifier_block *nb, unsigned long cmd, void *v)
+{
+	switch (cmd) {
+	case CPU_CLUSTER_PM_ENTER:
+		if (enable_off_mode)

arch/arm/mach-omap2/clockdomain.c int clkdm_register_autodeps(struct clkdm_autodep *ia) · line 470

Quoted 10 lines
arch/arm/mach-omap2/clockdomain.c +10 -0
+			clkdm_save_context();
+		break;
+	case CPU_CLUSTER_PM_EXIT:
+		if (enable_off_mode)
+			clkdm_restore_context();
+		break;
+	}
+
+	return NOTIFY_OK;
+}

Can you do this too only on suspend instead of the cpu notifier? If you need to call this eventually from cpuidle also then yeah the notifier makes sense.

Regards,

Tony

author
#4 lore raw

PATCH 2/4 omap2: clockdomain: Inroduce cpu_pm notifiers for context save/restore

Quoted 16 lines · Tony Lindgren
Quoted 3 lines · Keerthy

Inroduce cpu_pm notifiers for context save/restore. This will be needed for am43xx family in case of rtc only mode with ddr in self-refresh.

...

Quoted 11 lines
arch/arm/mach-omap2/clockdomain.c +11 -0
+static int cpu_notifier(struct notifier_block *nb, unsigned long cmd, void *v)
+{
+	switch (cmd) {
+	case CPU_CLUSTER_PM_ENTER:
+		if (enable_off_mode)
+			clkdm_save_context();
+		break;
+	case CPU_CLUSTER_PM_EXIT:
+		if (enable_off_mode)
+			clkdm_restore_context();
+		break;
Quoted 8 lines

arch/arm/mach-omap2/clockdomain.c int clkdm_register_autodeps(struct clkdm_autodep *ia) · line 470

Quoted 4 lines
arch/arm/mach-omap2/clockdomain.c +4 -0
+	}
+
+	return NOTIFY_OK;
+}

Can you do this too only on suspend instead of the cpu notifier? If you need to call this eventually from cpuidle also then yeah the notifier makes sense.

Clockdomain under omap2 does not have suspend/resume calls as its still not a driver. The initial version of this patch had save/restore calls directly from pm33xx-core during suspend/resume platform ops are called.

Are you suggesting that?

Quoted 5 lines

Regards,

Tony

#5 lore raw

PATCH 2/4 omap2: clockdomain: Inroduce cpu_pm notifiers for context save/restore

Quoted 28 lines · Keerthy
Quoted 16 lines · Tony Lindgren
Quoted 3 lines · Keerthy

Inroduce cpu_pm notifiers for context save/restore. This will be needed for am43xx family in case of rtc only mode with ddr in self-refresh.

...

Quoted 11 lines
arch/arm/mach-omap2/clockdomain.c +11 -0
+static int cpu_notifier(struct notifier_block *nb, unsigned long cmd, void *v)
+{
+	switch (cmd) {
+	case CPU_CLUSTER_PM_ENTER:
+		if (enable_off_mode)
+			clkdm_save_context();
+		break;
+	case CPU_CLUSTER_PM_EXIT:
+		if (enable_off_mode)
+			clkdm_restore_context();
+		break;
Quoted 8 lines

arch/arm/mach-omap2/clockdomain.c int clkdm_register_autodeps(struct clkdm_autodep *ia) · line 470

Quoted 4 lines
arch/arm/mach-omap2/clockdomain.c +4 -0
+	}
+
+	return NOTIFY_OK;
+}

Can you do this too only on suspend instead of the cpu notifier? If you need to call this eventually from cpuidle also then yeah the notifier makes sense.

Quoted 5 lines

Clockdomain under omap2 does not have suspend/resume calls as its still not a driver. The initial version of this patch had save/restore calls directly from pm33xx-core during suspend/resume platform ops are called.

Are you suggesting that?

I think using cpu notifiers would help in eventual transition of this under drivers also, as this doesn't need any custom interfaces to be exported around. And, as it seems now, this is only needed for AM43xx at the moment, no other SoCs need this for any purpose, even if device off would be implemented. Only exception would be if we want to implement RTC+DDR sort of functionality on any other SoC.

-Tero
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

maintainer
#6 lore raw

PATCH 2/4 omap2: clockdomain: Inroduce cpu_pm notifiers for context save/restore

Quoted 33 lines · Tero Kristo
Quoted 32 lines · Keerthy
Quoted 16 lines · Tony Lindgren
Quoted 3 lines · Keerthy

Inroduce cpu_pm notifiers for context save/restore. This will be needed for am43xx family in case of rtc only mode with ddr in self-refresh.

...

Quoted 11 lines
arch/arm/mach-omap2/clockdomain.c +11 -0
+static int cpu_notifier(struct notifier_block *nb, unsigned long cmd, void *v)
+{
+	switch (cmd) {
+	case CPU_CLUSTER_PM_ENTER:
+		if (enable_off_mode)
+			clkdm_save_context();
+		break;
+	case CPU_CLUSTER_PM_EXIT:
+		if (enable_off_mode)
+			clkdm_restore_context();
+		break;
Quoted 8 lines

arch/arm/mach-omap2/clockdomain.c int clkdm_register_autodeps(struct clkdm_autodep *ia) · line 470

Quoted 4 lines
arch/arm/mach-omap2/clockdomain.c +4 -0
+	}
+
+	return NOTIFY_OK;
+}

Can you do this too only on suspend instead of the cpu notifier? If you need to call this eventually from cpuidle also then yeah the notifier makes sense.

Clockdomain under omap2 does not have suspend/resume calls as its still not a driver. The initial version of this patch had save/restore calls directly from pm33xx-core during suspend/resume platform ops are called.

Quoted 8 lines
Quoted 1 line

Are you suggesting that?

I think using cpu notifiers would help in eventual transition of this under drivers also, as this doesn't need any custom interfaces to be exported around. And, as it seems now, this is only needed for AM43xx at the moment, no other SoCs need this for any purpose, even if device off would be implemented. Only exception would be if we want to implement RTC+DDR sort of functionality on any other SoC.

OK thanks makes sense. Applying all these into omap-for-v4.18/soc.

Regards,

Tony

author
#7 lore raw

PATCH 3/4 ARM: OMAP2: Add functions to save and restore powerdomain context

In reply to Keerthy

From: Russ Dill <[email protected]>

The powerdomain control registers are stored in the WKUP powerdomain on AM33XX/AM43XX, which is lost on RTC-only suspend and also hibernate. This adds context save and restore functions for those registers. Sometimes the powerdomain state does not need to change, perhaps we only need to change memory retention states, so make sure the restored state is different from the current state before we wait for a transition.

---
 arch/arm/mach-omap2/powerdomain.c | 60 +++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/powerdomain.h |  7 +++++
 arch/arm/mach-omap2/prm33xx.c     | 31 ++++++++++++++++++++
 arch/arm/mach-omap2/prm44xx.c     | 50 ++++++++++++++++++++++++++++++++
 4 files changed, 148 insertions(+)
arch/arm/mach-omap2/powerdomain.c +60 -0
index 1e6a967..b97b308 100644
@@ -1199,3 +1199,63 @@ bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm)
 
 	return 0;
 }
+
+/**
+ * pwrdm_save_context - save powerdomain registers
+ *
+ * Register state is going to be lost due to a suspend or hibernate
+ * event. Save the powerdomain registers.
+ */
+static int pwrdm_save_context(struct powerdomain *pwrdm, void *unused)
+{
+	if (arch_pwrdm && arch_pwrdm->pwrdm_save_context)
+		arch_pwrdm->pwrdm_save_context(pwrdm);
+	return 0;
+}
+
+/**
+ * pwrdm_save_context - restore powerdomain registers
+ *
+ * Restore powerdomain control registers after a suspend or resume
+ * event.
+ */
+static int pwrdm_restore_context(struct powerdomain *pwrdm, void *unused)
+{
+	if (arch_pwrdm && arch_pwrdm->pwrdm_restore_context)
+		arch_pwrdm->pwrdm_restore_context(pwrdm);
+	return 0;
+}
+
+static int pwrdm_lost_power(struct powerdomain *pwrdm, void *unused)
+{
+	int state;
+
+	/*
+	 * Power has been lost across all powerdomains, increment the
+	 * counter.
+	 */
+
+	state = pwrdm_read_pwrst(pwrdm);
+	if (state != PWRDM_POWER_OFF) {
+		pwrdm->state_counter[state]++;
+		pwrdm->state_counter[PWRDM_POWER_OFF]++;
+	}
+	pwrdm->state = state;
+
+	return 0;
+}
+
+void pwrdms_save_context(void)
+{
+	pwrdm_for_each(pwrdm_save_context, NULL);
+}
+
+void pwrdms_restore_context(void)
+{
+	pwrdm_for_each(pwrdm_restore_context, NULL);
+}
+
+void pwrdms_lost_power(void)
+{
+	pwrdm_for_each(pwrdm_lost_power, NULL);
+}
arch/arm/mach-omap2/powerdomain.h +7 -0
index 28a796c..9a907fb 100644
@@ -144,6 +144,7 @@ struct powerdomain {
 	s64 timer;
 	s64 state_timer[PWRDM_MAX_PWRSTS];
 #endif
+	u32 context;
 };
 
 /**
@@ -198,6 +199,8 @@ struct pwrdm_ops {
 	int	(*pwrdm_set_lowpwrstchange)(struct powerdomain *pwrdm);
 	int	(*pwrdm_wait_transition)(struct powerdomain *pwrdm);
 	int	(*pwrdm_has_voltdm)(void);
+	void	(*pwrdm_save_context)(struct powerdomain *pwrdm);
+	void	(*pwrdm_restore_context)(struct powerdomain *pwrdm);
 };
 
 int pwrdm_register_platform_funcs(struct pwrdm_ops *custom_funcs);
@@ -273,4 +276,8 @@ u8 pwrdm_get_valid_lp_state(struct powerdomain *pwrdm,
 extern void pwrdm_lock(struct powerdomain *pwrdm);
 extern void pwrdm_unlock(struct powerdomain *pwrdm);
 
+extern void pwrdms_save_context(void);
+extern void pwrdms_restore_context(void);
+
+extern void pwrdms_lost_power(void);
 #endif
arch/arm/mach-omap2/prm33xx.c +31 -0
index ebaf80d..d514166 100644
@@ -342,6 +342,35 @@ static void am33xx_prm_global_warm_sw_reset(void)
 				  AM33XX_PRM_RSTCTRL_OFFSET);
 }
 
+static void am33xx_pwrdm_save_context(struct powerdomain *pwrdm)
+{
+	pwrdm->context = am33xx_prm_read_reg(pwrdm->prcm_offs,
+						pwrdm->pwrstctrl_offs);
+	/*
+	 * Do not save LOWPOWERSTATECHANGE, writing a 1 indicates a request,
+	 * reading back a 1 indicates a request in progress.
+	 */
+	pwrdm->context &= ~AM33XX_LOWPOWERSTATECHANGE_MASK;
+}
+
+static void am33xx_pwrdm_restore_context(struct powerdomain *pwrdm)
+{
+	int st, ctrl;
+
+	st = am33xx_prm_read_reg(pwrdm->prcm_offs,
+				 pwrdm->pwrstst_offs);
+
+	am33xx_prm_write_reg(pwrdm->context, pwrdm->prcm_offs,
+			     pwrdm->pwrstctrl_offs);
+
+	/* Make sure we only wait for a transition if there is one */
+	st &= OMAP_POWERSTATEST_MASK;
+	ctrl = OMAP_POWERSTATEST_MASK & pwrdm->context;
+
+	if (st != ctrl)
+		am33xx_pwrdm_wait_transition(pwrdm);
+}
+
 struct pwrdm_ops am33xx_pwrdm_operations = {
 	.pwrdm_set_next_pwrst		= am33xx_pwrdm_set_next_pwrst,
 	.pwrdm_read_next_pwrst		= am33xx_pwrdm_read_next_pwrst,
@@ -357,6 +386,8 @@ struct pwrdm_ops am33xx_pwrdm_operations = {
 	.pwrdm_set_mem_retst		= am33xx_pwrdm_set_mem_retst,
 	.pwrdm_wait_transition		= am33xx_pwrdm_wait_transition,
 	.pwrdm_has_voltdm		= am33xx_check_vcvp,
+	.pwrdm_save_context		= am33xx_pwrdm_save_context,
+	.pwrdm_restore_context		= am33xx_pwrdm_restore_context,
 };
 
 static struct prm_ll_data am33xx_prm_ll_data = {
arch/arm/mach-omap2/prm44xx.c +50 -0

62 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#8 lore raw

PATCH 4/4 omap2: powerdomain: Inroduce cpu_pm notifiers for context save/restore

In reply to Keerthy

Inroduce cpu_pm notifiers for context save/restore. This is needed for am43xx family during rtc only mode with ddr in self-refresh.

---
 arch/arm/mach-omap2/powerdomain.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
arch/arm/mach-omap2/powerdomain.c +27 -0
index b97b308..1a0f69c 100644
@@ -14,6 +14,7 @@
  */
 #undef DEBUG
 
+#include <linux/cpu_pm.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/list.h>
@@ -39,6 +40,9 @@
 
 #define PWRDM_TRACE_STATES_FLAG	(1<<31)
 
+void pwrdms_save_context(void);
+void pwrdms_restore_context(void);
+
 enum {
 	PWRDM_STATE_NOW = 0,
 	PWRDM_STATE_PREV,
@@ -333,6 +337,22 @@ int pwrdm_register_pwrdms(struct powerdomain **ps)
 	return 0;
 }
 
+static int cpu_notifier(struct notifier_block *nb, unsigned long cmd, void *v)
+{
+	switch (cmd) {
+	case CPU_CLUSTER_PM_ENTER:
+		if (enable_off_mode)
+			pwrdms_save_context();
+		break;
+	case CPU_CLUSTER_PM_EXIT:
+		if (enable_off_mode)
+			pwrdms_restore_context();
+		break;
+	}
+
+	return NOTIFY_OK;
+}
+
 /**
  * pwrdm_complete_init - set up the powerdomain layer
  *
@@ -347,6 +367,7 @@ int pwrdm_register_pwrdms(struct powerdomain **ps)
 int pwrdm_complete_init(void)
 {
 	struct powerdomain *temp_p;
+	static struct notifier_block nb;
 
 	if (list_empty(&pwrdm_list))
 		return -EACCES;
@@ -354,6 +375,12 @@ int pwrdm_complete_init(void)
 	list_for_each_entry(temp_p, &pwrdm_list, node)
 		pwrdm_set_next_pwrst(temp_p, PWRDM_POWER_ON);
 
+	/* Only AM43XX can lose pwrdm context during rtc-ddr suspend */
+	if (soc_is_am43xx()) {
+		nb.notifier_call = cpu_notifier;
+		cpu_pm_register_notifier(&nb);
+	}
+
 	return 0;
 }
 
Signature · 1 line
1.9.1
maintainer
#9 lore raw

PATCH 4/4 omap2: powerdomain: Inroduce cpu_pm notifiers for context save/restore

arch/arm/mach-omap2/powerdomain.c int pwrdm_complete_init(void) · line 383

Quoted 6 lines · Keerthy
arch/arm/mach-omap2/powerdomain.c +6 -0
+	/* Only AM43XX can lose pwrdm context during rtc-ddr suspend */
+	if (soc_is_am43xx()) {
+		nb.notifier_call = cpu_notifier;
+		cpu_pm_register_notifier(&nb);
+	}
+

Hmm in patch 3/4 you add omap4_pwrdm_save_context(), I think that we'd want to run with the notifier for cpuidle on omap4?

Regards,

Tony

author
#10 lore raw

PATCH 4/4 omap2: powerdomain: Inroduce cpu_pm notifiers for context save/restore

Quoted 10 lines · Tony Lindgren

arch/arm/mach-omap2/powerdomain.c int pwrdm_complete_init(void) · line 383

Quoted 6 lines · Keerthy
arch/arm/mach-omap2/powerdomain.c +6 -0
+	/* Only AM43XX can lose pwrdm context during rtc-ddr suspend */
+	if (soc_is_am43xx()) {
+		nb.notifier_call = cpu_notifier;
+		cpu_pm_register_notifier(&nb);
+	}
+

Hmm in patch 3/4 you add omap4_pwrdm_save_context(), I think that we'd want to run with the notifier for cpuidle on omap4?

Okay i believe that is not needed for cpuidle on omap4. PRCM on wakeup domain so save/restore not needed for powerdomain on omap4.

Tero can confirm the same.

Should i rename omap4_pwrdm_save_context to am43xx_pwrdm_save_context to avoid confusion?

Regards,
Keerthy

Quoted 5 lines

Regards,

Tony

#11 lore raw

PATCH 4/4 omap2: powerdomain: Inroduce cpu_pm notifiers for context save/restore

Quoted 14 lines · Keerthy
Quoted 10 lines · Tony Lindgren

arch/arm/mach-omap2/powerdomain.c int pwrdm_complete_init(void) · line 383

Quoted 6 lines · Keerthy
arch/arm/mach-omap2/powerdomain.c +6 -0
+	/* Only AM43XX can lose pwrdm context during rtc-ddr suspend */
+	if (soc_is_am43xx()) {
+		nb.notifier_call = cpu_notifier;
+		cpu_pm_register_notifier(&nb);
+	}
+

Hmm in patch 3/4 you add omap4_pwrdm_save_context(), I think that we'd want to run with the notifier for cpuidle on omap4?

Quoted 4 lines

Okay i believe that is not needed for cpuidle on omap4. PRCM on wakeup domain so save/restore not needed for powerdomain on omap4.

Tero can confirm the same.

Yea I don't believe this is needed. Only certain portions of the OMAP4 PRCM lose context during device off mode (which is currently not supported by linux), and whatever portions do lose, they should use the SAR_RAM approach for context save/restore, as that is supported by HW/ROM code.

-Tero

Quoted 12 lines

Should i rename omap4_pwrdm_save_context to am43xx_pwrdm_save_context to avoid confusion?

Regards,
Keerthy

Quoted 5 lines

Regards,

Tony

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

maintainer
#12 lore raw

PATCH 4/4 omap2: powerdomain: Inroduce cpu_pm notifiers for context save/restore

Quoted 18 lines · Tero Kristo
Quoted 17 lines · Keerthy
Quoted 10 lines · Tony Lindgren

arch/arm/mach-omap2/powerdomain.c int pwrdm_complete_init(void) · line 383

Quoted 6 lines · Keerthy
arch/arm/mach-omap2/powerdomain.c +6 -0
+	/* Only AM43XX can lose pwrdm context during rtc-ddr suspend */
+	if (soc_is_am43xx()) {
+		nb.notifier_call = cpu_notifier;
+		cpu_pm_register_notifier(&nb);
+	}
+

Hmm in patch 3/4 you add omap4_pwrdm_save_context(), I think that we'd want to run with the notifier for cpuidle on omap4?

Okay i believe that is not needed for cpuidle on omap4. PRCM on wakeup domain so save/restore not needed for powerdomain on omap4.

Quoted 6 lines
Quoted 1 line

Tero can confirm the same.

Yea I don't believe this is needed. Only certain portions of the OMAP4 PRCM lose context during device off mode (which is currently not supported by linux), and whatever portions do lose, they should use the SAR_RAM approach for context save/restore, as that is supported by HW/ROM code.

OK

Quoted 2 lines
Quoted 2 lines

Should i rename omap4_pwrdm_save_context to am43xx_pwrdm_save_context to avoid confusion?

No need to, it follows the naming prm44xx.c.

Regards,

Tony