Commit 6f9baa9b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull more power management updates from Rafael Wysocki:
 "These mostly are updates of cpufreq drivers used on ARM platforms plus
  one new DT-based cpufreq driver for virtualized guests and two cpuidle
  changes that should not make any difference on systems currently in
  the field, but will be needed for future development:

   - Add virtual cpufreq driver for guest kernels (David Dai)

   - Minor cleanup to various cpufreq drivers (Andy Shevchenko, Dhruva
     Gole, Jie Zhan, Jinjie Ruan, Shuosheng Huang, Sibi Sankar, and Yuan
     Can)

   - Revert "cpufreq: brcmstb-avs-cpufreq: Fix initial command check"
     (Colin Ian King)

   - Improve DT bindings for qcom-hw driver (Dmitry Baryshkov, Konrad
     Dybcio, and Nikunj Kela)

   - Make cpuidle_play_dead() try all idle states with :enter_dead()
     callbacks and change their return type to void (Rafael Wysocki)"

* tag 'pm-6.13-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (22 commits)
  cpuidle: Change :enter_dead() driver callback return type to void
  cpuidle: Do not return from cpuidle_play_dead() on callback failures
  arm64: dts: qcom: sc8180x: Add a SoC-specific compatible to cpufreq-hw
  dt-bindings: cpufreq: cpufreq-qcom-hw: Add SC8180X compatible
  cpufreq: sun50i: add a100 cpufreq support
  cpufreq: mediatek-hw: Fix wrong return value in mtk_cpufreq_get_cpu_power()
  cpufreq: CPPC: Fix wrong return value in cppc_get_cpu_power()
  cpufreq: CPPC: Fix wrong return value in cppc_get_cpu_cost()
  cpufreq: loongson3: Check for error code from devm_mutex_init() call
  cpufreq: scmi: Fix cleanup path when boost enablement fails
  cpufreq: CPPC: Fix possible null-ptr-deref for cppc_get_cpu_cost()
  cpufreq: CPPC: Fix possible null-ptr-deref for cpufreq_cpu_get_raw()
  Revert "cpufreq: brcmstb-avs-cpufreq: Fix initial command check"
  dt-bindings: cpufreq: cpufreq-qcom-hw: Add SAR2130P compatible
  cpufreq: add virtual-cpufreq driver
  dt-bindings: cpufreq: add virtual cpufreq device
  cpufreq: loongson2: Unregister platform_driver on failure
  cpufreq: ti-cpufreq: Remove revision offsets in AM62 family
  cpufreq: ti-cpufreq: Allow backward compatibility for efuse syscon
  cppc_cpufreq: Remove HiSilicon CPPC workaround
  ...
parents 619d996c f3e66e78
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ properties:
          - enum:
              - qcom,qcm2290-cpufreq-hw
              - qcom,sc7180-cpufreq-hw
              - qcom,sc8180x-cpufreq-hw
              - qcom,sdm670-cpufreq-hw
              - qcom,sdm845-cpufreq-hw
              - qcom,sm6115-cpufreq-hw
@@ -34,7 +35,9 @@ properties:
        items:
          - enum:
              - qcom,qdu1000-cpufreq-epss
              - qcom,sa8255p-cpufreq-epss
              - qcom,sa8775p-cpufreq-epss
              - qcom,sar2130p-cpufreq-epss
              - qcom,sc7280-cpufreq-epss
              - qcom,sc8280xp-cpufreq-epss
              - qcom,sdx75-cpufreq-epss
@@ -107,6 +110,7 @@ allOf:
          contains:
            enum:
              - qcom,qcm2290-cpufreq-hw
              - qcom,sar2130p-cpufreq-epss
    then:
      properties:
        reg:
@@ -130,7 +134,9 @@ allOf:
          contains:
            enum:
              - qcom,qdu1000-cpufreq-epss
              - qcom,sa8255p-cpufreq-epss
              - qcom,sc7180-cpufreq-hw
              - qcom,sc8180x-cpufreq-hw
              - qcom,sc8280xp-cpufreq-epss
              - qcom,sdm670-cpufreq-hw
              - qcom,sdm845-cpufreq-hw
+48 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/cpufreq/qemu,virtual-cpufreq.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Virtual CPUFreq

maintainers:
  - David Dai <davidai@google.com>
  - Saravana Kannan <saravanak@google.com>

description:
  Virtual CPUFreq is a virtualized driver in guest kernels that sends performance
  selection of its vCPUs as a hint to the host through MMIO regions. Each vCPU
  is associated with a performance domain which can be shared with other vCPUs.
  Each performance domain has its own set of registers for performance controls.

properties:
  compatible:
    const: qemu,virtual-cpufreq

  reg:
    maxItems: 1
    description:
      Address and size of region containing performance controls for each of the
      performance domains. Regions for each performance domain is placed
      contiguously and contain registers for controlling DVFS(Dynamic Frequency
      and Voltage) characteristics. The size of the region is proportional to
      total number of performance domains.

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    soc {
      #address-cells = <1>;
      #size-cells = <1>;

      cpufreq@1040000 {
        compatible = "qemu,virtual-cpufreq";
        reg = <0x1040000 0x2000>;
      };
    };
+1 −1
Original line number Diff line number Diff line
@@ -3889,7 +3889,7 @@ lmh@18358800 {
		};

		cpufreq_hw: cpufreq@18323000 {
			compatible = "qcom,cpufreq-hw";
			compatible = "qcom,sc8180x-cpufreq-hw", "qcom,cpufreq-hw";
			reg = <0 0x18323000 0 0x1400>, <0 0x18325800 0 0x1400>;
			reg-names = "freq-domain0", "freq-domain1";

+2 −5
Original line number Diff line number Diff line
@@ -578,7 +578,7 @@ static void __cpuidle acpi_idle_do_entry(struct acpi_processor_cx *cx)
 * @dev: the target CPU
 * @index: the index of suggested state
 */
static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
static void acpi_idle_play_dead(struct cpuidle_device *dev, int index)
{
	struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);

@@ -591,11 +591,8 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
		else if (cx->entry_method == ACPI_CSTATE_SYSTEMIO) {
			io_idle(cx->address);
		} else
			return -ENODEV;
			return;
	}

	/* Never reached */
	return 0;
}

static __always_inline bool acpi_idle_fallback_to_c1(struct acpi_processor *pr)
+14 −0
Original line number Diff line number Diff line
@@ -217,6 +217,20 @@ config CPUFREQ_DT

	  If in doubt, say N.

config CPUFREQ_VIRT
	tristate "Virtual cpufreq driver"
	depends on GENERIC_ARCH_TOPOLOGY
	help
	  This adds a virtualized cpufreq driver for guest kernels that
	  read/writes to a MMIO region for a virtualized cpufreq device to
	  communicate with the host. It sends performance requests to the host
	  which gets used as a hint to schedule vCPU threads and select CPU
	  frequency. If a VM does not support a virtualized FIE such as AMUs,
	  it updates the frequency scaling factor by polling host CPU frequency
	  to enable accurate Per-Entity Load Tracking for tasks running in the guest.

	  If in doubt, say N.

config CPUFREQ_DT_PLATDEV
	tristate "Generic DT based cpufreq platdev driver"
	depends on OF
Loading