Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions doc/services/cpu_freq/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ For an example of a metric in use, see the :ref:`on_demand <on_demand_policy>` p
P-state Drivers
***************

A SoC supporting the CPU Freq subsystem must implement a P-state driver that implements
A SoC supporting the CPU Frequency Scaling subsystem must implement a P-state driver that implements
:c:func:`cpu_freq_pstate_set` which applies the passed in ``p_state`` to
the CPU when called.

Expand All @@ -61,8 +61,9 @@ undergo a P-state transition, then all other CPUs will also undergo the same P-s
This can be overridden by the SoC by enabling the :kconfig:option:`CONFIG_CPU_FREQ_PER_CPU_SCALING`
configuration option to allow each CPU to be clocked independently.

The SoC supporting CPU Freq must uphold Zephyr's requirement that the system timer remains constant
over the lifetime of the program. See :ref:`Kernel Timing <kernel_timing>` for more information.
The SoC supporting CPU Frequency Scaling must uphold Zephyr's requirement that the system timer
frequency remains steady over the lifetime of the program. See :ref:`Kernel Timing <kernel_timing>`
for more information.

The CPU Frequency Scaling subsystem runs as a handler function to a ``k_timer``, which means it runs
in interrupt context (IRQ). The SoC P-state driver must ensure that its implementation of
Expand Down
8 changes: 2 additions & 6 deletions subsys/cpu_freq/cpu_freq.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ static void cpu_freq_next_pstate(void)
/* Get next performance state */
const struct pstate *pstate_next;

cpu_freq_policy_reset();

ret = cpu_freq_policy_select_pstate(&pstate_next);
if (ret) {
LOG_ERR("Failed to get pstate: %d", ret);
Expand Down Expand Up @@ -70,11 +68,9 @@ static void cpu_freq_timer_handler(struct k_timer *timer)
*/

target_cpus = (num_cpus == 32U) ? 0xFFFFFFFF : (1U << num_cpus) - 1U;
target_cpus ^= (1U << _current_cpu->id),
target_cpus ^= (1U << _current_cpu->id);

ret = k_ipi_work_add(&cpu_freq_work,
target_cpus ^ (1U << _current_cpu->id),
cpu_freq_ipi_handler);
ret = k_ipi_work_add(&cpu_freq_work, target_cpus, cpu_freq_ipi_handler);

if (ret != 0) {
/*
Expand Down
Loading