Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge back cpufreq material for 6.19

+132 -112
+74 -59
Documentation/admin-guide/pm/intel_pstate.rst
··· 48 48 command line. However, its configuration can be adjusted via ``sysfs`` to a 49 49 great extent. In some configurations it even is possible to unregister it via 50 50 ``sysfs`` which allows another ``CPUFreq`` scaling driver to be loaded and 51 - registered (see `below <status_attr_>`_). 51 + registered (see :ref:`below <status_attr>`). 52 52 53 + .. _operation_modes: 53 54 54 55 Operation Modes 55 56 =============== ··· 62 61 a certain performance scaling algorithm. Which of them will be in effect 63 62 depends on what kernel command line options are used and on the capabilities of 64 63 the processor. 64 + 65 + .. _active_mode: 65 66 66 67 Active Mode 67 68 ----------- ··· 97 94 Namely, if that option is set, the ``performance`` algorithm will be used by 98 95 default, and the other one will be used by default if it is not set. 99 96 97 + .. _active_mode_hwp: 98 + 100 99 Active Mode With HWP 101 100 ~~~~~~~~~~~~~~~~~~~~ 102 101 ··· 128 123 internal P-state selection logic is expected to focus entirely on performance. 129 124 130 125 This will override the EPP/EPB setting coming from the ``sysfs`` interface 131 - (see `Energy vs Performance Hints`_ below). Moreover, any attempts to change 126 + (see :ref:`energy_performance_hints` below). Moreover, any attempts to change 132 127 the EPP/EPB to a value different from 0 ("performance") via ``sysfs`` in this 133 128 configuration will be rejected. 134 129 ··· 196 191 This is the default P-state selection algorithm if the 197 192 :c:macro:`CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE` kernel configuration option 198 193 is not set. 194 + 195 + .. _passive_mode: 199 196 200 197 Passive Mode 201 198 ------------ ··· 296 289 the entire range of available P-states, including the whole turbo range, to the 297 290 ``CPUFreq`` core and (in the passive mode) to generic scaling governors. This 298 291 generally causes turbo P-states to be set more often when ``intel_pstate`` is 299 - used relative to ACPI-based CPU performance scaling (see `below <acpi-cpufreq_>`_ 300 - for more information). 292 + used relative to ACPI-based CPU performance scaling (see 293 + :ref:`below <acpi-cpufreq>` for more information). 301 294 302 295 Moreover, since ``intel_pstate`` always knows what the real turbo threshold is 303 296 (even if the Configurable TDP feature is enabled in the processor), its 304 - ``no_turbo`` attribute in ``sysfs`` (described `below <no_turbo_attr_>`_) should 297 + ``no_turbo`` attribute in ``sysfs`` (described :ref:`below <no_turbo_attr>`) should 305 298 work as expected in all cases (that is, if set to disable turbo P-states, it 306 299 always should prevent ``intel_pstate`` from using them). 307 300 ··· 314 307 315 308 * The minimum supported P-state. 316 309 317 - * The maximum supported `non-turbo P-state <turbo_>`_. 310 + * The maximum supported :ref:`non-turbo P-state <turbo>`. 318 311 319 312 * Whether or not turbo P-states are supported at all. 320 313 321 - * The maximum supported `one-core turbo P-state <turbo_>`_ (if turbo P-states 322 - are supported). 314 + * The maximum supported :ref:`one-core turbo P-state <turbo>` (if turbo 315 + P-states are supported). 323 316 324 317 * The scaling formula to translate the driver's internal representation 325 318 of P-states into frequencies and the other way around. ··· 407 400 408 401 If ``CONFIG_ENERGY_MODEL`` has been set during kernel configuration and 409 402 ``intel_pstate`` runs on a hybrid processor without SMT, in addition to enabling 410 - `CAS <CAS_>`_ it registers an Energy Model for the processor. This allows the 403 + :ref:`CAS` it registers an Energy Model for the processor. This allows the 411 404 Energy-Aware Scheduling (EAS) support to be enabled in the CPU scheduler if 412 405 ``schedutil`` is used as the ``CPUFreq`` governor which requires ``intel_pstate`` 413 - to operate in the `passive mode <Passive Mode_>`_. 406 + to operate in the :ref:`passive mode <passive_mode>`. 414 407 415 408 The Energy Model registered by ``intel_pstate`` is artificial (that is, it is 416 409 based on abstract cost values and it does not include any real power numbers) ··· 439 432 User Space Interface in ``sysfs`` 440 433 ================================= 441 434 435 + .. _global_attributes: 436 + 442 437 Global Attributes 443 438 ----------------- 444 439 ··· 453 444 454 445 ``max_perf_pct`` 455 446 Maximum P-state the driver is allowed to set in percent of the 456 - maximum supported performance level (the highest supported `turbo 457 - P-state <turbo_>`_). 447 + maximum supported performance level (the highest supported :ref:`turbo 448 + P-state <turbo>`). 458 449 459 450 This attribute will not be exposed if the 460 451 ``intel_pstate=per_cpu_perf_limits`` argument is present in the kernel ··· 462 453 463 454 ``min_perf_pct`` 464 455 Minimum P-state the driver is allowed to set in percent of the 465 - maximum supported performance level (the highest supported `turbo 466 - P-state <turbo_>`_). 456 + maximum supported performance level (the highest supported :ref:`turbo 457 + P-state <turbo>`). 467 458 468 459 This attribute will not be exposed if the 469 460 ``intel_pstate=per_cpu_perf_limits`` argument is present in the kernel ··· 472 463 ``num_pstates`` 473 464 Number of P-states supported by the processor (between 0 and 255 474 465 inclusive) including both turbo and non-turbo P-states (see 475 - `Turbo P-states Support`_). 466 + :ref:`turbo`). 476 467 477 468 This attribute is present only if the value exposed by it is the same 478 469 for all of the CPUs in the system. 479 470 480 471 The value of this attribute is not affected by the ``no_turbo`` 481 - setting described `below <no_turbo_attr_>`_. 472 + setting described :ref:`below <no_turbo_attr>`. 482 473 483 474 This attribute is read-only. 484 475 485 476 ``turbo_pct`` 486 - Ratio of the `turbo range <turbo_>`_ size to the size of the entire 477 + Ratio of the :ref:`turbo range <turbo>` size to the size of the entire 487 478 range of supported P-states, in percent. 488 479 489 480 This attribute is present only if the value exposed by it is the same ··· 495 486 496 487 ``no_turbo`` 497 488 If set (equal to 1), the driver is not allowed to set any turbo P-states 498 - (see `Turbo P-states Support`_). If unset (equal to 0, which is the 489 + (see :ref:`turbo`). If unset (equal to 0, which is the 499 490 default), turbo P-states can be set by the driver. 500 491 [Note that ``intel_pstate`` does not support the general ``boost`` 501 492 attribute (supported by some other scaling drivers) which is replaced ··· 504 495 This attribute does not affect the maximum supported frequency value 505 496 supplied to the ``CPUFreq`` core and exposed via the policy interface, 506 497 but it affects the maximum possible value of per-policy P-state limits 507 - (see `Interpretation of Policy Attributes`_ below for details). 498 + (see :ref:`policy_attributes_interpretation` below for details). 508 499 509 500 ``hwp_dynamic_boost`` 510 501 This attribute is only present if ``intel_pstate`` works in the 511 - `active mode with the HWP feature enabled <Active Mode With HWP_>`_ in 502 + :ref:`active mode with the HWP feature enabled <active_mode_hwp>` in 512 503 the processor. If set (equal to 1), it causes the minimum P-state limit 513 504 to be increased dynamically for a short time whenever a task previously 514 505 waiting on I/O is selected to run on a given logical CPU (the purpose ··· 523 514 Operation mode of the driver: "active", "passive" or "off". 524 515 525 516 "active" 526 - The driver is functional and in the `active mode 527 - <Active Mode_>`_. 517 + The driver is functional and in the :ref:`active mode 518 + <active_mode>`. 528 519 529 520 "passive" 530 - The driver is functional and in the `passive mode 531 - <Passive Mode_>`_. 521 + The driver is functional and in the :ref:`passive mode 522 + <passive_mode>`. 532 523 533 524 "off" 534 525 The driver is not functional (it is not registered as a scaling ··· 556 547 attribute to "1" enables the energy-efficiency optimizations and setting 557 548 to "0" disables them. 558 549 550 + .. _policy_attributes_interpretation: 551 + 559 552 Interpretation of Policy Attributes 560 553 ----------------------------------- 561 554 562 555 The interpretation of some ``CPUFreq`` policy attributes described in 563 556 Documentation/admin-guide/pm/cpufreq.rst is special with ``intel_pstate`` 564 557 as the current scaling driver and it generally depends on the driver's 565 - `operation mode <Operation Modes_>`_. 558 + :ref:`operation mode <operation_modes>`. 566 559 567 560 First of all, the values of the ``cpuinfo_max_freq``, ``cpuinfo_min_freq`` and 568 561 ``scaling_cur_freq`` attributes are produced by applying a processor-specific ··· 573 562 attributes are capped by the frequency corresponding to the maximum P-state that 574 563 the driver is allowed to set. 575 564 576 - If the ``no_turbo`` `global attribute <no_turbo_attr_>`_ is set, the driver is 577 - not allowed to use turbo P-states, so the maximum value of ``scaling_max_freq`` 578 - and ``scaling_min_freq`` is limited to the maximum non-turbo P-state frequency. 565 + If the ``no_turbo`` :ref:`global attribute <no_turbo_attr>` is set, the driver 566 + is not allowed to use turbo P-states, so the maximum value of 567 + ``scaling_max_freq`` and ``scaling_min_freq`` is limited to the maximum 568 + non-turbo P-state frequency. 579 569 Accordingly, setting ``no_turbo`` causes ``scaling_max_freq`` and 580 570 ``scaling_min_freq`` to go down to that value if they were above it before. 581 571 However, the old values of ``scaling_max_freq`` and ``scaling_min_freq`` will be ··· 588 576 which also is the value of ``cpuinfo_max_freq`` in either case. 589 577 590 578 Next, the following policy attributes have special meaning if 591 - ``intel_pstate`` works in the `active mode <Active Mode_>`_: 579 + ``intel_pstate`` works in the :ref:`active mode <active_mode>`: 592 580 593 581 ``scaling_available_governors`` 594 582 List of P-state selection algorithms provided by ``intel_pstate``. ··· 609 597 Shows the base frequency of the CPU. Any frequency above this will be 610 598 in the turbo frequency range. 611 599 612 - The meaning of these attributes in the `passive mode <Passive Mode_>`_ is the 600 + The meaning of these attributes in the :ref:`passive mode <passive_mode>` is the 613 601 same as for other scaling drivers. 614 602 615 603 Additionally, the value of the ``scaling_driver`` attribute for ``intel_pstate`` 616 604 depends on the operation mode of the driver. Namely, it is either 617 - "intel_pstate" (in the `active mode <Active Mode_>`_) or "intel_cpufreq" (in the 618 - `passive mode <Passive Mode_>`_). 605 + "intel_pstate" (in the :ref:`active mode <active_mode>`) or "intel_cpufreq" 606 + (in the :ref:`passive mode <passive_mode>`). 607 + 608 + .. _pstate_limits_coordination: 619 609 620 610 Coordination of P-State Limits 621 611 ------------------------------ 622 612 623 613 ``intel_pstate`` allows P-state limits to be set in two ways: with the help of 624 - the ``max_perf_pct`` and ``min_perf_pct`` `global attributes 625 - <Global Attributes_>`_ or via the ``scaling_max_freq`` and ``scaling_min_freq`` 614 + the ``max_perf_pct`` and ``min_perf_pct`` :ref:`global attributes 615 + <global_attributes>` or via the ``scaling_max_freq`` and ``scaling_min_freq`` 626 616 ``CPUFreq`` policy attributes. The coordination between those limits is based 627 617 on the following rules, regardless of the current operation mode of the driver: 628 618 ··· 646 632 647 633 3. The global and per-policy limits can be set independently. 648 634 649 - In the `active mode with the HWP feature enabled <Active Mode With HWP_>`_, the 635 + In the :ref:`active mode with the HWP feature enabled <active_mode_hwp>`, the 650 636 resulting effective values are written into hardware registers whenever the 651 637 limits change in order to request its internal P-state selection logic to always 652 638 set P-states within these limits. Otherwise, the limits are taken into account 653 - by scaling governors (in the `passive mode <Passive Mode_>`_) and by the driver 654 - every time before setting a new P-state for a CPU. 639 + by scaling governors (in the :ref:`passive mode <passive_mode>`) and by the 640 + driver every time before setting a new P-state for a CPU. 655 641 656 642 Additionally, if the ``intel_pstate=per_cpu_perf_limits`` command line argument 657 643 is passed to the kernel, ``max_perf_pct`` and ``min_perf_pct`` are not exposed 658 644 at all and the only way to set the limits is by using the policy attributes. 659 645 646 + .. _energy_performance_hints: 660 647 661 648 Energy vs Performance Hints 662 649 --------------------------- ··· 717 702 On those systems each ``_PSS`` object returns a list of P-states supported by 718 703 the corresponding CPU which basically is a subset of the P-states range that can 719 704 be used by ``intel_pstate`` on the same system, with one exception: the whole 720 - `turbo range <turbo_>`_ is represented by one item in it (the topmost one). By 721 - convention, the frequency returned by ``_PSS`` for that item is greater by 1 MHz 722 - than the frequency of the highest non-turbo P-state listed by it, but the 705 + :ref:`turbo range <turbo>` is represented by one item in it (the topmost one). 706 + By convention, the frequency returned by ``_PSS`` for that item is greater by 707 + 1 MHz than the frequency of the highest non-turbo P-state listed by it, but the 723 708 corresponding P-state representation (following the hardware specification) 724 709 returned for it matches the maximum supported turbo P-state (or is the 725 710 special value 255 meaning essentially "go as high as you can get"). ··· 745 730 instead. 746 731 747 732 One more issue related to that may appear on systems supporting the 748 - `Configurable TDP feature <turbo_>`_ allowing the platform firmware to set the 749 - turbo threshold. Namely, if that is not coordinated with the lists of P-states 750 - returned by ``_PSS`` properly, there may be more than one item corresponding to 751 - a turbo P-state in those lists and there may be a problem with avoiding the 752 - turbo range (if desirable or necessary). Usually, to avoid using turbo 753 - P-states overall, ``acpi-cpufreq`` simply avoids using the topmost state listed 754 - by ``_PSS``, but that is not sufficient when there are other turbo P-states in 755 - the list returned by it. 733 + :ref:`Configurable TDP feature <turbo>` allowing the platform firmware to set 734 + the turbo threshold. Namely, if that is not coordinated with the lists of 735 + P-states returned by ``_PSS`` properly, there may be more than one item 736 + corresponding to a turbo P-state in those lists and there may be a problem with 737 + avoiding the turbo range (if desirable or necessary). Usually, to avoid using 738 + turbo P-states overall, ``acpi-cpufreq`` simply avoids using the topmost state 739 + listed by ``_PSS``, but that is not sufficient when there are other turbo 740 + P-states in the list returned by it. 756 741 757 742 Apart from the above, ``acpi-cpufreq`` works like ``intel_pstate`` in the 758 - `passive mode <Passive Mode_>`_, except that the number of P-states it can set 759 - is limited to the ones listed by the ACPI ``_PSS`` objects. 743 + :ref:`passive mode <passive_mode>`, except that the number of P-states it can 744 + set is limited to the ones listed by the ACPI ``_PSS`` objects. 760 745 761 746 762 747 Kernel Command Line Options for ``intel_pstate`` ··· 771 756 processor is supported by it. 772 757 773 758 ``active`` 774 - Register ``intel_pstate`` in the `active mode <Active Mode_>`_ to start 775 - with. 759 + Register ``intel_pstate`` in the :ref:`active mode <active_mode>` to 760 + start with. 776 761 777 762 ``passive`` 778 - Register ``intel_pstate`` in the `passive mode <Passive Mode_>`_ to 763 + Register ``intel_pstate`` in the :ref:`passive mode <passive_mode>` to 779 764 start with. 780 765 781 766 ``force`` ··· 808 793 and this option has no effect. 809 794 810 795 ``per_cpu_perf_limits`` 811 - Use per-logical-CPU P-State limits (see `Coordination of P-state 812 - Limits`_ for details). 796 + Use per-logical-CPU P-State limits (see 797 + :ref:`pstate_limits_coordination` for details). 813 798 814 799 ``no_cas`` 815 - Do not enable `capacity-aware scheduling <CAS_>`_ which is enabled by 816 - default on hybrid systems without SMT. 800 + Do not enable :ref:`capacity-aware scheduling <CAS>` which is enabled 801 + by default on hybrid systems without SMT. 817 802 818 803 Diagnostics and Tuning 819 804 ====================== ··· 825 810 diagnostics. One of them is the ``cpu_frequency`` trace event generally used 826 811 by ``CPUFreq``, and the other one is the ``pstate_sample`` trace event specific 827 812 to ``intel_pstate``. Both of them are triggered by ``intel_pstate`` only if 828 - it works in the `active mode <Active Mode_>`_. 813 + it works in the :ref:`active mode <active_mode>`. 829 814 830 815 The following sequence of shell commands can be used to enable them and see 831 816 their output (if the kernel is generally configured to support event tracing):: ··· 837 822 gnome-terminal--4510 [001] ..s. 1177.680733: pstate_sample: core_busy=107 scaled=94 from=26 to=26 mperf=1143818 aperf=1230607 tsc=29838618 freq=2474476 838 823 cat-5235 [002] ..s. 1177.681723: cpu_frequency: state=2900000 cpu_id=2 839 824 840 - If ``intel_pstate`` works in the `passive mode <Passive Mode_>`_, the 825 + If ``intel_pstate`` works in the :ref:`passive mode <passive_mode>`, the 841 826 ``cpu_frequency`` trace event will be triggered either by the ``schedutil`` 842 827 scaling governor (for the policies it is attached to), or by the ``CPUFreq`` 843 828 core (for the policies with other scaling governors).
+7 -4
drivers/cpufreq/cpufreq.c
··· 1421 1421 * If there is a problem with its frequency table, take it 1422 1422 * offline and drop it. 1423 1423 */ 1424 - ret = cpufreq_table_validate_and_sort(policy); 1425 - if (ret) 1426 - goto out_offline_policy; 1424 + if (policy->freq_table_sorted != CPUFREQ_TABLE_SORTED_ASCENDING && 1425 + policy->freq_table_sorted != CPUFREQ_TABLE_SORTED_DESCENDING) { 1426 + ret = cpufreq_table_validate_and_sort(policy); 1427 + if (ret) 1428 + goto out_offline_policy; 1429 + } 1427 1430 1428 1431 /* related_cpus should at least include policy->cpus. */ 1429 1432 cpumask_copy(policy->related_cpus, policy->cpus); ··· 2553 2550 for_each_inactive_policy(policy) { 2554 2551 if (!strcmp(policy->last_governor, governor->name)) { 2555 2552 policy->governor = NULL; 2556 - strcpy(policy->last_governor, "\0"); 2553 + policy->last_governor[0] = '\0'; 2557 2554 } 2558 2555 } 2559 2556 read_unlock_irqrestore(&cpufreq_driver_lock, flags);
+51 -49
drivers/cpufreq/intel_pstate.c
··· 575 575 int scaling = cpu->pstate.scaling; 576 576 int freq; 577 577 578 - pr_debug("CPU%d: perf_ctl_max_phys = %d\n", cpu->cpu, perf_ctl_max_phys); 579 - pr_debug("CPU%d: perf_ctl_turbo = %d\n", cpu->cpu, perf_ctl_turbo); 580 - pr_debug("CPU%d: perf_ctl_scaling = %d\n", cpu->cpu, perf_ctl_scaling); 578 + pr_debug("CPU%d: PERF_CTL max_phys = %d\n", cpu->cpu, perf_ctl_max_phys); 579 + pr_debug("CPU%d: PERF_CTL turbo = %d\n", cpu->cpu, perf_ctl_turbo); 580 + pr_debug("CPU%d: PERF_CTL scaling = %d\n", cpu->cpu, perf_ctl_scaling); 581 581 pr_debug("CPU%d: HWP_CAP guaranteed = %d\n", cpu->cpu, cpu->pstate.max_pstate); 582 582 pr_debug("CPU%d: HWP_CAP highest = %d\n", cpu->cpu, cpu->pstate.turbo_pstate); 583 583 pr_debug("CPU%d: HWP-to-frequency scaling factor: %d\n", cpu->cpu, scaling); 584 + 585 + if (scaling == perf_ctl_scaling) 586 + return; 587 + 588 + hwp_is_hybrid = true; 584 589 585 590 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_pstate * scaling, 586 591 perf_ctl_scaling); ··· 914 909 [HWP_CPUFREQ_ATTR_COUNT] = NULL, 915 910 }; 916 911 912 + static u8 hybrid_get_cpu_type(unsigned int cpu) 913 + { 914 + return cpu_data(cpu).topo.intel_type; 915 + } 916 + 917 917 static bool no_cas __ro_after_init; 918 918 919 919 static struct cpudata *hybrid_max_perf_cpu __read_mostly; ··· 935 925 unsigned long *freq) 936 926 { 937 927 /* 938 - * Create "utilization bins" of 0-40%, 40%-60%, 60%-80%, and 80%-100% 939 - * of the maximum capacity such that two CPUs of the same type will be 940 - * regarded as equally attractive if the utilization of each of them 941 - * falls into the same bin, which should prevent tasks from being 942 - * migrated between them too often. 928 + * Create four "states" corresponding to 40%, 60%, 80%, and 100% of the 929 + * full capacity. 943 930 * 944 931 * For this purpose, return the "frequency" of 2 for the first 945 932 * performance level and otherwise leave the value set by the caller. ··· 950 943 return 0; 951 944 } 952 945 946 + static bool hybrid_has_l3(unsigned int cpu) 947 + { 948 + struct cpu_cacheinfo *cacheinfo = get_cpu_cacheinfo(cpu); 949 + unsigned int i; 950 + 951 + if (!cacheinfo) 952 + return false; 953 + 954 + for (i = 0; i < cacheinfo->num_leaves; i++) { 955 + if (cacheinfo->info_list[i].level == 3) 956 + return true; 957 + } 958 + 959 + return false; 960 + } 961 + 953 962 static int hybrid_get_cost(struct device *dev, unsigned long freq, 954 963 unsigned long *cost) 955 964 { 956 - struct pstate_data *pstate = &all_cpu_data[dev->id]->pstate; 957 - struct cpu_cacheinfo *cacheinfo = get_cpu_cacheinfo(dev->id); 958 - 965 + /* Facilitate load balancing between CPUs of the same type. */ 966 + *cost = freq; 959 967 /* 960 - * The smaller the perf-to-frequency scaling factor, the larger the IPC 961 - * ratio between the given CPU and the least capable CPU in the system. 962 - * Regard that IPC ratio as the primary cost component and assume that 963 - * the scaling factors for different CPU types will differ by at least 964 - * 5% and they will not be above INTEL_PSTATE_CORE_SCALING. 968 + * Adjust the cost depending on CPU type. 965 969 * 966 - * Add the freq value to the cost, so that the cost of running on CPUs 967 - * of the same type in different "utilization bins" is different. 970 + * The idea is to start loading up LPE-cores before E-cores and start 971 + * to populate E-cores when LPE-cores are utilized above 60% of the 972 + * capacity. Similarly, P-cores start to be populated when E-cores are 973 + * utilized above 60% of the capacity. 968 974 */ 969 - *cost = div_u64(100ULL * INTEL_PSTATE_CORE_SCALING, pstate->scaling) + freq; 970 - /* 971 - * Increase the cost slightly for CPUs able to access L3 to avoid 972 - * touching it in case some other CPUs of the same type can do the work 973 - * without it. 974 - */ 975 - if (cacheinfo) { 976 - unsigned int i; 977 - 978 - /* Check if L3 cache is there. */ 979 - for (i = 0; i < cacheinfo->num_leaves; i++) { 980 - if (cacheinfo->info_list[i].level == 3) { 981 - *cost += 2; 982 - break; 983 - } 984 - } 975 + if (hybrid_get_cpu_type(dev->id) == INTEL_CPU_TYPE_ATOM) { 976 + if (hybrid_has_l3(dev->id)) /* E-core */ 977 + *cost += 1; 978 + } else { /* P-core */ 979 + *cost += 2; 985 980 } 986 981 987 982 return 0; ··· 1046 1037 1047 1038 topology_set_cpu_scale(cpu->cpu, arch_scale_cpu_capacity(cpu->cpu)); 1048 1039 1049 - pr_debug("CPU%d: perf = %u, max. perf = %u, base perf = %d\n", cpu->cpu, 1050 - cpu->capacity_perf, hybrid_max_perf_cpu->capacity_perf, 1051 - cpu->pstate.max_pstate_physical); 1040 + pr_debug("CPU%d: capacity perf = %u, base perf = %u, sys max perf = %u\n", 1041 + cpu->cpu, cpu->capacity_perf, cpu->pstate.max_pstate_physical, 1042 + hybrid_max_perf_cpu->capacity_perf); 1052 1043 } 1053 1044 1054 1045 static void hybrid_clear_cpu_capacity(unsigned int cpunum) ··· 2306 2297 static int hwp_get_cpu_scaling(int cpu) 2307 2298 { 2308 2299 if (hybrid_scaling_factor) { 2309 - struct cpuinfo_x86 *c = &cpu_data(cpu); 2310 - u8 cpu_type = c->topo.intel_type; 2311 - 2312 2300 /* 2313 2301 * Return the hybrid scaling factor for P-cores and use the 2314 2302 * default core scaling for E-cores. 2315 2303 */ 2316 - if (cpu_type == INTEL_CPU_TYPE_CORE) 2304 + if (hybrid_get_cpu_type(cpu) == INTEL_CPU_TYPE_CORE) 2317 2305 return hybrid_scaling_factor; 2318 2306 2319 - if (cpu_type == INTEL_CPU_TYPE_ATOM) 2320 - return core_get_scaling(); 2307 + return core_get_scaling(); 2321 2308 } 2322 2309 2323 2310 /* Use core scaling on non-hybrid systems. */ ··· 2348 2343 2349 2344 static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) 2350 2345 { 2351 - int perf_ctl_max_phys = pstate_funcs.get_max_physical(cpu->cpu); 2352 2346 int perf_ctl_scaling = pstate_funcs.get_scaling(); 2353 2347 2348 + cpu->pstate.max_pstate_physical = pstate_funcs.get_max_physical(cpu->cpu); 2354 2349 cpu->pstate.min_pstate = pstate_funcs.get_min(cpu->cpu); 2355 - cpu->pstate.max_pstate_physical = perf_ctl_max_phys; 2356 2350 cpu->pstate.perf_ctl_scaling = perf_ctl_scaling; 2357 2351 2358 2352 if (hwp_active && !hwp_mode_bdw) { ··· 2359 2355 2360 2356 if (pstate_funcs.get_cpu_scaling) { 2361 2357 cpu->pstate.scaling = pstate_funcs.get_cpu_scaling(cpu->cpu); 2362 - if (cpu->pstate.scaling != perf_ctl_scaling) { 2363 - intel_pstate_hybrid_hwp_adjust(cpu); 2364 - hwp_is_hybrid = true; 2365 - } 2358 + intel_pstate_hybrid_hwp_adjust(cpu); 2366 2359 } else { 2367 2360 cpu->pstate.scaling = perf_ctl_scaling; 2368 2361 } ··· 2761 2760 X86_MATCH(INTEL_ATOM_CRESTMONT, core_funcs), 2762 2761 X86_MATCH(INTEL_ATOM_CRESTMONT_X, core_funcs), 2763 2762 X86_MATCH(INTEL_ATOM_DARKMONT_X, core_funcs), 2763 + X86_MATCH(INTEL_DIAMONDRAPIDS_X, core_funcs), 2764 2764 {} 2765 2765 }; 2766 2766 #endif