50 likes | 174 Views
Latency constraint framework - APIs. 2010-08-02. Types of Latency Constraints. Interrupt or system latency Time taken once an interrupt occurs to the time its interrupt handler is scheduled Depends mainly on system sleep/C-state (MPU+Core power state)
E N D
Latency constraint framework - APIs 2010-08-02
Types of Latency Constraints • Interrupt or system latency • Time taken once an interrupt occurs to the time its interrupt handler is scheduled • Depends mainly on system sleep/C-state (MPU+Core power state) • Any driver can put constraint on the deepest permissible C-state system can enter • Device latency • Time taken for a device to become accessible • Includes bringing power domain out of RET or OFF, turning on clocks, & bringing clock domain out of inactive • Depends mainly on power state of parent power domain • Any driver can put constraint on the deepest power state its power domain can enter • Allows more granular power control than preventing system sleep
Interrupt Latency APIs • omap_pm_set_max_mpu_wakeup_lat – set max MPU wakeup latency (constraint MPU power state) • @qos_request: handle for the constraint; initialized to null • @t: max MPU wakeup latency in microseconds; -1 to release • omap_pm_set_max_sdma_lat – set max sDMA transfer start latency (constraint Core power state) • @qos_request: handle for the constraint; initialized to null • @t: max sDMA transfer start latency in microseconds; -1 to release • Notes: • Constraint is tracked for MPU and Core domain using PM QoS • CPU idle selects lowest C-state subject to above constraints • Files: plat/omap-pm.h, plat-omap/omap-pm.c, mach-omap2/cpuidle34xx.c (44xx.c in-progress)
Device Latency APIs • omap_pm_set_max_dev_wakeup_lat – Set power domain wakeup latency constraint (max device enable latency) • @req_dev: struct device * requesting the constraint • @dev: struct device * to set the constraint on • @t: max wakeup latency constraint in microseconds; -1 to release • Notes: • Constraint is put on parent power domain of @dev • Generally, @req_dev == @dev, i.e. constraint parent power domain • Devices don’t have access to struct device * of some other device • APIs to get device * for L3, MPUSS, & IVASS on 3430, similar will exist on 4430 • Device HWMOD info needs to be available for API to work • Files: plat/omap-pm.h, plat-omap/omap-pm.c, mach-omap2/powerdomains44xx.h, mach-omap2/powerdomain.c
Profiled Latencies • Power domain wakeup latencies defined in powerdomains44xx.h static struct powerdomain core_44xx_pwrdm = { .wakeup_lat = { [PWRDM_FUNC_PWRST_OFF] = 100, [PWRDM_FUNC_PWRST_OSWR] = UNSUP_STATE, [PWRDM_FUNC_PWRST_CSWR] = 60, [PWRDM_FUNC_PWRST_ON] = 0, • MPU & Core domain power states defined in cpuidle34xx.c #define OMAP3_STATE_C1 0 /* C1 - MPU WFI + Core active */ #define OMAP3_STATE_C2 1 /* C2 - MPU WFI + Core inactive */ #define OMAP3_STATE_C3 2 /* C3 - MPU CSWR + Core inactive */ • Each C-state has associated sleep, wakeup latencies, & threshold valid, sleep lat, wakeup lat, threshold {1, 2, 2, 5}, /* C1 */ {1, 10, 10, 30}, /* C2 */ • Driver owners should refer to these values if they want to force specific power state • We also need to work together & profile latencies for 4430 asap