Power Management Device Latencies Measurement

From OMAPpedia

(Difference between revisions)
Jump to: navigation, search
Line 191: Line 191:
  |-
  |-
  |omap_sram_idle 7
  |omap_sram_idle 7
-
  |wake-up trace point 7
+
  |wake-up trace point 7, HW trace B
-
|-
+
-
|omap_sram_idle 8
+
-
|wake-up trace point 8
+
  |- style="font-style:italic; color:green;"
  |- style="font-style:italic; color:green;"
  |Idle exit
  |Idle exit
Line 202: Line 199:
<nowiki>*</nowiki>: Because of the difficulty to add trace code for HW/SW tracing in the early wake-up code path, the MPU context restore code in ASM (triggered by the ROM code) is considered as part of the HW wake-up sequence. This code path is executed for OFF mode only.
<nowiki>*</nowiki>: Because of the difficulty to add trace code for HW/SW tracing in the early wake-up code path, the MPU context restore code in ASM (triggered by the ROM code) is considered as part of the HW wake-up sequence. This code path is executed for OFF mode only.
-
Some timings measurements have been made at chip characterization. The following table gives the results:
+
Some timings measurements have been made at chip characterization. The timings for the HW part of the sequence are taken from those results. The following table gives the results:
{|border="1"
{|border="1"
  !Characterization measurement
  !Characterization measurement
Line 212: Line 209:
  |154
  |154
  | -
  | -
-
  |Not measured in OFF mode, to be done with System OFF support in the latest l-o
+
  |Not measured in OFF mode, to be done once System OFF support is in l-o
  |-
  |-
  |HW total sleep latency: from WFI enter till System OFF (voltages and external clocks cut off)
  |HW total sleep latency: from WFI enter till System OFF (voltages and external clocks cut off)

Revision as of 16:42, 8 November 2010

Contents

PM Devices constraintes measurements

Introduction

To correctly implement the device latency constraint support it is needed to get accurate measurements of the system low power modes overhead:

This wiki page details the measurements setup and the results. The latency data is to be fed into the constraints latency patches.

Kernel patches & build

Some kernel changes are required for the kernel instrumentation. The patches and config are attached to this page

Changes: DSS for Beagle, Initramfs Busybox root FS

HW traces details

The trace points are connected on Beagleboard rev B7.

Because of the difficulty to add trace code for HW/SW tracing in the early wake-up code path, the MPU context restore code in ASM (triggered by the ROM code) is considered as part of the HW wake-up sequence. This code path is executed for OFF mode only.

!Warning! The HW power supplies and external clocks are not cut off in this config (no support for System OFF in l-o), so the HW latencies are lower than expected. The measurements from TI are used for the real HW latency.

Here are some scope screenshots showing the time delta between the wake-up event (USER button press, trace A) and the end of omap_sram_idle (USR1 Led).

For RET mode, showing a delta of 408us:

Scope capture ret.jpg

For OFF mode, showing a delta of 2700us:

Scope capture off.jpg

SW trace usage

Enable the power events and dump the trace:

# echo 1 > /debug/tracing/events/power/enable
# cat /debug/tracing/trace_pipe &

Trigger the suspend, RET mode:

# echo 0 > /debug/pm_debug/enable_off_mode
# echo mem > /sys/power/state
[ 3966.216278] PM: Syncing filesystems ... done.
[ 3966.221557] Freezing user space processes ... (elapsed 0.02 seconds) done.
[ 3966.249267] Freezing remaining freezable tasks ... (elapsed 0.02 seconds) done.
[ 3966.281188] Suspending console(s) (use no_console_suspend to debug)
[ 3966.404327] PM: suspend of devices complete after 112.426 msecs
[ 3966.406127] PM: late suspend of devices complete after 1.739 msecs
[ 3966.406158] Disabling non-boot CPUs ...
[ 3967.267150] Successfully put all powerdomains to target state
[ 3967.267791] PM: early resume of devices complete after 0.396 msecs
[ 3967.686279] PM: resume of devices complete after 418.243 msecs
[ 3967.726715] Restarting tasks ... done.
              sh-503   [000]  3966.406433: power_start: type=3 state=3 cpu_id=0    => Enter suspend
              sh-503   [000]  3966.406494: power_start: type=4 state=1 cpu_id=0    => First suspend trace point in omap_sram_idle
              sh-503   [000]  3966.406525: power_start: type=4 state=2 cpu_id=0    => ...
              sh-503   [000]  3966.406555: power_start: type=4 state=3 cpu_id=0
              sh-503   [000]  3966.406586: power_start: type=4 state=4 cpu_id=0
              sh-503   [000]  3966.406616: power_start: type=4 state=5 cpu_id=0
              sh-503   [000]  3966.406647: power_start: type=4 state=6 cpu_id=0
              sh-503   [000]  3966.406647: power_start: type=4 state=7 cpu_id=0
              sh-503   [000]  3966.406647: power_start: type=4 state=8 cpu_id=0    => Last trace for low power enter, just before WFI
              sh-503   [000]  3967.266937: power_start: type=5 state=1 cpu_id=0    => First wake-up trace point, at return from omap34xx_save_cpu_context_wfi
              sh-503   [000]  3967.266937: power_start: type=5 state=2 cpu_id=0    => ...
              sh-503   [000]  3967.266937: power_start: type=5 state=3 cpu_id=0
              sh-503   [000]  3967.266937: power_start: type=5 state=4 cpu_id=0
              sh-503   [000]  3967.267029: power_start: type=5 state=5 cpu_id=0
              sh-503   [000]  3967.267059: power_start: type=5 state=6 cpu_id=0
              sh-503   [000]  3967.267120: power_start: type=5 state=7 cpu_id=0    => Last wake-up trace point, at the end of omap_sram_idle
              sh-503   [000]  3967.267181: power_start: type=3 state=0 cpu_id=0    => Exit suspend

With OFF mode enabled:

# echo 1 > /debug/pm_debug/enable_off_mode
# echo mem > /sys/power/state
[ 1898.722778] PM: Syncing filesystems ... done.
[ 1898.728057] Freezing user space processes ... (elapsed 0.02 seconds) done.
[ 1898.755950] Freezing remaining freezable tasks ... (elapsed 0.02 seconds) done.
[ 1898.787872] Suspending console(s) (use no_console_suspend to debug)
[ 1898.910980] PM: suspend of devices complete after 112.396 msecs
[ 1898.912780] PM: late suspend of devices complete after 1.739 msecs
[ 1898.912811] Disabling non-boot CPUs ...
[ 1900.083923] Successfully put all powerdomains to target state
[ 1900.084686] PM: early resume of devices complete after 0.488 msecs
[ 1900.514953] PM: resume of devices complete after 429.962 msecs
[ 1900.555725] Restarting tasks ... done.
              sh-503   [000]  1898.913086: power_start: type=3 state=3 cpu_id=0    => Enter suspend
              sh-503   [000]  1898.913147: power_start: type=4 state=1 cpu_id=0    => First suspend trace point in omap_sram_idle
              sh-503   [000]  1898.913147: power_start: type=4 state=2 cpu_id=0    => ...
              sh-503   [000]  1898.913208: power_start: type=4 state=3 cpu_id=0
              sh-503   [000]  1898.913239: power_start: type=4 state=4 cpu_id=0
              sh-503   [000]  1898.913269: power_start: type=4 state=5 cpu_id=0
              sh-503   [000]  1898.913391: power_start: type=4 state=6 cpu_id=0
              sh-503   [000]  1898.913391: power_start: type=4 state=7 cpu_id=0
              sh-503   [000]  1898.914337: power_start: type=4 state=8 cpu_id=0    => Last trace for low power enter, just before WFI
              sh-503   [000]  1900.083405: power_start: type=5 state=1 cpu_id=0    => First wake-up trace point, at return from omap34xx_save_cpu_context_wfi
              sh-503   [000]  1900.083466: power_start: type=5 state=2 cpu_id=0    => ...
              sh-503   [000]  1900.083496: power_start: type=5 state=3 cpu_id=0
              sh-503   [000]  1900.083588: power_start: type=5 state=4 cpu_id=0
              sh-503   [000]  1900.083771: power_start: type=5 state=5 cpu_id=0
              sh-503   [000]  1900.083801: power_start: type=5 state=6 cpu_id=0
              sh-503   [000]  1900.083862: power_start: type=5 state=7 cpu_id=0    => Last wake-up trace point, at the end of omap_sram_idle
              sh-503   [000]  1900.083954: power_start: type=3 state=0 cpu_id=0    => Exit suspend

Timings results

Results interpretation

The low power transition sequence is pictured as nested calls to functions:

Low power transition sequence.png

The measured results (from the HW and SW traces) are mapped to the picutrede states according to the following table:

Picured state Trace point
Idle enter start suspend
omap_sram_idle 1 suspend trace point 1
omap_sram_idle 2 suspend trace point 2
omap_sram_idle 3 suspend trace point 3
omap_sram_idle 4 suspend trace point 4
omap_sram_idle 5 suspend trace point 5
omap_sram_idle 6 suspend trace point 6
omap_sram_idle 7 suspend trace point 7
WFI enter suspend trace point 8
System OFF active - sys_off_mode signal to be measured with System OFF support
Wake-up event HW trace A
System OFF inactive - sys_off_mode signal to be measured with System OFF support
WFI exit -*
omap_sram_idle 1 wake-up trace point 1*
omap_sram_idle 2 wake-up trace point 2
omap_sram_idle 3 wake-up trace point 3
omap_sram_idle 4 wake-up trace point 4
omap_sram_idle 5 wake-up trace point 5
omap_sram_idle 6 wake-up trace point 6
omap_sram_idle 7 wake-up trace point 7, HW trace B
Idle exit

*: Because of the difficulty to add trace code for HW/SW tracing in the early wake-up code path, the MPU context restore code in ASM (triggered by the ROM code) is considered as part of the HW wake-up sequence. This code path is executed for OFF mode only.

Some timings measurements have been made at chip characterization. The timings for the HW part of the sequence are taken from those results. The following table gives the results:

Characterization measurement Full RET (us) Full OFF (us) Remark
HW sleep latency: from WFI enter till sys_off_mode active 154 - Not measured in OFF mode, to be done once System OFF support is in l-o
HW total sleep latency: from WFI enter till System OFF (voltages and external clocks cut off) 494 3784
HW wake-up latency: from sys_off_mode inactive till WFI exit 245 - Not measured in OFF mode. The MPU context restore code is considered as part of the HW restore
HW total wake-up latency: from wake-up event till WFI exit 8479 8749 OK for RET since no MPU restore code is needed. OFF mode: it is assumed this contains the MPU context restore code


Full RET mode

Full OFF mode

Attachments

Kernel patches and config

File:OMAP latency measurements patches and config.tar.gz

--Jpihet 14:21, 5 November 2010 (UTC)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox