arch/arm64/boot/dts/qcom/glymur.dtsi | 42 ++ arch/arm64/boot/dts/qcom/hamoa.dtsi | 4 + drivers/devfreq/Kconfig | 21 + drivers/devfreq/Makefile | 2 + drivers/devfreq/devfreq.c | 9 + drivers/devfreq/governor_passive.c | 1 + drivers/devfreq/governor_performance.c | 1 + drivers/devfreq/governor_powersave.c | 1 + drivers/devfreq/governor_remote.c | 80 +++ drivers/devfreq/governor_simpleondemand.c | 1 + drivers/devfreq/governor_userspace.c | 1 + drivers/devfreq/hisi_uncore_freq.c | 1 + drivers/devfreq/scmi-qcom-memlat-cfg.h | 473 ++++++++++++++ drivers/devfreq/scmi-qcom-memlat-devfreq.c | 582 ++++++++++++++++++ drivers/devfreq/tegra30-devfreq.c | 3 +- drivers/firmware/arm_scmi/Kconfig | 1 + drivers/firmware/arm_scmi/Makefile | 1 + .../firmware/arm_scmi/vendors/qcom/Kconfig | 15 + .../firmware/arm_scmi/vendors/qcom/Makefile | 2 + .../arm_scmi/vendors/qcom/qcom-generic-ext.c | 135 ++++ .../arm_scmi/vendors/qcom/qcom_generic.rst | 211 +++++++ include/linux/devfreq-governor.h | 4 + include/linux/devfreq.h | 1 + include/linux/scmi_qcom_protocol.h | 37 ++ 24 files changed, 1628 insertions(+), 1 deletion(-) create mode 100644 drivers/devfreq/governor_remote.c create mode 100644 drivers/devfreq/scmi-qcom-memlat-cfg.h create mode 100644 drivers/devfreq/scmi-qcom-memlat-devfreq.c create mode 100644 drivers/firmware/arm_scmi/vendors/qcom/Kconfig create mode 100644 drivers/firmware/arm_scmi/vendors/qcom/Makefile create mode 100644 drivers/firmware/arm_scmi/vendors/qcom/qcom-generic-ext.c create mode 100644 drivers/firmware/arm_scmi/vendors/qcom/qcom_generic.rst create mode 100644 include/linux/scmi_qcom_protocol.h
The QCOM SCMI vendor protocol provides a generic way of exposing a number of Qualcomm SoC specific features (like memory bus scaling) through a mixture of pre-determined algorithm strings and param_id pairs hosted on the SCMI controller. On Qualcomm Glymur and Hamoa SoCs, the memlat governor and the mechanism to control the various caches and ram is hosted on the CPU Control Processor (CPUCP) and the method to tweak and start the governor is exposed through the QCOM SCMI Generic Extension Protocol. This series introduces the devfreq scmi client driver that uses the memlat algorithm string hosted on QCOM SCMI Generic Extension Protocol to detect memory latency workloads and control frequency/level of the various memory buses (DDR/LLCC/DDR_QOS). The DDR/LLCC/DDR_QOS are modelled as devfreq devices, with the governor set to remote devfreq governor. This serves as a way to get a basic insight into the device operation through trans_stat and provides for ways to further tweak the parameters of the remote governor. Transtat data for DDR/LLCC/DDR_QOS is now available in this series: #cat llcc/trans_stat From : To 315000000 479000000 545000000 725000000 840000000 95900000010900000001211000000 time(ms) 315000000: 0 3 6 6 6 7 0 30 143956 479000000: 2 0 7 1 1 1 0 3 356 545000000: 7 6 0 5 5 0 0 10 1200 725000000: 3 0 5 0 6 1 0 6 2172 840000000: 8 2 3 2 0 4 0 12 1188 959000000: 3 0 1 2 2 0 0 13 272 1090000000: 0 0 0 0 0 0 0 0 0 1211000000: 35 4 11 5 11 8 0 0 21684 Total transition : 253 QCOM SCMI Generic Vendor protocol background: It was found that a lot of the vendor protocol used internally was for debug/internal development purposes that would either be super SoC specific or had to be disabled because of some features being fused out during production. This lead to a large number of vendor protocol numbers being quickly consumed and were never released either. Using a generic vendor protocol with functionality abstracted behind algorithm strings gave us the flexibility of allowing such functionality exist during initial development/debugging while still being able to expose functionality like memlat once they have matured enough. The param-ids are certainly expected to act as ABI for algorithms strings like MEMLAT. Thanks in advance for taking time to review the series. Changes in v5: - Combining vendor protocol and the client and moving it back into RFC mode. - Introduce target_freq attr flag and TRACK_REMOTE devfreq governor flag. - Add basic remote devfreq governor to give users data like transtat [Dmitry] - Drop the current design that relies on manual parsing of device tree data and move those into SoC specific structs - Add Glymur/Mahua/Hamoa/Purwa support in the same series. Changes in v4: - Splitting the series into vendor protocol and memlat client. - Also the move the memlat client implementation back to RFC due to multiple opens. - Use common xfer helper to avoid code duplication [Dmitry] - Update enum documentation without duplicate enum info [Dmitry] - Update the protol attributes doc with more information. [Cristian] Changes in v3: - Restructure the bindings to mimic IMX [Christian] - Add documentation for the qcom generic vendor protocol [Christian/Sudeep] - Pick up Rb tag and fixup/re-order elements of the vendor ops [Christian] - Follow naming convention and folder structure used by IMX - Add missing enum in the vendor protocol and fix documentation [Konrad] - Add missing enum in the scmi memlat driver and fix documentation [Konrad] - Add checks for max memory and monitor [Shivnandan] - Fix typo from START_TIMER -> STOP_TIMER [Shivnandan] - Make populate_physical_mask func to void [Shivnandan] - Remove unecessary zero set [Shivnandan] - Use __free(device node) in init_cpufreq-memfreqmap [Christian/Konrad] - Use sdev->dev.of_node directly [Christian] - use return dev_err_probe in multiple places [Christian] Changes in v2: - Drop container dvfs memlat container node. [Rob] - Move scmi-memlat.yaml to protocol level given that a lot of vendors might end up - using the same protocol number. [Rob] - Replace qcom,cpulist with the standard "cpus" property. [Rob] - Fix up compute-type/ipm-ceil required. [Rob] - Make driver changes to the accommodate bindings changes. [Rob] - Minor fixups in subjects/coverletter. - Minor style fixes in dts. Changes in v1: - Add missing bindings for the protocol. [Konrad/Dmitry] - Use alternate bindings. [Dmitry/Konrad] - Rebase on top of Cristian's "SCMI multiple vendor protocol support" series. [Cristian] - Add more documentation wherever possible. [Sudeep] - Replace pr_err/info with it's dev equivalents. - Mixed tabs and initialization cleanups in the memlat driver. [Konrad] - Commit message update for the memlat driver. [Dmitry] - Cleanups/Fixes suggested for the client driver. [Dmitry/Konrad/Cristian] - Use opp-tables instead of memfreq-tbl. [Dmitry/Konrad] - Detect physical cpu to deal with variants with reduced cpu count. - Add support for DDR_QOS mem_type. Sibi Sankar (8): firmware: arm_scmi: Add QCOM Generic Vendor Protocol documentation firmware: arm_scmi: vendors: Add QCOM SCMI Generic Extensions PM / devfreq: Add new target_freq attribute flag for governors PM / devfreq: Add new track_remote flag for governors PM / devfreq: Add a governor for tracking remote device frequencies PM / devfreq: Introduce the QCOM SCMI Memlat devfreq device arm64: dts: qcom: glymur: Enable LLCC/DDR/DDR_QOS dvfs arm64: dts: qcom: hamoa: Enable LLCC/DDR/DDR_QOS dvfs arch/arm64/boot/dts/qcom/glymur.dtsi | 42 ++ arch/arm64/boot/dts/qcom/hamoa.dtsi | 4 + drivers/devfreq/Kconfig | 21 + drivers/devfreq/Makefile | 2 + drivers/devfreq/devfreq.c | 9 + drivers/devfreq/governor_passive.c | 1 + drivers/devfreq/governor_performance.c | 1 + drivers/devfreq/governor_powersave.c | 1 + drivers/devfreq/governor_remote.c | 80 +++ drivers/devfreq/governor_simpleondemand.c | 1 + drivers/devfreq/governor_userspace.c | 1 + drivers/devfreq/hisi_uncore_freq.c | 1 + drivers/devfreq/scmi-qcom-memlat-cfg.h | 473 ++++++++++++++ drivers/devfreq/scmi-qcom-memlat-devfreq.c | 582 ++++++++++++++++++ drivers/devfreq/tegra30-devfreq.c | 3 +- drivers/firmware/arm_scmi/Kconfig | 1 + drivers/firmware/arm_scmi/Makefile | 1 + .../firmware/arm_scmi/vendors/qcom/Kconfig | 15 + .../firmware/arm_scmi/vendors/qcom/Makefile | 2 + .../arm_scmi/vendors/qcom/qcom-generic-ext.c | 135 ++++ .../arm_scmi/vendors/qcom/qcom_generic.rst | 211 +++++++ include/linux/devfreq-governor.h | 4 + include/linux/devfreq.h | 1 + include/linux/scmi_qcom_protocol.h | 37 ++ 24 files changed, 1628 insertions(+), 1 deletion(-) create mode 100644 drivers/devfreq/governor_remote.c create mode 100644 drivers/devfreq/scmi-qcom-memlat-cfg.h create mode 100644 drivers/devfreq/scmi-qcom-memlat-devfreq.c create mode 100644 drivers/firmware/arm_scmi/vendors/qcom/Kconfig create mode 100644 drivers/firmware/arm_scmi/vendors/qcom/Makefile create mode 100644 drivers/firmware/arm_scmi/vendors/qcom/qcom-generic-ext.c create mode 100644 drivers/firmware/arm_scmi/vendors/qcom/qcom_generic.rst create mode 100644 include/linux/scmi_qcom_protocol.h base-commit: 9d0d467c3572e93c5faa2e5906a8bbcd70b24efd -- 2.34.1
On Thu, May 07, 2026 at 11:52:29AM +0530, Sibi Sankar wrote: > The QCOM SCMI vendor protocol provides a generic way of exposing a number of > Qualcomm SoC specific features (like memory bus scaling) through a mixture of > pre-determined algorithm strings and param_id pairs hosted on the SCMI > controller. On Qualcomm Glymur and Hamoa SoCs, the memlat governor and the > mechanism to control the various caches and ram is hosted on the CPU Control > Processor (CPUCP) and the method to tweak and start the governor is exposed > through the QCOM SCMI Generic Extension Protocol. Could you please clarify, does this apply to the common commercial Glymur and Hamoa laptops? -- With best wishes Dmitry
On 5/7/2026 2:40 PM, Dmitry Baryshkov wrote: > On Thu, May 07, 2026 at 11:52:29AM +0530, Sibi Sankar wrote: >> The QCOM SCMI vendor protocol provides a generic way of exposing a number of >> Qualcomm SoC specific features (like memory bus scaling) through a mixture of >> pre-determined algorithm strings and param_id pairs hosted on the SCMI >> controller. On Qualcomm Glymur and Hamoa SoCs, the memlat governor and the >> mechanism to control the various caches and ram is hosted on the CPU Control >> Processor (CPUCP) and the method to tweak and start the governor is exposed >> through the QCOM SCMI Generic Extension Protocol. > > Could you please clarify, does this apply to the common commercial > Glymur and Hamoa laptops? Yes, they do apply to common commercial Glymur/Hamoa Laptops as is. This is the same solution used on the windows side of things as well. There can be certain cases like Johan has reported earlier where certain oems are stuck with on older version of CPUCP which requires a the memlat string to be sent out in lower case we should be able to handle those as well with overriding those by using driver data and specific compatibles. -Sibi >
On Thu, May 07, 2026 at 03:28:21PM +0530, Sibi Sankar wrote: > > On 5/7/2026 2:40 PM, Dmitry Baryshkov wrote: > > On Thu, May 07, 2026 at 11:52:29AM +0530, Sibi Sankar wrote: > > > The QCOM SCMI vendor protocol provides a generic way of exposing a number of > > > Qualcomm SoC specific features (like memory bus scaling) through a mixture of > > > pre-determined algorithm strings and param_id pairs hosted on the SCMI > > > controller. On Qualcomm Glymur and Hamoa SoCs, the memlat governor and the > > > mechanism to control the various caches and ram is hosted on the CPU Control > > > Processor (CPUCP) and the method to tweak and start the governor is exposed > > > through the QCOM SCMI Generic Extension Protocol. > > > > Could you please clarify, does this apply to the common commercial > > Glymur and Hamoa laptops? > > Yes, they do apply to common commercial Glymur/Hamoa Laptops > as is. This is the same solution used on the windows side of things > as well. There can be certain cases like Johan has reported earlier > where certain oems are stuck with on older version of CPUCP > which requires a the memlat string to be sent out in lower case > we should be able to handle those as well with overriding those > by using driver data and specific compatibles. Ack, thanks for the confirmation. -- With best wishes Dmitry
On 5/7/26 07:22, Sibi Sankar wrote:
> The QCOM SCMI vendor protocol provides a generic way of exposing a number of
> Qualcomm SoC specific features (like memory bus scaling) through a mixture of
> pre-determined algorithm strings and param_id pairs hosted on the SCMI
> controller. On Qualcomm Glymur and Hamoa SoCs, the memlat governor and the
> mechanism to control the various caches and ram is hosted on the CPU Control
> Processor (CPUCP) and the method to tweak and start the governor is exposed
> through the QCOM SCMI Generic Extension Protocol.
>
> This series introduces the devfreq scmi client driver that uses the memlat
> algorithm string hosted on QCOM SCMI Generic Extension Protocol to detect
> memory latency workloads and control frequency/level of the various memory
> buses (DDR/LLCC/DDR_QOS). The DDR/LLCC/DDR_QOS are modelled as devfreq
> devices, with the governor set to remote devfreq governor. This serves as
> a way to get a basic insight into the device operation through trans_stat
> and provides for ways to further tweak the parameters of the remote
> governor.
>
> Transtat data for DDR/LLCC/DDR_QOS is now available in this series:
>
> #cat llcc/trans_stat
>>From : To
> 315000000 479000000 545000000 725000000 840000000 95900000010900000001211000000 time(ms)
> 315000000: 0 3 6 6 6 7 0 30 143956
> 479000000: 2 0 7 1 1 1 0 3 356
> 545000000: 7 6 0 5 5 0 0 10 1200
> 725000000: 3 0 5 0 6 1 0 6 2172
> 840000000: 8 2 3 2 0 4 0 12 1188
> 959000000: 3 0 1 2 2 0 0 13 272
> 1090000000: 0 0 0 0 0 0 0 0 0
> 1211000000: 35 4 11 5 11 8 0 0 21684
> Total transition : 253
>
> QCOM SCMI Generic Vendor protocol background:
> It was found that a lot of the vendor protocol used internally was
> for debug/internal development purposes that would either be super
> SoC specific or had to be disabled because of some features being
> fused out during production. This lead to a large number of vendor
> protocol numbers being quickly consumed and were never released
> either. Using a generic vendor protocol with functionality abstracted
> behind algorithm strings gave us the flexibility of allowing such
> functionality exist during initial development/debugging while
> still being able to expose functionality like memlat once they have
> matured enough. The param-ids are certainly expected to act as ABI
> for algorithms strings like MEMLAT.
>
> Thanks in advance for taking time to review the series.
>
Based on this description I have a few questions:
1. Why we don't use SCMI notifications for this purpose?
2. Is it safe to assume that there was no extra frequency change
during that polling sampling period?
3. Shouldn't we sample 2x faster than the changes that we try to
observe?
4. IIRC there was some extension in the SCMI protocol for performance
domains which allows to expose the stats like the one above but in
the shared memory. Why we couldn't use this? It would be more robust.
On 5/13/2026 10:30 PM, Lukasz Luba wrote: > > > On 5/7/26 07:22, Sibi Sankar wrote: >> The QCOM SCMI vendor protocol provides a generic way of exposing a >> number of >> Qualcomm SoC specific features (like memory bus scaling) through a >> mixture of >> pre-determined algorithm strings and param_id pairs hosted on the SCMI >> controller. On Qualcomm Glymur and Hamoa SoCs, the memlat governor >> and the >> mechanism to control the various caches and ram is hosted on the CPU >> Control >> Processor (CPUCP) and the method to tweak and start the governor is >> exposed >> through the QCOM SCMI Generic Extension Protocol. >> >> This series introduces the devfreq scmi client driver that uses the >> memlat >> algorithm string hosted on QCOM SCMI Generic Extension Protocol to >> detect >> memory latency workloads and control frequency/level of the various >> memory >> buses (DDR/LLCC/DDR_QOS). The DDR/LLCC/DDR_QOS are modelled as devfreq >> devices, with the governor set to remote devfreq governor. This >> serves as >> a way to get a basic insight into the device operation through >> trans_stat >> and provides for ways to further tweak the parameters of the remote >> governor. >> >> Transtat data for DDR/LLCC/DDR_QOS is now available in this series: >> >> #cat llcc/trans_stat >>> From : To >> 315000000 479000000 545000000 725000000 840000000 >> 95900000010900000001211000000 time(ms) >> 315000000: 0 3 6 6 6 >> 7 0 30 143956 >> 479000000: 2 0 7 1 1 >> 1 0 3 356 >> 545000000: 7 6 0 5 5 >> 0 0 10 1200 >> 725000000: 3 0 5 0 6 >> 1 0 6 2172 >> 840000000: 8 2 3 2 0 >> 4 0 12 1188 >> 959000000: 3 0 1 2 2 >> 0 0 13 272 >> 1090000000: 0 0 0 0 0 >> 0 0 0 0 >> 1211000000: 35 4 11 5 11 >> 8 0 0 21684 >> Total transition : 253 >> >> QCOM SCMI Generic Vendor protocol background: >> It was found that a lot of the vendor protocol used internally was >> for debug/internal development purposes that would either be super >> SoC specific or had to be disabled because of some features being >> fused out during production. This lead to a large number of vendor >> protocol numbers being quickly consumed and were never released >> either. Using a generic vendor protocol with functionality abstracted >> behind algorithm strings gave us the flexibility of allowing such >> functionality exist during initial development/debugging while >> still being able to expose functionality like memlat once they have >> matured enough. The param-ids are certainly expected to act as ABI >> for algorithms strings like MEMLAT. >> >> Thanks in advance for taking time to review the series. >> > Hey Lukasz, Thanks for taking time to review the series! > Based on this description I have a few questions: > 1. Why we don't use SCMI notifications for this purpose? This is an attempt to retrofit firmware, that is already out in the wild running on X1E laptops and Glymur which continues to use the same firmware, into generic linux frameworks, so that it provides some useful information to user rather than it being a complete black box. We already have a ton of firmware changes suggested by Sudeep/Cristian that will be taken into account for the next generation of SoCs, will make sure this is accounted for as well :) > 2. Is it safe to assume that there was no extra frequency change > during that polling sampling period? Yup, there is expected to be at most one transition of DDR/LLCC/DDR-QOS per polling cycle. > 3. Shouldn't we sample 2x faster than the changes that we try to > observe? Yup, that makes sense. Will fix this in the next re-spin. > 4. IIRC there was some extension in the SCMI protocol for performance > domains which allows to expose the stats like the one above but in > the shared memory. Why we couldn't use this? It would be more robust. Same answer as the first point, since the current firmware provides to no such provisions :( -Sibi
On Thu, May 14, 2026 at 05:11:41PM +0530, Sibi Sankar wrote: > > On 5/13/2026 10:30 PM, Lukasz Luba wrote: > > > > [...] > > > Based on this description I have a few questions: > > 1. Why we don't use SCMI notifications for this purpose? > > > This is an attempt to retrofit firmware, that is already out in the wild > running on X1E laptops and Glymur which continues to use the same firmware, into > generic linux frameworks, so that it provides some useful information to > user rather than it being a complete black box. We cannot accept changes that rely on firmware interfaces that are not well defined. This is not a comment on any specific interface, but if an interface is not specified with the same level of rigor as a standard specification, it should not be expected to receive mainline support. > We already have a ton of firmware changes suggested by Sudeep/Cristian that > will be taken into account for the next generation of SoCs, will make sure > this is accounted for as well :) It is helpful to know this but also unfortunate as we have only just begun reviewing the interface and refining its shape. Please do not rely solely on the review completed so far, as the interface may still evolve. Until it is merged, it should not be considered accepted. This is why I am insisting that the interface document be reviewed and accepted before any driver changes are made. -- Regards, Sudeep
© 2016 - 2026 Red Hat, Inc.