Skip to contentSkip to conversation

new PM branch: pm-20081106

PATCH In review Kevin Hilman 4 participants 12 messages Nov 7, 2008 – Nov 19, 2008 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

For those who want to experiment with the latest PM branch, it is now available in OMAP git as branch pm-20081106

The shortlog is below[1], but the significant thing for now is a rework of how UART handles its clocks and allows idle. I also did quite a bit of reordering and some restructuring.

I've tested this on Nokia HW and the basic retention-on-idle support on Beagle. I'm still waiting for my SDP to arrive, so haven't tested on SDP.

Kevin

[1]
Amit Kucheria (2):
OMAP: PM: Typo fix for clock_allow_idle
HSMMC: Make driver support dynamic idle

Jouni Hogander (5):
OMAP3: PM: Use pwrdm_set_next_pwrst instead of set_pwrdm_state in idle loop
OMAP3: Do not set mpu, core, neon states if cpuidle is used
OMAP3: PM: Do not set next states sw to control those is available
OMAP3: PM: Always return value in pwrdms_setup
OMAP3: PM: Fix wrong sequence in suspend.

Kalle Jokiniemi (3):
OMAP: PM: sysfs interface for enabling voltage off in idle
OMAP3: PM: Fix cpu idle init sequencing
OMAP: SRF: Fixes to shared resource framework (Ver.3)

Kevin Hilman (10):
OMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X
OMAP3: PM: Allow UARTs to be unclocked when inactive 8250: Allow platform to register PM hook
8250: when waking, PM hook should be called before accessing port
OMAP3: PM: UART: Add 8250 UART PM hook for suspend/resume
OMAP3: PM: UART save/restore support for OFF-mode OMAP2/3: HSMMC: Ensure HSMMC is fully reset on boot
OMAP3: PM: CPUidle: obey enable_off_mode flag
OMAP3: PM: CPUidle: restrict C-states on UART activity
OMAP3: PM: decouple PER and CORE context save and restore

Paul Walmsley (6):
OMAP2/3 PM: create the OMAP PM interface and add a default OMAP PM no-op layer. OMAP2/3 omapdev: add basic omapdev structure
OMAP242x omapdev: add OMAP242x omapdev records
OMAP243x omapdev: add OMAP243x omapdev records
OMAP3xxx omapdev: add OMAP3xxx omapdev records
OMAP2/3 omapdev: add code to walk the omapdev records

Peter 'p2' De Schrijver (9):
OMAP: PM counter infrastructure.
OMAP: PM: Hook into PM counters
OMAP: PM: Add closures to clkdm_for_each and pwrdm_for_each.
OMAP: PM: Add pm-debug counters
OMAP: PM debug: make powerdomains use PM-debug counters
OMAP: PM: Add definitions for ETK pads and observability registers
OMAP: Debug observability and ETK padconf implementation
OMAP: Add debug observablity (debobs) Kconfig item
OMAP: PM: Implement get_last_off_on_transaction_id()

Rajendra Nayak (23):
OMAP3: PM: GPMC context save/restore
OMAP3: PM: GPIO context save/restore
OMAP3: PM: I2C context save/restore
OMAP3: PM: INTC context save/restore
OMAP3: PM: PRCM context save/restore
OMAP3: PM: Populate scratchpad contents
OMAP3: PM: SCM context save/restore
OMAP3: PM: SRAM restore function
OMAP3: PM: handle PER/NEON/CORE in idle
OMAP3: PM: Restore MMU table entry
OMAP3: PM: MPU off-mode support
OMAP3: PM: CORE domain off-mode support
OMAP3: PM: allow runtime enable/disable of OFF mode
OMAP3: 3430SDP minimal kernel defconfig
OMAP3: PM: CPUidle: Basic support for C1-C2
OMAP3: PM: CPUidle: Enables state C4
OMAP3: PM: CPUidle: Enables C3 and C5
OMAP3: PM: CPUidle: Safe-state on bm-activity
OMAP3: PM: CPUidle: Enable Kconfig option for OMAP OMAP3 SRF: Generic shared resource f/w OMAP3 SRF: MPU/CORE/PD latency modeling OMAP3 SRF: omap3 srf driver
OMAP3 SRF: OMAP PM srf implementation

Tero Kristo (9):
OMAP: PM debug: do not print out status for meta powerdomains (dpll*)
OMAP: PM debug: Add PRCM register dump support
OMAP: PM: DMA context save / restore
OMAP: PM: off-mode support for DMA on EMU/HS devices
OMAP3: SRAM size fix for HS/EMU devices
OMAP3 PM: off-mode support for HS/EMU devices
OMAP3: PM: Enable SDRAM auto-refresh during sleep
OMAP: SDRC: Add new register definitions for SDRAM controller
OMAP3: PM: SDRC auto-refresh workaround for off-mode

#1 lore raw

Hello Kevin,

I am seeing a couple of issues on the 3430sdp with this latest pm branch. With the omap_3430sdp_min_defconfig I see a system freeze after bootup after the debug UART inactivity. Also system wide suspend seems to freeze. The system wide suspend freeze is seen even with the default (omap_3430sdp_defconfig) config.
I ran into these issue while validating the DVFS patches and haven't really looked further into what might be causing these. I have a ES3.0 GP based SDP board.

regards,
Rajendra

Quoted 117 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kevin Hilman
Sent: Friday, November 07, 2008 11:00 PM
To: [email protected]
Subject: new PM branch: pm-20081106

For those who want to experiment with the latest PM branch, it is now available in OMAP git as branch pm-20081106

The shortlog is below[1], but the significant thing for now is a rework of how UART handles its clocks and allows idle. I also did quite a bit of reordering and some restructuring.

I've tested this on Nokia HW and the basic retention-on-idle support on Beagle. I'm still waiting for my SDP to arrive, so haven't tested on SDP.

Kevin

[1]
Amit Kucheria (2):
OMAP: PM: Typo fix for clock_allow_idle
HSMMC: Make driver support dynamic idle

Jouni Hogander (5):
OMAP3: PM: Use pwrdm_set_next_pwrst instead of
set_pwrdm_state in idle loop
OMAP3: Do not set mpu, core, neon states if cpuidle is used
OMAP3: PM: Do not set next states sw to control those
is available
OMAP3: PM: Always return value in pwrdms_setup
OMAP3: PM: Fix wrong sequence in suspend.

Kalle Jokiniemi (3):
OMAP: PM: sysfs interface for enabling voltage off in idle
OMAP3: PM: Fix cpu idle init sequencing
OMAP: SRF: Fixes to shared resource framework (Ver.3)

Kevin Hilman (10):
OMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X
OMAP3: PM: Allow UARTs to be unclocked when inactive 8250: Allow platform to register PM hook
8250: when waking, PM hook should be called before
accessing port
OMAP3: PM: UART: Add 8250 UART PM hook for suspend/resume
OMAP3: PM: UART save/restore support for OFF-mode OMAP2/3: HSMMC: Ensure HSMMC is fully reset on boot
OMAP3: PM: CPUidle: obey enable_off_mode flag
OMAP3: PM: CPUidle: restrict C-states on UART activity
OMAP3: PM: decouple PER and CORE context save and restore

Paul Walmsley (6):
OMAP2/3 PM: create the OMAP PM interface and add a
default OMAP PM no-op layer.
OMAP2/3 omapdev: add basic omapdev structure OMAP242x omapdev: add OMAP242x omapdev records OMAP243x omapdev: add OMAP243x omapdev records OMAP3xxx omapdev: add OMAP3xxx omapdev records OMAP2/3 omapdev: add code to walk the omapdev records

Peter 'p2' De Schrijver (9):
OMAP: PM counter infrastructure.
OMAP: PM: Hook into PM counters
OMAP: PM: Add closures to clkdm_for_each and pwrdm_for_each.
OMAP: PM: Add pm-debug counters
OMAP: PM debug: make powerdomains use PM-debug counters
OMAP: PM: Add definitions for ETK pads and
observability registers
OMAP: Debug observability and ETK padconf implementation
OMAP: Add debug observablity (debobs) Kconfig item
OMAP: PM: Implement get_last_off_on_transaction_id()

Rajendra Nayak (23):
OMAP3: PM: GPMC context save/restore
OMAP3: PM: GPIO context save/restore
OMAP3: PM: I2C context save/restore
OMAP3: PM: INTC context save/restore
OMAP3: PM: PRCM context save/restore
OMAP3: PM: Populate scratchpad contents
OMAP3: PM: SCM context save/restore
OMAP3: PM: SRAM restore function
OMAP3: PM: handle PER/NEON/CORE in idle
OMAP3: PM: Restore MMU table entry
OMAP3: PM: MPU off-mode support
OMAP3: PM: CORE domain off-mode support
OMAP3: PM: allow runtime enable/disable of OFF mode
OMAP3: 3430SDP minimal kernel defconfig
OMAP3: PM: CPUidle: Basic support for C1-C2
OMAP3: PM: CPUidle: Enables state C4
OMAP3: PM: CPUidle: Enables C3 and C5
OMAP3: PM: CPUidle: Safe-state on bm-activity
OMAP3: PM: CPUidle: Enable Kconfig option for OMAP OMAP3 SRF: Generic shared resource f/w OMAP3 SRF: MPU/CORE/PD latency modeling OMAP3 SRF: omap3 srf driver
OMAP3 SRF: OMAP PM srf implementation

Tero Kristo (9):
OMAP: PM debug: do not print out status for meta
powerdomains (dpll*)
OMAP: PM debug: Add PRCM register dump support
OMAP: PM: DMA context save / restore
OMAP: PM: off-mode support for DMA on EMU/HS devices
OMAP3: SRAM size fix for HS/EMU devices
OMAP3 PM: off-mode support for HS/EMU devices
OMAP3: PM: Enable SDRAM auto-refresh during sleep
OMAP: SDRC: Add new register definitions for SDRAM controller
OMAP3: PM: SDRC auto-refresh workaround for off-mode

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 8 lines · Rajendra Nayak

I am seeing a couple of issues on the 3430sdp with this latest pm branch. With the omap_3430sdp_min_defconfig I see a system freeze after bootup after the debug UART inactivity. Also system wide suspend seems to freeze. The system wide suspend freeze is seen even with the default (omap_3430sdp_defconfig) config. I ran into these issue while validating the DVFS patches and haven't really looked further into what might be causing these. I have a ES3.0 GP based SDP board.

Rajendra,

I just pushed another patch to pm-20081106 for you to try. This reverts a commit[1] from linux-omap which is causing problems coming out of retention.

Could you update your PM branch, and also modify the 'enabled_uarts' settings in your board-3430sdp.c file so that only the console UART is enabled. Doing this would help me understand what's working on SDP.

Until I get my SDP, I'll need to rely on you for this testing.

Kevin

[1] 2ac1da8c787f73f067e717408e631501ba60aabc

Quoted 117 lines
Quoted 117 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kevin Hilman
Sent: Friday, November 07, 2008 11:00 PM
To: [email protected]
Subject: new PM branch: pm-20081106

For those who want to experiment with the latest PM branch, it is now available in OMAP git as branch pm-20081106

The shortlog is below[1], but the significant thing for now is a rework of how UART handles its clocks and allows idle. I also did quite a bit of reordering and some restructuring.

I've tested this on Nokia HW and the basic retention-on-idle support on Beagle. I'm still waiting for my SDP to arrive, so haven't tested on SDP.

Kevin

[1]
Amit Kucheria (2):
OMAP: PM: Typo fix for clock_allow_idle
HSMMC: Make driver support dynamic idle

Jouni Hogander (5):
OMAP3: PM: Use pwrdm_set_next_pwrst instead of
set_pwrdm_state in idle loop
OMAP3: Do not set mpu, core, neon states if cpuidle is used
OMAP3: PM: Do not set next states sw to control those
is available
OMAP3: PM: Always return value in pwrdms_setup
OMAP3: PM: Fix wrong sequence in suspend.

Kalle Jokiniemi (3):
OMAP: PM: sysfs interface for enabling voltage off in idle
OMAP3: PM: Fix cpu idle init sequencing
OMAP: SRF: Fixes to shared resource framework (Ver.3)

Kevin Hilman (10):
OMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X
OMAP3: PM: Allow UARTs to be unclocked when inactive 8250: Allow platform to register PM hook
8250: when waking, PM hook should be called before
accessing port
OMAP3: PM: UART: Add 8250 UART PM hook for suspend/resume
OMAP3: PM: UART save/restore support for OFF-mode OMAP2/3: HSMMC: Ensure HSMMC is fully reset on boot
OMAP3: PM: CPUidle: obey enable_off_mode flag
OMAP3: PM: CPUidle: restrict C-states on UART activity
OMAP3: PM: decouple PER and CORE context save and restore

Paul Walmsley (6):
OMAP2/3 PM: create the OMAP PM interface and add a
default OMAP PM no-op layer.
OMAP2/3 omapdev: add basic omapdev structure OMAP242x omapdev: add OMAP242x omapdev records OMAP243x omapdev: add OMAP243x omapdev records OMAP3xxx omapdev: add OMAP3xxx omapdev records OMAP2/3 omapdev: add code to walk the omapdev records

Peter 'p2' De Schrijver (9):
OMAP: PM counter infrastructure.
OMAP: PM: Hook into PM counters
OMAP: PM: Add closures to clkdm_for_each and pwrdm_for_each.
OMAP: PM: Add pm-debug counters
OMAP: PM debug: make powerdomains use PM-debug counters
OMAP: PM: Add definitions for ETK pads and
observability registers
OMAP: Debug observability and ETK padconf implementation
OMAP: Add debug observablity (debobs) Kconfig item
OMAP: PM: Implement get_last_off_on_transaction_id()

Rajendra Nayak (23):
OMAP3: PM: GPMC context save/restore
OMAP3: PM: GPIO context save/restore
OMAP3: PM: I2C context save/restore
OMAP3: PM: INTC context save/restore
OMAP3: PM: PRCM context save/restore
OMAP3: PM: Populate scratchpad contents
OMAP3: PM: SCM context save/restore
OMAP3: PM: SRAM restore function
OMAP3: PM: handle PER/NEON/CORE in idle
OMAP3: PM: Restore MMU table entry
OMAP3: PM: MPU off-mode support
OMAP3: PM: CORE domain off-mode support
OMAP3: PM: allow runtime enable/disable of OFF mode
OMAP3: 3430SDP minimal kernel defconfig
OMAP3: PM: CPUidle: Basic support for C1-C2
OMAP3: PM: CPUidle: Enables state C4
OMAP3: PM: CPUidle: Enables C3 and C5
OMAP3: PM: CPUidle: Safe-state on bm-activity
OMAP3: PM: CPUidle: Enable Kconfig option for OMAP OMAP3 SRF: Generic shared resource f/w OMAP3 SRF: MPU/CORE/PD latency modeling OMAP3 SRF: omap3 srf driver
OMAP3 SRF: OMAP PM srf implementation

Tero Kristo (9):
OMAP: PM debug: do not print out status for meta
powerdomains (dpll*)
OMAP: PM debug: Add PRCM register dump support
OMAP: PM: DMA context save / restore
OMAP: PM: off-mode support for DMA on EMU/HS devices
OMAP3: SRAM size fix for HS/EMU devices
OMAP3 PM: off-mode support for HS/EMU devices
OMAP3: PM: Enable SDRAM auto-refresh during sleep
OMAP: SDRC: Add new register definitions for SDRAM controller
OMAP3: PM: SDRC auto-refresh workaround for off-mode

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 10 lines · ext Kevin Hilman
Quoted 8 lines · Rajendra Nayak

I am seeing a couple of issues on the 3430sdp with this latest pm branch. With the omap_3430sdp_min_defconfig I see a system freeze after bootup after the debug UART inactivity. Also system wide suspend seems to freeze. The system wide suspend freeze is seen even with the default (omap_3430sdp_defconfig) config. I ran into these issue while validating the DVFS patches and haven't really looked further into what might be causing these. I have a ES3.0 GP based SDP board.

This branch is still broken, I will send a patch soon. The problem is in uart clock handling. New implementation allows situation where uart is tried to be used for TX when clocks are disabled.

Quoted 138 lines

Rajendra,

I just pushed another patch to pm-20081106 for you to try. This reverts a commit[1] from linux-omap which is causing problems coming out of retention.

Could you update your PM branch, and also modify the 'enabled_uarts' settings in your board-3430sdp.c file so that only the console UART is enabled. Doing this would help me understand what's working on SDP.

Until I get my SDP, I'll need to rely on you for this testing.

Kevin

[1] 2ac1da8c787f73f067e717408e631501ba60aabc

Quoted 110 lines
Quoted 110 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kevin Hilman
Sent: Friday, November 07, 2008 11:00 PM
To: [email protected]
Subject: new PM branch: pm-20081106

For those who want to experiment with the latest PM branch, it is now available in OMAP git as branch pm-20081106

The shortlog is below[1], but the significant thing for now is a rework of how UART handles its clocks and allows idle. I also did quite a bit of reordering and some restructuring.

I've tested this on Nokia HW and the basic retention-on-idle support on Beagle. I'm still waiting for my SDP to arrive, so haven't tested on SDP.

Kevin

[1]
Amit Kucheria (2):
OMAP: PM: Typo fix for clock_allow_idle
HSMMC: Make driver support dynamic idle

Jouni Hogander (5):
OMAP3: PM: Use pwrdm_set_next_pwrst instead of
set_pwrdm_state in idle loop
OMAP3: Do not set mpu, core, neon states if cpuidle is used
OMAP3: PM: Do not set next states sw to control those
is available
OMAP3: PM: Always return value in pwrdms_setup
OMAP3: PM: Fix wrong sequence in suspend.

Kalle Jokiniemi (3):
OMAP: PM: sysfs interface for enabling voltage off in idle
OMAP3: PM: Fix cpu idle init sequencing
OMAP: SRF: Fixes to shared resource framework (Ver.3)

Kevin Hilman (10):
OMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X
OMAP3: PM: Allow UARTs to be unclocked when inactive 8250: Allow platform to register PM hook
8250: when waking, PM hook should be called before
accessing port
OMAP3: PM: UART: Add 8250 UART PM hook for suspend/resume
OMAP3: PM: UART save/restore support for OFF-mode OMAP2/3: HSMMC: Ensure HSMMC is fully reset on boot
OMAP3: PM: CPUidle: obey enable_off_mode flag
OMAP3: PM: CPUidle: restrict C-states on UART activity
OMAP3: PM: decouple PER and CORE context save and restore

Paul Walmsley (6):
OMAP2/3 PM: create the OMAP PM interface and add a
default OMAP PM no-op layer.
OMAP2/3 omapdev: add basic omapdev structure OMAP242x omapdev: add OMAP242x omapdev records OMAP243x omapdev: add OMAP243x omapdev records OMAP3xxx omapdev: add OMAP3xxx omapdev records OMAP2/3 omapdev: add code to walk the omapdev records

Peter 'p2' De Schrijver (9):
OMAP: PM counter infrastructure.
OMAP: PM: Hook into PM counters
OMAP: PM: Add closures to clkdm_for_each and pwrdm_for_each.
OMAP: PM: Add pm-debug counters
OMAP: PM debug: make powerdomains use PM-debug counters
OMAP: PM: Add definitions for ETK pads and
observability registers
OMAP: Debug observability and ETK padconf implementation
OMAP: Add debug observablity (debobs) Kconfig item
OMAP: PM: Implement get_last_off_on_transaction_id()

Rajendra Nayak (23):
OMAP3: PM: GPMC context save/restore
OMAP3: PM: GPIO context save/restore
OMAP3: PM: I2C context save/restore
OMAP3: PM: INTC context save/restore
OMAP3: PM: PRCM context save/restore
OMAP3: PM: Populate scratchpad contents
OMAP3: PM: SCM context save/restore
OMAP3: PM: SRAM restore function
OMAP3: PM: handle PER/NEON/CORE in idle
OMAP3: PM: Restore MMU table entry
OMAP3: PM: MPU off-mode support
OMAP3: PM: CORE domain off-mode support
OMAP3: PM: allow runtime enable/disable of OFF mode
OMAP3: 3430SDP minimal kernel defconfig
OMAP3: PM: CPUidle: Basic support for C1-C2
OMAP3: PM: CPUidle: Enables state C4
OMAP3: PM: CPUidle: Enables C3 and C5
OMAP3: PM: CPUidle: Safe-state on bm-activity
OMAP3: PM: CPUidle: Enable Kconfig option for OMAP OMAP3 SRF: Generic shared resource f/w OMAP3 SRF: MPU/CORE/PD latency modeling OMAP3 SRF: omap3 srf driver
OMAP3 SRF: OMAP PM srf implementation

Tero Kristo (9):
OMAP: PM debug: do not print out status for meta
powerdomains (dpll*)
OMAP: PM debug: Add PRCM register dump support
OMAP: PM: DMA context save / restore
OMAP: PM: off-mode support for DMA on EMU/HS devices
OMAP3: SRAM size fix for HS/EMU devices
OMAP3 PM: off-mode support for HS/EMU devices
OMAP3: PM: Enable SDRAM auto-refresh during sleep
OMAP: SDRC: Add new register definitions for SDRAM controller
OMAP3: PM: SDRC auto-refresh workaround for off-mode

Quoted 7 lines
Quoted 7 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 6 lines
Jouni Högander

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw

PATCH 1/1 OMAP3: UART: Make sure that uart clocks are enabled when needed

Current implementation makes it possible that printouts are written into UART while its clocks are disabled. This causes freeze.

This patch contains possible fix for this.

---
 arch/arm/mach-omap2/pm34xx.c             |    6 ++++++
 arch/arm/mach-omap2/serial.c             |   30 ++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/serial.h |    2 ++
 3 files changed, 38 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm34xx.c +6 -0
index d480c39..3838a19 100644
@@ -320,6 +320,7 @@ void omap_sram_idle(void)
 	/* PER */
 	per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
 	if (per_next_state < PWRDM_POWER_ON) {
+		omap_uart_prepare_idle(2);
 		omap2_gpio_prepare_for_retention();
 		if (per_next_state == PWRDM_POWER_OFF)
 			omap3_per_save_context();
@@ -328,6 +329,8 @@ void omap_sram_idle(void)
 	/* CORE */
 	core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
 	if (core_next_state < PWRDM_POWER_ON) {
+		omap_uart_prepare_idle(0);
+		omap_uart_prepare_idle(1);
 		if (core_next_state == PWRDM_POWER_OFF) {
 			prm_set_mod_reg_bits(OMAP3430_AUTO_OFF,
 					     OMAP3430_GR_MOD,
@@ -386,6 +389,8 @@ void omap_sram_idle(void)
 			prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF,
 					       OMAP3430_GR_MOD,
 					       OMAP3_PRM_VOLTCTRL_OFFSET);
+		omap_uart_resume_idle(0);
+		omap_uart_resume_idle(1);
 	}
 
 	/* PER */
@@ -394,6 +399,7 @@ void omap_sram_idle(void)
 		if (per_prev_state == PWRDM_POWER_OFF)
 			omap3_per_restore_context();
 		omap2_gpio_resume_after_retention();
+		omap_uart_resume_idle(2);
 	}
 
 	/* Enable smartreflex after WFI */
arch/arm/mach-omap2/serial.c +30 -0
index 65cce87..ef30d8d 100644
@@ -249,6 +249,36 @@ static void omap_uart_idle_timer(unsigned long data)
 	omap_uart_allow_sleep(uart);
 }
 
+void omap_uart_prepare_idle(int num)
+{
+	struct omap_uart_state *uart;
+
+	if (!clocks_off_while_idle)
+		return;
+
+	list_for_each_entry(uart, &uart_list, node) {
+		if (num == uart->num && uart->can_sleep) {
+			omap_uart_disable_clocks(uart);
+			return;
+		}
+	}
+}
+
+void omap_uart_resume_idle(int num)
+{
+	struct omap_uart_state *uart;
+
+	if (!clocks_off_while_idle)
+		return;
+
+	list_for_each_entry(uart, &uart_list, node) {
+		if (num == uart->num) {
+			omap_uart_enable_clocks(uart);
+			return;
+		}
+	}
+}
+
 void omap_uart_check_wakeup(void)
 {
 	struct omap_uart_state *uart;
arch/arm/plat-omap/include/mach/serial.h +2 -0
index 11ff540..254a775 100644
@@ -44,6 +44,8 @@
 extern void omap_serial_init(void);
 extern int omap_uart_can_sleep(void);
 extern void omap_uart_check_wakeup(void);
+extern void omap_uart_prepare_idle(int num);
+extern void omap_uart_resume_idle(int num);
 #endif
 
 #endif
Signature · 1 line
1.6.0.1
#5 lore raw

Re: [PATCH PM-20081106] OMAP3: UART: Make sure that uart clocks are enabled when needed

Quoted 2 lines · ext Jouni Hogander

Current implementation makes it possible that printouts are written into UART while its clocks are disabled. This causes freeze.

Now I got how this new uart clock handling works. Event thought this fix is not too sensible it actually does what is needed.

So the problem is that uart clocks are enabled in prcm_interrupt. Now if some other interrupt handler is run before prcm_interrupt_handler and it tries to printout something to uart -> system freezes.

Kevin, you should ensure some way that uart clocks are enabled right away after wakeup. This patch presents one possibile implementation. Another way could be to move uart_check_wakeup to be run in idle loop rather than in interrupt handler.

Quoted 109 lines

This patch contains possible fix for this.

---
 arch/arm/mach-omap2/pm34xx.c             |    6 ++++++
 arch/arm/mach-omap2/serial.c             |   30 ++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/serial.h |    2 ++
 3 files changed, 38 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm34xx.c +6 -0
index d480c39..3838a19 100644
@@ -320,6 +320,7 @@ void omap_sram_idle(void)
 	/* PER */
 	per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
 	if (per_next_state < PWRDM_POWER_ON) {
+		omap_uart_prepare_idle(2);
 		omap2_gpio_prepare_for_retention();
 		if (per_next_state == PWRDM_POWER_OFF)
 			omap3_per_save_context();
@@ -328,6 +329,8 @@ void omap_sram_idle(void)
 	/* CORE */
 	core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
 	if (core_next_state < PWRDM_POWER_ON) {
+		omap_uart_prepare_idle(0);
+		omap_uart_prepare_idle(1);
 		if (core_next_state == PWRDM_POWER_OFF) {
 			prm_set_mod_reg_bits(OMAP3430_AUTO_OFF,
 					     OMAP3430_GR_MOD,
@@ -386,6 +389,8 @@ void omap_sram_idle(void)
 			prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF,
 					       OMAP3430_GR_MOD,
 					       OMAP3_PRM_VOLTCTRL_OFFSET);
+		omap_uart_resume_idle(0);
+		omap_uart_resume_idle(1);
 	}
 
 	/* PER */
@@ -394,6 +399,7 @@ void omap_sram_idle(void)
 		if (per_prev_state == PWRDM_POWER_OFF)
 			omap3_per_restore_context();
 		omap2_gpio_resume_after_retention();
+		omap_uart_resume_idle(2);
 	}
 
 	/* Enable smartreflex after WFI */
arch/arm/mach-omap2/serial.c +30 -0
index 65cce87..ef30d8d 100644
@@ -249,6 +249,36 @@ static void omap_uart_idle_timer(unsigned long data)
 	omap_uart_allow_sleep(uart);
 }
 
+void omap_uart_prepare_idle(int num)
+{
+	struct omap_uart_state *uart;
+
+	if (!clocks_off_while_idle)
+		return;
+
+	list_for_each_entry(uart, &uart_list, node) {
+		if (num == uart->num && uart->can_sleep) {
+			omap_uart_disable_clocks(uart);
+			return;
+		}
+	}
+}
+
+void omap_uart_resume_idle(int num)
+{
+	struct omap_uart_state *uart;
+
+	if (!clocks_off_while_idle)
+		return;
+
+	list_for_each_entry(uart, &uart_list, node) {
+		if (num == uart->num) {
+			omap_uart_enable_clocks(uart);
+			return;
+		}
+	}
+}
+
 void omap_uart_check_wakeup(void)
 {
 	struct omap_uart_state *uart;
arch/arm/plat-omap/include/mach/serial.h +2 -0
index 11ff540..254a775 100644
@@ -44,6 +44,8 @@
 extern void omap_serial_init(void);
 extern int omap_uart_can_sleep(void);
 extern void omap_uart_check_wakeup(void);
+extern void omap_uart_prepare_idle(int num);
+extern void omap_uart_resume_idle(int num);
 #endif
 
 #endif
Signature · 6 lines
1.6.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 6 lines
Jouni Högander

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

Re: [PATCH PM-20081106] OMAP3: UART: Make sure that uart clocks are enabled when needed

Hi jouni,
Does the branch "PM-20081106" work for you?

When i try to do a "echo mem > /sys/power/state" on omap3evm.

the system hangs. Does Suspend-Resume work on this branch?

[root@OMAP3EVM /proc]# echo mem > /sys/power/state <6>PM: Syncing filesystems ... PM: Syncing filesystems ... done. done.
Freezing user space processes ... Freezing user space processes ... (elapsed 0.00 seconds) (elapsed 0.00 seconds) done. done.
Freezing remaining freezable tasks ... Freezing remaining freezable tasks ... (elapsed 0.00 seconds) (elapsed 0.00 seconds) done.done.

Suspending console(s) (use no_console_suspend to debug) Suspending console(s) (use no_console_suspend to debug)

---- system hangs----

With Regards,
Sriram

Quoted 130 lines · Högander Jouni
Quoted 2 lines · ext Jouni Hogander

Current implementation makes it possible that printouts are written into UART while its clocks are disabled. This causes freeze.

Now I got how this new uart clock handling works. Event thought this fix is not too sensible it actually does what is needed.

So the problem is that uart clocks are enabled in prcm_interrupt. Now if some other interrupt handler is run before prcm_interrupt_handler and it tries to printout something to uart -> system freezes.

Kevin, you should ensure some way that uart clocks are enabled right away after wakeup. This patch presents one possibile implementation. Another way could be to move uart_check_wakeup to be run in idle loop rather than in interrupt handler.

Quoted 105 lines

This patch contains possible fix for this.

---
 arch/arm/mach-omap2/pm34xx.c             |    6 ++++++
 arch/arm/mach-omap2/serial.c             |   30 ++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/serial.h |    2 ++
 3 files changed, 38 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm34xx.c +6 -0
index d480c39..3838a19 100644
@@ -320,6 +320,7 @@ void omap_sram_idle(void)
      /* PER */
      per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
      if (per_next_state < PWRDM_POWER_ON) {
+             omap_uart_prepare_idle(2);
              omap2_gpio_prepare_for_retention();
              if (per_next_state == PWRDM_POWER_OFF)
                      omap3_per_save_context();
@@ -328,6 +329,8 @@ void omap_sram_idle(void)
      /* CORE */
      core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
      if (core_next_state < PWRDM_POWER_ON) {
+             omap_uart_prepare_idle(0);
+             omap_uart_prepare_idle(1);
              if (core_next_state == PWRDM_POWER_OFF) {
                      prm_set_mod_reg_bits(OMAP3430_AUTO_OFF,
                                           OMAP3430_GR_MOD,
@@ -386,6 +389,8 @@ void omap_sram_idle(void)
                      prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF,
                                             OMAP3430_GR_MOD,
                                             OMAP3_PRM_VOLTCTRL_OFFSET);
+             omap_uart_resume_idle(0);
+             omap_uart_resume_idle(1);
      }
 
      /* PER */
@@ -394,6 +399,7 @@ void omap_sram_idle(void)
              if (per_prev_state == PWRDM_POWER_OFF)
                      omap3_per_restore_context();
              omap2_gpio_resume_after_retention();
+             omap_uart_resume_idle(2);
      }
 
      /* Enable smartreflex after WFI */
arch/arm/mach-omap2/serial.c +30 -0
index 65cce87..ef30d8d 100644
@@ -249,6 +249,36 @@ static void omap_uart_idle_timer(unsigned long data)
      omap_uart_allow_sleep(uart);
 }
 
+void omap_uart_prepare_idle(int num)
+{
+     struct omap_uart_state *uart;
+
+     if (!clocks_off_while_idle)
+             return;
+
+     list_for_each_entry(uart, &uart_list, node) {
+             if (num == uart->num && uart->can_sleep) {
+                     omap_uart_disable_clocks(uart);
+                     return;
+             }
+     }
+}
+
+void omap_uart_resume_idle(int num)
+{
+     struct omap_uart_state *uart;
+
+     if (!clocks_off_while_idle)
+             return;
+
+     list_for_each_entry(uart, &uart_list, node) {
+             if (num == uart->num) {
+                     omap_uart_enable_clocks(uart);
+                     return;
+             }
+     }
+}
+
 void omap_uart_check_wakeup(void)
 {
      struct omap_uart_state *uart;
arch/arm/plat-omap/include/mach/serial.h +2 -1
index 11ff540..254a775 100644
@@ -44,6 +44,8 @@
 extern void omap_serial_init(void);
 extern int omap_uart_can_sleep(void);
 extern void omap_uart_check_wakeup(void);
+extern void omap_uart_prepare_idle(int num);
+extern void omap_uart_resume_idle(int num);
 #endif
 
 #endif
--

1.6.0.1

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Jouni Högander

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

Re: [PATCH PM-20081106] OMAP3: UART: Make sure that uart clocks are enabled when needed

Quoted 6 lines · ext Sriram V

Hi jouni,
Does the branch "PM-20081106" work for you?

When i try to do a "echo mem > /sys/power/state" on omap3evm.

the system hangs. Does Suspend-Resume work on this branch?

Yes, but you need to apply this patch (or something similiar). Have you done it and still seeing problems?

Quoted 159 lines

[root@OMAP3EVM /proc]# echo mem > /sys/power/state <6>PM: Syncing filesystems ... PM: Syncing filesystems ... done. done.
Freezing user space processes ... Freezing user space processes ... (elapsed 0.00 seconds) (elapsed 0.00 seconds) done. done.
Freezing remaining freezable tasks ... Freezing remaining freezable tasks ... (elapsed 0.00 seconds) (elapsed 0.00 seconds) done.done.

Suspending console(s) (use no_console_suspend to debug) Suspending console(s) (use no_console_suspend to debug)

---- system hangs----

With Regards,
Sriram

Quoted 135 lines · Högander Jouni
Quoted 2 lines · ext Jouni Hogander

Current implementation makes it possible that printouts are written into UART while its clocks are disabled. This causes freeze.

Now I got how this new uart clock handling works. Event thought this fix is not too sensible it actually does what is needed.

So the problem is that uart clocks are enabled in prcm_interrupt. Now if some other interrupt handler is run before prcm_interrupt_handler and it tries to printout something to uart -> system freezes.

Kevin, you should ensure some way that uart clocks are enabled right away after wakeup. This patch presents one possibile implementation. Another way could be to move uart_check_wakeup to be run in idle loop rather than in interrupt handler.

Quoted 105 lines

This patch contains possible fix for this.

---
 arch/arm/mach-omap2/pm34xx.c             |    6 ++++++
 arch/arm/mach-omap2/serial.c             |   30 ++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/serial.h |    2 ++
 3 files changed, 38 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm34xx.c +6 -0
index d480c39..3838a19 100644
@@ -320,6 +320,7 @@ void omap_sram_idle(void)
      /* PER */
      per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
      if (per_next_state < PWRDM_POWER_ON) {
+             omap_uart_prepare_idle(2);
              omap2_gpio_prepare_for_retention();
              if (per_next_state == PWRDM_POWER_OFF)
                      omap3_per_save_context();
@@ -328,6 +329,8 @@ void omap_sram_idle(void)
      /* CORE */
      core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
      if (core_next_state < PWRDM_POWER_ON) {
+             omap_uart_prepare_idle(0);
+             omap_uart_prepare_idle(1);
              if (core_next_state == PWRDM_POWER_OFF) {
                      prm_set_mod_reg_bits(OMAP3430_AUTO_OFF,
                                           OMAP3430_GR_MOD,
@@ -386,6 +389,8 @@ void omap_sram_idle(void)
                      prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF,
                                             OMAP3430_GR_MOD,
                                             OMAP3_PRM_VOLTCTRL_OFFSET);
+             omap_uart_resume_idle(0);
+             omap_uart_resume_idle(1);
      }
 
      /* PER */
@@ -394,6 +399,7 @@ void omap_sram_idle(void)
              if (per_prev_state == PWRDM_POWER_OFF)
                      omap3_per_restore_context();
              omap2_gpio_resume_after_retention();
+             omap_uart_resume_idle(2);
      }
 
      /* Enable smartreflex after WFI */
arch/arm/mach-omap2/serial.c +30 -0
index 65cce87..ef30d8d 100644
@@ -249,6 +249,36 @@ static void omap_uart_idle_timer(unsigned long data)
      omap_uart_allow_sleep(uart);
 }
 
+void omap_uart_prepare_idle(int num)
+{
+     struct omap_uart_state *uart;
+
+     if (!clocks_off_while_idle)
+             return;
+
+     list_for_each_entry(uart, &uart_list, node) {
+             if (num == uart->num && uart->can_sleep) {
+                     omap_uart_disable_clocks(uart);
+                     return;
+             }
+     }
+}
+
+void omap_uart_resume_idle(int num)
+{
+     struct omap_uart_state *uart;
+
+     if (!clocks_off_while_idle)
+             return;
+
+     list_for_each_entry(uart, &uart_list, node) {
+             if (num == uart->num) {
+                     omap_uart_enable_clocks(uart);
+                     return;
+             }
+     }
+}
+
 void omap_uart_check_wakeup(void)
 {
      struct omap_uart_state *uart;
arch/arm/plat-omap/include/mach/serial.h +2 -1
index 11ff540..254a775 100644
@@ -44,6 +44,8 @@
 extern void omap_serial_init(void);
 extern int omap_uart_can_sleep(void);
 extern void omap_uart_check_wakeup(void);
+extern void omap_uart_prepare_idle(int num);
+extern void omap_uart_resume_idle(int num);
 #endif
 
 #endif
--

1.6.0.1

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Jouni Högander

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 6 lines
Jouni Högander

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

Re: [PATCH PM-20081106] OMAP3: UART: Make sure that uart clocks are enabled when needed

Hi,
I just tried to find the source of the problem with PM-20081106 branch. Am trying to debug this issue now.

I tried to do a check to find which commit caused the problem. I find that it is something to do with uart pm support.

The patch commit 1e274e917472dba6c216b67c3afb3e7abe6e77e4
OMAP3: PM: Allow UARTs to be unclocked when inactive

introduces this issue.

Regards,
sriram

Quoted 9 lines · Sriram V

Hi jouni,
I have disabled all the drivers except i2c and network also. i have applied your patch and still seeing problems.

doing a echo mem > /sys/power/state makes the system to hang.

does this work for you?

Quoted 183 lines

Regards,
sriram

Quoted 176 lines · Högander Jouni
Quoted 6 lines · ext Sriram V

Hi jouni,
Does the branch "PM-20081106" work for you?

When i try to do a "echo mem > /sys/power/state" on omap3evm.

the system hangs. Does Suspend-Resume work on this branch?

Yes, but you need to apply this patch (or something similiar). Have you done it and still seeing problems?

Quoted 17 lines

[root@OMAP3EVM /proc]# echo mem > /sys/power/state <6>PM: Syncing filesystems ... PM: Syncing filesystems ... done. done.
Freezing user space processes ... Freezing user space processes ... (elapsed 0.00 seconds) (elapsed 0.00 seconds) done. done.
Freezing remaining freezable tasks ... Freezing remaining freezable tasks ... (elapsed 0.00 seconds) (elapsed 0.00 seconds) done.done.

Suspending console(s) (use no_console_suspend to debug) Suspending console(s) (use no_console_suspend to debug)

---- system hangs----

Quoted 142 lines

With Regards,
Sriram

Quoted 135 lines · Högander Jouni
Quoted 2 lines · ext Jouni Hogander

Current implementation makes it possible that printouts are written into UART while its clocks are disabled. This causes freeze.

Now I got how this new uart clock handling works. Event thought this fix is not too sensible it actually does what is needed.

So the problem is that uart clocks are enabled in prcm_interrupt. Now if some other interrupt handler is run before prcm_interrupt_handler and it tries to printout something to uart -> system freezes.

Kevin, you should ensure some way that uart clocks are enabled right away after wakeup. This patch presents one possibile implementation. Another way could be to move uart_check_wakeup to be run in idle loop rather than in interrupt handler.

Quoted 105 lines

This patch contains possible fix for this.

---
 arch/arm/mach-omap2/pm34xx.c             |    6 ++++++
 arch/arm/mach-omap2/serial.c             |   30 ++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/serial.h |    2 ++
 3 files changed, 38 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm34xx.c +6 -0
index d480c39..3838a19 100644
@@ -320,6 +320,7 @@ void omap_sram_idle(void)
      /* PER */
      per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
      if (per_next_state < PWRDM_POWER_ON) {
+             omap_uart_prepare_idle(2);
              omap2_gpio_prepare_for_retention();
              if (per_next_state == PWRDM_POWER_OFF)
                      omap3_per_save_context();
@@ -328,6 +329,8 @@ void omap_sram_idle(void)
      /* CORE */
      core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
      if (core_next_state < PWRDM_POWER_ON) {
+             omap_uart_prepare_idle(0);
+             omap_uart_prepare_idle(1);
              if (core_next_state == PWRDM_POWER_OFF) {
                      prm_set_mod_reg_bits(OMAP3430_AUTO_OFF,
                                           OMAP3430_GR_MOD,
@@ -386,6 +389,8 @@ void omap_sram_idle(void)
                      prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF,
                                             OMAP3430_GR_MOD,
                                             OMAP3_PRM_VOLTCTRL_OFFSET);
+             omap_uart_resume_idle(0);
+             omap_uart_resume_idle(1);
      }
 
      /* PER */
@@ -394,6 +399,7 @@ void omap_sram_idle(void)
              if (per_prev_state == PWRDM_POWER_OFF)
                      omap3_per_restore_context();
              omap2_gpio_resume_after_retention();
+             omap_uart_resume_idle(2);
      }
 
      /* Enable smartreflex after WFI */
arch/arm/mach-omap2/serial.c +30 -0
index 65cce87..ef30d8d 100644
@@ -249,6 +249,36 @@ static void omap_uart_idle_timer(unsigned long data)
      omap_uart_allow_sleep(uart);
 }
 
+void omap_uart_prepare_idle(int num)
+{
+     struct omap_uart_state *uart;
+
+     if (!clocks_off_while_idle)
+             return;
+
+     list_for_each_entry(uart, &uart_list, node) {
+             if (num == uart->num && uart->can_sleep) {
+                     omap_uart_disable_clocks(uart);
+                     return;
+             }
+     }
+}
+
+void omap_uart_resume_idle(int num)
+{
+     struct omap_uart_state *uart;
+
+     if (!clocks_off_while_idle)
+             return;
+
+     list_for_each_entry(uart, &uart_list, node) {
+             if (num == uart->num) {
+                     omap_uart_enable_clocks(uart);
+                     return;
+             }
+     }
+}
+
 void omap_uart_check_wakeup(void)
 {
      struct omap_uart_state *uart;
arch/arm/plat-omap/include/mach/serial.h +2 -1
index 11ff540..254a775 100644
@@ -44,6 +44,8 @@
 extern void omap_serial_init(void);
 extern int omap_uart_can_sleep(void);
 extern void omap_uart_check_wakeup(void);
+extern void omap_uart_prepare_idle(int num);
+extern void omap_uart_resume_idle(int num);
 #endif
 
 #endif
--

1.6.0.1

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Jouni Högander

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Jouni Högander

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#10 lore raw

Re: [PATCH PM-20081106] OMAP3: UART: Make sure that uart clocks are enabled when needed

Quoted 5 lines · Sriram V

Hi,
I just tried to find the source of the problem with PM-20081106 branch. Am trying to debug this issue now.

Quoted 8 lines

I tried to do a check to find which commit caused the problem. I find that it is something to do with uart pm support.

The patch commit 1e274e917472dba6c216b67c3afb3e7abe6e77e4
OMAP3: PM: Allow UARTs to be unclocked when inactive introduces this issue.

Sriram,

Can you try Jouni's patch at the beginning of this thread on top of pm-20081106?

Kevin

Quoted 197 lines · Sriram V
Quoted 9 lines

Hi jouni,
I have disabled all the drivers except i2c and network also. i have applied your patch and still seeing problems.

doing a echo mem > /sys/power/state makes the system to hang.

does this work for you?

Quoted 183 lines

Regards,
sriram

Quoted 176 lines · Högander Jouni
Quoted 6 lines · ext Sriram V

Hi jouni,
Does the branch "PM-20081106" work for you?

When i try to do a "echo mem > /sys/power/state" on omap3evm.

the system hangs. Does Suspend-Resume work on this branch?

Yes, but you need to apply this patch (or something similiar). Have you done it and still seeing problems?

Quoted 17 lines

[root@OMAP3EVM /proc]# echo mem > /sys/power/state <6>PM: Syncing filesystems ... PM: Syncing filesystems ... done. done.
Freezing user space processes ... Freezing user space processes ... (elapsed 0.00 seconds) (elapsed 0.00 seconds) done. done.
Freezing remaining freezable tasks ... Freezing remaining freezable tasks ... (elapsed 0.00 seconds) (elapsed 0.00 seconds) done.done.

Suspending console(s) (use no_console_suspend to debug) Suspending console(s) (use no_console_suspend to debug)

---- system hangs----

Quoted 142 lines

With Regards,
Sriram

Quoted 135 lines · Högander Jouni
Quoted 2 lines · ext Jouni Hogander

Current implementation makes it possible that printouts are written into UART while its clocks are disabled. This causes freeze.

Now I got how this new uart clock handling works. Event thought this fix is not too sensible it actually does what is needed.

So the problem is that uart clocks are enabled in prcm_interrupt. Now if some other interrupt handler is run before prcm_interrupt_handler and it tries to printout something to uart -> system freezes.

Kevin, you should ensure some way that uart clocks are enabled right away after wakeup. This patch presents one possibile implementation. Another way could be to move uart_check_wakeup to be run in idle loop rather than in interrupt handler.

Quoted 105 lines

This patch contains possible fix for this.

---
 arch/arm/mach-omap2/pm34xx.c             |    6 ++++++
 arch/arm/mach-omap2/serial.c             |   30 ++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/serial.h |    2 ++
 3 files changed, 38 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm34xx.c +6 -0
index d480c39..3838a19 100644
@@ -320,6 +320,7 @@ void omap_sram_idle(void)
      /* PER */
      per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
      if (per_next_state < PWRDM_POWER_ON) {
+             omap_uart_prepare_idle(2);
              omap2_gpio_prepare_for_retention();
              if (per_next_state == PWRDM_POWER_OFF)
                      omap3_per_save_context();
@@ -328,6 +329,8 @@ void omap_sram_idle(void)
      /* CORE */
      core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
      if (core_next_state < PWRDM_POWER_ON) {
+             omap_uart_prepare_idle(0);
+             omap_uart_prepare_idle(1);
              if (core_next_state == PWRDM_POWER_OFF) {
                      prm_set_mod_reg_bits(OMAP3430_AUTO_OFF,
                                           OMAP3430_GR_MOD,
@@ -386,6 +389,8 @@ void omap_sram_idle(void)
                      prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF,
                                             OMAP3430_GR_MOD,
                                             OMAP3_PRM_VOLTCTRL_OFFSET);
+             omap_uart_resume_idle(0);
+             omap_uart_resume_idle(1);
      }
 
      /* PER */
@@ -394,6 +399,7 @@ void omap_sram_idle(void)
              if (per_prev_state == PWRDM_POWER_OFF)
                      omap3_per_restore_context();
              omap2_gpio_resume_after_retention();
+             omap_uart_resume_idle(2);
      }
 
      /* Enable smartreflex after WFI */
arch/arm/mach-omap2/serial.c +30 -0
index 65cce87..ef30d8d 100644
@@ -249,6 +249,36 @@ static void omap_uart_idle_timer(unsigned long data)
      omap_uart_allow_sleep(uart);
 }
 
+void omap_uart_prepare_idle(int num)
+{
+     struct omap_uart_state *uart;
+
+     if (!clocks_off_while_idle)
+             return;
+
+     list_for_each_entry(uart, &uart_list, node) {
+             if (num == uart->num && uart->can_sleep) {
+                     omap_uart_disable_clocks(uart);
+                     return;
+             }
+     }
+}
+
+void omap_uart_resume_idle(int num)
+{
+     struct omap_uart_state *uart;
+
+     if (!clocks_off_while_idle)
+             return;
+
+     list_for_each_entry(uart, &uart_list, node) {
+             if (num == uart->num) {
+                     omap_uart_enable_clocks(uart);
+                     return;
+             }
+     }
+}
+
 void omap_uart_check_wakeup(void)
 {
      struct omap_uart_state *uart;
arch/arm/plat-omap/include/mach/serial.h +2 -1
index 11ff540..254a775 100644
@@ -44,6 +44,8 @@
 extern void omap_serial_init(void);
 extern int omap_uart_can_sleep(void);
 extern void omap_uart_check_wakeup(void);
+extern void omap_uart_prepare_idle(int num);
+extern void omap_uart_resume_idle(int num);
 #endif
 
 #endif
--

1.6.0.1

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Jouni Högander

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Jouni Högander

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw

Re: [PATCH PM-20081106] OMAP3: UART: Make sure that uart clocks are enabled when needed

In reply to Jouni Hogander
Quoted 4 lines · Jouni Hogander

Current implementation makes it possible that printouts are written into UART while its clocks are disabled. This causes freeze.

This patch contains possible fix for this.

Thanks, pulling into PM branch until final solution can be found.

Kevin

Quoted 106 lines
---
 arch/arm/mach-omap2/pm34xx.c             |    6 ++++++
 arch/arm/mach-omap2/serial.c             |   30 ++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/mach/serial.h |    2 ++
 3 files changed, 38 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm34xx.c +6 -0
index d480c39..3838a19 100644
@@ -320,6 +320,7 @@ void omap_sram_idle(void)
 	/* PER */
 	per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
 	if (per_next_state < PWRDM_POWER_ON) {
+		omap_uart_prepare_idle(2);
 		omap2_gpio_prepare_for_retention();
 		if (per_next_state == PWRDM_POWER_OFF)
 			omap3_per_save_context();
@@ -328,6 +329,8 @@ void omap_sram_idle(void)
 	/* CORE */
 	core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
 	if (core_next_state < PWRDM_POWER_ON) {
+		omap_uart_prepare_idle(0);
+		omap_uart_prepare_idle(1);
 		if (core_next_state == PWRDM_POWER_OFF) {
 			prm_set_mod_reg_bits(OMAP3430_AUTO_OFF,
 					     OMAP3430_GR_MOD,
@@ -386,6 +389,8 @@ void omap_sram_idle(void)
 			prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF,
 					       OMAP3430_GR_MOD,
 					       OMAP3_PRM_VOLTCTRL_OFFSET);
+		omap_uart_resume_idle(0);
+		omap_uart_resume_idle(1);
 	}
 
 	/* PER */
@@ -394,6 +399,7 @@ void omap_sram_idle(void)
 		if (per_prev_state == PWRDM_POWER_OFF)
 			omap3_per_restore_context();
 		omap2_gpio_resume_after_retention();
+		omap_uart_resume_idle(2);
 	}
 
 	/* Enable smartreflex after WFI */
arch/arm/mach-omap2/serial.c +30 -0
index 65cce87..ef30d8d 100644
@@ -249,6 +249,36 @@ static void omap_uart_idle_timer(unsigned long data)
 	omap_uart_allow_sleep(uart);
 }
 
+void omap_uart_prepare_idle(int num)
+{
+	struct omap_uart_state *uart;
+
+	if (!clocks_off_while_idle)
+		return;
+
+	list_for_each_entry(uart, &uart_list, node) {
+		if (num == uart->num && uart->can_sleep) {
+			omap_uart_disable_clocks(uart);
+			return;
+		}
+	}
+}
+
+void omap_uart_resume_idle(int num)
+{
+	struct omap_uart_state *uart;
+
+	if (!clocks_off_while_idle)
+		return;
+
+	list_for_each_entry(uart, &uart_list, node) {
+		if (num == uart->num) {
+			omap_uart_enable_clocks(uart);
+			return;
+		}
+	}
+}
+
 void omap_uart_check_wakeup(void)
 {
 	struct omap_uart_state *uart;
arch/arm/plat-omap/include/mach/serial.h +2 -0
index 11ff540..254a775 100644
@@ -44,6 +44,8 @@
 extern void omap_serial_init(void);
 extern int omap_uart_can_sleep(void);
 extern void omap_uart_check_wakeup(void);
+extern void omap_uart_prepare_idle(int num);
+extern void omap_uart_resume_idle(int num);
 #endif
 
 #endif
Signature · 6 lines
1.6.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#12 lore raw
In reply to Kevin Hilman
Quoted 26 lines

-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Tuesday, November 11, 2008 10:51 PM
To: Rajendra Nayak
Cc: [email protected]
Subject: Re: new PM branch: pm-20081106

Quoted 8 lines · Rajendra Nayak

I am seeing a couple of issues on the 3430sdp with this latest pm branch. With the omap_3430sdp_min_defconfig I see a system freeze after bootup after the debug UART inactivity. Also system wide suspend seems to freeze. The system wide suspend freeze is seen even with the default (omap_3430sdp_defconfig) config. I ran into these issue while validating the DVFS patches and haven't really looked further into what might be causing these. I have a ES3.0 GP based SDP board.

Rajendra,

I just pushed another patch to pm-20081106 for you to try. This reverts a commit[1] from linux-omap which is causing problems coming out of retention.

Quoted 6 lines

Could you update your PM branch, and also modify the 'enabled_uarts' settings in your board-3430sdp.c file so that only the console UART is enabled. Doing this would help me understand what's working on SDP.

Until I get my SDP, I'll need to rely on you for this testing.

Hi Kevin,

Sorry for the delay in responding. The latest pm branch does seem
to work fine on my SDP after taking in Jouni's patch
"[PATCH PM-20081106] OMAP3: UART: Make sure that uart clocks are enabled when needed" and restricting the enabled_uarts to debug console.
I however did not see the VCORE led blink while hitting OFF.

regards,
Rajendra

Quoted 125 lines

[1] 2ac1da8c787f73f067e717408e631501ba60aabc

Quoted 8 lines
Quoted 8 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kevin Hilman
Sent: Friday, November 07, 2008 11:00 PM
To: [email protected]
Subject: new PM branch: pm-20081106

For those who want to experiment with the latest PM

branch, it is now

Quoted 7 lines
Quoted 7 lines

available in OMAP git as branch pm-20081106

The shortlog is below[1], but the significant thing for now is a rework of how UART handles its clocks and allows idle. I also did quite a bit of reordering and some restructuring.

I've tested this on Nokia HW and the basic

retention-on-idle support

Quoted 1 line
Quoted 1 line

on Beagle. I'm still waiting for my SDP to arrive, so

haven't tested

Quoted 101 lines
Quoted 101 lines

on SDP.

Kevin

[1]
Amit Kucheria (2):
OMAP: PM: Typo fix for clock_allow_idle
HSMMC: Make driver support dynamic idle

Jouni Hogander (5):
OMAP3: PM: Use pwrdm_set_next_pwrst instead of
set_pwrdm_state in idle loop
OMAP3: Do not set mpu, core, neon states if cpuidle is used
OMAP3: PM: Do not set next states sw to control those
is available
OMAP3: PM: Always return value in pwrdms_setup
OMAP3: PM: Fix wrong sequence in suspend.

Kalle Jokiniemi (3):
OMAP: PM: sysfs interface for enabling voltage off in idle
OMAP3: PM: Fix cpu idle init sequencing
OMAP: SRF: Fixes to shared resource framework (Ver.3)

Kevin Hilman (10):
OMAP3: PM: Add wake-up bit defintiions for CONTROL_PADCONF_X
OMAP3: PM: Allow UARTs to be unclocked when inactive 8250: Allow platform to register PM hook
8250: when waking, PM hook should be called before
accessing port
OMAP3: PM: UART: Add 8250 UART PM hook for suspend/resume
OMAP3: PM: UART save/restore support for OFF-mode OMAP2/3: HSMMC: Ensure HSMMC is fully reset on boot
OMAP3: PM: CPUidle: obey enable_off_mode flag
OMAP3: PM: CPUidle: restrict C-states on UART activity
OMAP3: PM: decouple PER and CORE context save and restore

Paul Walmsley (6):
OMAP2/3 PM: create the OMAP PM interface and add a
default OMAP PM no-op layer.
OMAP2/3 omapdev: add basic omapdev structure OMAP242x omapdev: add OMAP242x omapdev records OMAP243x omapdev: add OMAP243x omapdev records OMAP3xxx omapdev: add OMAP3xxx omapdev records OMAP2/3 omapdev: add code to walk the omapdev records

Peter 'p2' De Schrijver (9):
OMAP: PM counter infrastructure.
OMAP: PM: Hook into PM counters
OMAP: PM: Add closures to clkdm_for_each and pwrdm_for_each.
OMAP: PM: Add pm-debug counters
OMAP: PM debug: make powerdomains use PM-debug counters
OMAP: PM: Add definitions for ETK pads and
observability registers
OMAP: Debug observability and ETK padconf implementation
OMAP: Add debug observablity (debobs) Kconfig item
OMAP: PM: Implement get_last_off_on_transaction_id()

Rajendra Nayak (23):
OMAP3: PM: GPMC context save/restore
OMAP3: PM: GPIO context save/restore
OMAP3: PM: I2C context save/restore
OMAP3: PM: INTC context save/restore
OMAP3: PM: PRCM context save/restore
OMAP3: PM: Populate scratchpad contents
OMAP3: PM: SCM context save/restore
OMAP3: PM: SRAM restore function
OMAP3: PM: handle PER/NEON/CORE in idle
OMAP3: PM: Restore MMU table entry
OMAP3: PM: MPU off-mode support
OMAP3: PM: CORE domain off-mode support
OMAP3: PM: allow runtime enable/disable of OFF mode
OMAP3: 3430SDP minimal kernel defconfig
OMAP3: PM: CPUidle: Basic support for C1-C2
OMAP3: PM: CPUidle: Enables state C4
OMAP3: PM: CPUidle: Enables C3 and C5
OMAP3: PM: CPUidle: Safe-state on bm-activity
OMAP3: PM: CPUidle: Enable Kconfig option for OMAP OMAP3 SRF: Generic shared resource f/w OMAP3 SRF: MPU/CORE/PD latency modeling OMAP3 SRF: omap3 srf driver
OMAP3 SRF: OMAP PM srf implementation

Tero Kristo (9):
OMAP: PM debug: do not print out status for meta
powerdomains (dpll*)
OMAP: PM debug: Add PRCM register dump support
OMAP: PM: DMA context save / restore
OMAP: PM: off-mode support for DMA on EMU/HS devices
OMAP3: SRAM size fix for HS/EMU devices
OMAP3 PM: off-mode support for HS/EMU devices
OMAP3: PM: Enable SDRAM auto-refresh during sleep
OMAP: SDRC: Add new register definitions for SDRAM controller
OMAP3: PM: SDRC auto-refresh workaround for off-mode

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html