>+ */
>+int set_latency(struct shared_resource *resp, u32 latency)
>+{
>+      u8 *pm_qos_req_added;
>+
>+      if (resp->curr_level == latency)
>+              return 0;
>+      else
>+              /* Update the resources current level */
>+              resp->curr_level = latency;
>+
[Romit] I think this should be done outside this function, in 
update_resource_level function. 
>+      pm_qos_req_added = resp->resource_data;
>+      if (latency == RES_DEFAULTLEVEL)
>+              /* No more users left, remove the pm_qos_req if present */
>+              if (*pm_qos_req_added) {
>+
>       pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY,
>+                                                      resp->name);
>+                      *pm_qos_req_added = 0;
>+                      return 0;
>+              }
>+
>+      if (*pm_qos_req_added) {
>+              return
>pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY,
>+                                              resp->name, latency);
>+      } else {
[Romit] Shouldn't the following line execute only if pm_qos_add_requirement 
returns successfully?
>+              *pm_qos_req_added = 1;
>+              return pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY,
>+                                              resp->name, latency);
>+      }
>+}
>+
>+int set_pd_latency(struct shared_resource *resp, u32 latency)
>+{
>+      u32 pd_lat_level, ind;
>+      struct pd_latency_db *pd_lat_db;
>+      struct powerdomain *pwrdm;
>+
>+      pd_lat_db = resp->resource_data;
>+      pwrdm = pd_lat_db->pd;
>+      pd_lat_level = PD_LATENCY_OFF;
>+      /* using the latency db map to the appropriate PD state */
>+      for (ind = 0; ind < PD_LATENCY_MAXLEVEL; ind++) {
>+              if (pd_lat_db->latency[ind] < latency) {
>+                      pd_lat_level = ind;
>+                      break;
>+              }
>+      }
>+
[Romit] Again is this the right place for this?  It should be done only if 
set_pwrdm_state returns successfully. So I think that should be checked as well.
>+      resp->curr_level = pd_lat_level;
>+      set_pwrdm_state(pwrdm, pd_lat_level);
>+      return 0;
>+}
--
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

Reply via email to