/** * sr_classp5_recal_work() - work which actually does the recalibration * @work: pointer to the work * * on a periodic basis, we come and reset our calibration setup * so that a recalibration of the OPPs take place. This takes * care of aging factor in the system. */ static void sr_classp5_recal_work(struct work_struct *work) { unsigned long delay; /* try lock only to avoid deadlock with suspend handler */ if (!mutex_trylock(&omap_dvfs_lock)) { pr_err("%s: Can't acquire lock, delay recalibration\n", __func__); schedule_delayed_work(&recal_work, msecs_to_jiffies (SRP5_SAMPLING_DELAY_MS * SRP5_STABLE_SAMPLES)); return; } /* * Deny Idle during recalibration due to the following reasons: * - HW loop is enabled when we enter this function * - HW loop may be triggered at any moment of time from idle * - As result we may have race between SmartReflex disabling/enabling * from CPU Idle and from recalibration function */ pm_qos_update_request(&recal_qos, 0); delay = msecs_to_jiffies(CONFIG_OMAP_SR_CLASS1_P5_RECALIBRATION_DELAY); if (voltdm_for_each(sr_classp5_voltdm_recal, NULL)) pr_err("%s: Recalibration failed\n", __func__); /* Enable CPU Idle */ pm_qos_update_request(&recal_qos, PM_QOS_DEFAULT_VALUE); next_recal_time = jiffies + delay; schedule_delayed_work(&recal_work, delay); mutex_unlock(&omap_dvfs_lock); }
/** * sr_class1p5_recal_work() - work which actually does the calibration * @work: pointer to the work * * on a periodic basis, we come and reset our calibration setup * so that a recalibration of the OPPs take place. This takes * care of aging factor in the system. */ static void sr_class1p5_recal_work(struct work_struct *work) { mutex_lock(&omap_dvfs_lock); if (voltdm_for_each(sr_class1p5_voltdm_recal, NULL)) pr_err("%s: Recalibration failed\n", __func__); mutex_unlock(&omap_dvfs_lock); /* We come back again after time the usual delay */ schedule_delayed_work(&recal_work, msecs_to_jiffies (CONFIG_OMAP_SR_CLASS1P5_RECALIBRATION_DELAY)); }
static int pm_dbg_show_counters(struct seq_file *s, void *unused) { pwrdm_for_each(pwrdm_dbg_show_counter, s); voltdm_for_each(voltdm_dbg_show_counters, s); return 0; }