2/01/2013

What is latency budget in dynamic sleep?

In dynamic sleep scheme, sleep solver chooses the best low power modes from a pool of enabled low power modes to enter under a few system constraints. These constraints are:
(1) Sleep duration.
(2) Latency budget

The sleep duration is how long the subsystem can stay in the sleep state. The latency budget is how fast the subsystem needs to come out of sleep state to handle a system event. Basically, it is the interrupt latency the system can tolerate. This puts constraint on the total warmup time of the chosen low power modes. For instance, if the latency budget is 0x1, i.e. 1 sleep clock tick ~ 30us, this generally will disable XO shutdown or VDD min because either of these modes requires warmup time much longer than 30us. In other words, if system goes into XO shutdown, it will not be able to recover fast enough to satisfy the 30us latency requirement.

The latency budget is obtained by querying the sleep_latency_node, which is a NPA node.

/* Get the latency budget from the latency node. The latency node will
* return the minimum latency budget being requested by all clients.
* This lets us know how quickly we need to respond to an interrupt when
* it occurs. */
CORE_VERIFY( NPA_QUERY_SUCCESS == npa_query( gSleepLatencyNode,
NPA_QUERY_CURRENT_STATE,
&qres ) );

Software modules can register to the latency node and request for latency budget. This information is shown in the NPA dump, and logged in sleep info ulog. Here is an example of NPA dump that shows HKADC has a latency requirement of 1.

: npa_resource (name: "/core/cpu/latency") (handle: 0x90103260) (units: sclk) (resource max: 4294967295) (active max: 4294967295) (active state 1) (active headroom: 2) (request state: 1)
: npa_client (name: GPS_CPU_LATENCY_CLIENT) (handle: 0x9018B7F4) (resource: 0x90103260) (type: NPA_CLIENT_REQUIRED 0x40) (request: 0)
: npa_client (name: GSM_LATENCY) (handle: 0x90172DE4) (resource: 0x90103260) (type: NPA_CLIENT_REQUIRED 0x40) (request: 0)
: npa_client (name: HKADC) (handle: 0x9013FF24) (resource: 0x90103260) (type: NPA_CLIENT_REQUIRED 0x40) (request: 1)
: end npa_resource (handle: 0x90103260)
: npa_resource (name: "/core/cpu/wakeup") (handle: 0x901032AC) (units: sclk) (resource max: 4294967295) (active max: 4294967295) (active state 0) (active headroom: 0) (request state: 0)
: end npa_resource (handle: 0x901032AC)

As a result, the latency budget logged in solver constraints of sleep info ulog is 0x1.

0xF9AB62A3: Solver constraints (hard duration: 0x0000003C) (soft duration: 0xFFFFFFFF) (latency budget: 0x00000001)

Since latency budget affect low power operation,

No comments:

Post a Comment