SRF Replacement - Constraints Part

From OMAPpedia

(Difference between revisions)
Jump to: navigation, search
(Implementation Schedule)
(Proposed Implementation)
Line 31: Line 31:
===Proposed Implementation===
===Proposed Implementation===
* '''OMAP PM layer - API’s exported to driver are defined here'''
* '''OMAP PM layer - API’s exported to driver are defined here'''
-
** Are all drivers going to be of type omap_device?
+
** Any driver can place constraints
-
** Design for existing omap-pm vs. omap_device layer?
+
** Designed for existing omap-pm layer
** -1 to release constraint, otherwise 0 or higher (acceptable latency in us)
** -1 to release constraint, otherwise 0 or higher (acceptable latency in us)
** We can’t assume that only releasing the constraint will lower power
** We can’t assume that only releasing the constraint will lower power
Line 40: Line 40:
  {
  {
  /*  existing code */
  /*  existing code */
-
  1. Look for devices’ power domain (might be multiple step if starting  with general device)
+
  1. Look for devices’ power domain (multiple step lookup as starting  with general device)
-
  2. Use device name as identifier for constraint request
+
  2. Use device pointer as identifier for constraint request
   
   
  if (t == -1)
  if (t == -1)
-
  pwrdm_release_wakeup_lat_constraint (pwrdm, lat_dev_name);
+
  pwrdm_wakeuplat_release_constraint(pwrdm, dev);
  else
  else
-
pwrdm_set_wakeup_lat_constraint (pwrdm, lat_dev_name, t);
+
pwrdm_wakeuplat_set_constraint (pwrdm, dev, t);
  }
  }
* '''Power domain layer – constraint enforcement/ tracking implemented here'''
* '''Power domain layer – constraint enforcement/ tracking implemented here'''
-
** How does the state change happen? Just by programming next state?
+
** State change happens by programming next state
 +
** If device is already in low power state, do a wakeup before programming next state 
** powerdomain struct extended to capture following:
** powerdomain struct extended to capture following:
*** Power domain’s wakeup latency for each supported power state
*** Power domain’s wakeup latency for each supported power state
Line 56: Line 57:
  struct powerdomain {
  struct powerdomain {
  /* existing entries*/
  /* existing entries*/
-
  const u32 wakeup_lat[PWRDM_MAX_PWRSTS-1];
+
  const u32 wakeuplat[NUM_FUNC_PWRST];
  static LIST_HEAD(wakeup_lat_constraint_list);
  static LIST_HEAD(wakeup_lat_constraint_list);
  }  
  }  
  static struct powerdomain core_44xx_pwrdm = {
  static struct powerdomain core_44xx_pwrdm = {
-
  .wakeup_lat = {
+
  .wakeuplat = {
-
50,   /* off */
+
  [FUNC_PWRST_OFF] = 50,
-
20,   /* ret */ -1 for not supported power state
+
  [FUNC_PWRST_OSWR] = 30,
-
0,     /* inactive */ Do we have to worry about OSWR?
+
  [FUNC_PWRST_CSWR] = 5,
-
}
+
  [FUNC_PWRST_ON] = 0,
 +
  };
  }
  }
* '''3 Scenarios: new constraint, update old constraint, or release it'''
* '''3 Scenarios: new constraint, update old constraint, or release it'''
-
  pwrdm_set_wakeup_lat_constraint (struct powerdomain *pwrdm, char *lat_dev_name, long lat_us){
+
  pwrdm_wakeuplat_set_constraint (struct powerdomain *pwrdm, stuct device *dev, long lat_us){
  1. If new constraint, add a new entry to wakeup_lat_constraint_list
  1. If new constraint, add a new entry to wakeup_lat_constraint_list
  2. If already existing, update entries’ latency value
  2. If already existing, update entries’ latency value
  3. pwrdm_check_for_state_change (pwrdm)
  3. pwrdm_check_for_state_change (pwrdm)
  }  
  }  
-
  pwrdm_release_wakeup_lat_constraint (struct powerdomain *pwrdm, char  *lat_dev_name){
+
  pwrdm_wakeuplat_release_constraint (struct powerdomain *pwrdm, char  *lat_dev_name){
  1. Remove this devices’ constraint from wakeup_lat_constraint_list
  1. Remove this devices’ constraint from wakeup_lat_constraint_list
  2. pwrdm_check_for_state_change (pwrdm)
  2. pwrdm_check_for_state_change (pwrdm)
  }
  }
-
  pwrdm_check_for_state_change (struct powerdomain *pwrdm){
+
  pwrdm_wakeuplat_update_pwrst (struct powerdomain *pwrdm){
  1. min_latency = find_min_wakeup_latency_constraint (pwrdm)  
  1. min_latency = find_min_wakeup_latency_constraint (pwrdm)  
  //go through the list for minimum latency value
  //go through the list for minimum latency value
  2. find power state that has latency lower than minimum constraint
  2. find power state that has latency lower than minimum constraint
-
for (new_state = 0x0; new_state < PWRDM_MAX_PWRSTS; new_state++){
+
-
    if (pwrdm->wakeup_lat[i] < min_latency) break;
+
-
}
+
  3.  if (pwrdm->state != new_state)
  3.  if (pwrdm->state != new_state)
       pwrdm_set_next_pwrst (pwrdm, new_state); // existing function to program next state
       pwrdm_set_next_pwrst (pwrdm, new_state); // existing function to program next state
  }
  }
-
 
===Implementation Schedule===
===Implementation Schedule===

Revision as of 17:19, 2 July 2010

Contents

Introduction

This wikipage describes the efforts of replacing constraints part of the Shared Resource Framework (SRF).


SRF Replacement - Constraints Part

Types of Latency Constraints

Details of Interrupt Latency

Details of Device Latency

Proposed Implementation

void omap_pm_set_max_dev_wakeup_lat(struct device *dev, long t)
{
	/*  existing code */	
	1. Look for devices’ power domain (multiple step lookup as starting  with general device)
	2. Use device pointer as identifier for constraint request

	if (t == -1)
		pwrdm_wakeuplat_release_constraint(pwrdm, dev);
	else
		pwrdm_wakeuplat_set_constraint (pwrdm, dev, t);
}
struct powerdomain {
/* existing entries*/
const u32 wakeuplat[NUM_FUNC_PWRST];
static LIST_HEAD(wakeup_lat_constraint_list);
} 
static struct powerdomain core_44xx_pwrdm = {
.wakeuplat = {
  [FUNC_PWRST_OFF] = 50,
  [FUNC_PWRST_OSWR] = 30,
  [FUNC_PWRST_CSWR] = 5,
  [FUNC_PWRST_ON] = 0,
 };
}
pwrdm_wakeuplat_set_constraint (struct powerdomain *pwrdm, stuct device *dev, long lat_us){
	1. If new constraint, add a new entry to wakeup_lat_constraint_list
	2. If already existing, update entries’ latency value
	3. pwrdm_check_for_state_change (pwrdm)
} 
pwrdm_wakeuplat_release_constraint (struct powerdomain *pwrdm, char   *lat_dev_name){
	1. Remove this devices’ constraint from wakeup_lat_constraint_list
	2. pwrdm_check_for_state_change (pwrdm)
}
pwrdm_wakeuplat_update_pwrst (struct powerdomain *pwrdm){
	1. min_latency = find_min_wakeup_latency_constraint (pwrdm) 
		 //go through the list for minimum latency value
	2. find power state that has latency lower than minimum constraint
	
	3.  if (pwrdm->state != new_state)
 		    pwrdm_set_next_pwrst (pwrdm, new_state); // existing function to program next state
}

Implementation Schedule

Post PM Workshop Deliverables for SRF Replacement - Constraints Part

Task Owner Target Date State Status Comments & Actions
Start with the design as aligned in the workshop and implement check for state change function Vibhore 25-Jun Completed 30-Jun: Completed 23-Jun: On track None
Resolve any compilation issues & test on blaze Vibhore 28-Jun Completed 30-Jun: Completed 23-Jun: None None
Post RFC patches Vibhore 30-Jun Under Progress 30-Jun: On track 23-Jun: None None
Extensive testing on OMAP3 & OMAP4 and rework to address review comments Vibhore 31-Jul Not started 23-Jun: None None
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox