[PATCH RFC 07/10] PM / devfreq: Introduce the QCOM SCMI Memlat devfreq driver

Anthony Ruhier aruhier at mailbox.org
Wed Nov 4 13:55:35 PST 2026


Hi,

On Fri, Jul 24, 2026 at 12:48:12PM +0530, Pragnesh Papaniya wrote:
> From: Sibi Sankar <sibi.sankar at oss.qualcomm.com>
> +	for (i = 0; i < info->memory_cnt; i++) {
> +		struct scmi_qcom_memory_info *memory = info->memory[i];
> +		const struct scmi_qcom_memory_range *range = &memory->cfg->memory_range;
> +		struct devfreq_dev_profile *profile = &memory->profile;
> +
> +		/*
> +		 * CPUCP re-evaluates and re-votes at most once per cpucp_sample_ms,
> +		 * so a new operating point can appear only that often. Polling at half
> +		 * that period guarantees each distinct vote is observed in trans_stat
> +		 * before it can change again.
> +		 */
> +		profile->polling_ms = max(1U, info->cfg_data->cpucp_sample_ms / 2);
> +		profile->get_cur_freq = scmi_qcom_devfreq_get_cur_freq;
> +		profile->initial_freq = range->max_freq_khz > 1 ?
> +					(unsigned long)((u64)range->min_freq_khz * HZ_PER_KHZ) :
> +					range->min_freq_khz;
> +
> +		faux_device_set_drvdata(memory->fdev, memory);
> +
> +		memory->devfreq = devfreq_add_device(&memory->fdev->dev, profile,
> +						     DEVFREQ_GOV_REMOTE, NULL);
> +		if (IS_ERR(memory->devfreq)) {
> +			ret = PTR_ERR(memory->devfreq);
> +			memory->devfreq = NULL;
> +			ops->stop_activity(ph, NULL, 0, MEMLAT_ALGO_STR, MEMLAT_STOP_TIMER);
> +			return dev_err_probe(&sdev->dev, ret, "failed to add devfreq device\n");
> +		}
> +	}

I tried it on Hamoa (Yoga Slim 7x, x1e80100), loaded scmi_qcom_memlat_devfreq,
and I see the apss_cpucp_mbox IRQ firing 3100 times per second. It raised the
power consumption while idle, screen off, from 0.9W to 1.4W.

The polling seems to be the issue, as I didn't see hectic changes of frequency.
Raising the polling from 2ms (default) to 20ms makes the power usage goes back
to around 0.95W, with ~150 interrupts/s from apss_cpucp_mbox. It's still higher
than with memlat off, but it seems to be a better trade-off for now.

Can you check on similar platforms (hamoa, glymor) if you see the same issue?

Thanks,
--
Anthony Ruhier



More information about the linux-arm-kernel mailing list