hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/cpuidle/poll_state.c
....@@ -1,7 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * poll_state.c - Polling idle state
3
- *
4
- * This file is released under the GPLv2.
54 */
65
76 #include <linux/cpuidle.h>
....@@ -9,7 +8,6 @@
98 #include <linux/sched/clock.h>
109 #include <linux/sched/idle.h>
1110
12
-#define POLL_IDLE_TIME_LIMIT (TICK_NSEC / 16)
1311 #define POLL_IDLE_RELAX_COUNT 200
1412
1513 static int __cpuidle poll_idle(struct cpuidle_device *dev,
....@@ -22,6 +20,9 @@
2220 local_irq_enable();
2321 if (!current_set_polling_and_test()) {
2422 unsigned int loop_count = 0;
23
+ u64 limit;
24
+
25
+ limit = cpuidle_poll_time(drv, dev);
2526
2627 while (!need_resched()) {
2728 cpu_relax();
....@@ -29,7 +30,7 @@
2930 continue;
3031
3132 loop_count = 0;
32
- if (local_clock() - time_start > POLL_IDLE_TIME_LIMIT) {
33
+ if (local_clock() - time_start > limit) {
3334 dev->poll_time_limit = true;
3435 break;
3536 }
....@@ -48,9 +49,10 @@
4849 snprintf(state->desc, CPUIDLE_DESC_LEN, "CPUIDLE CORE POLL IDLE");
4950 state->exit_latency = 0;
5051 state->target_residency = 0;
52
+ state->exit_latency_ns = 0;
53
+ state->target_residency_ns = 0;
5154 state->power_usage = -1;
5255 state->enter = poll_idle;
53
- state->disabled = false;
5456 state->flags = CPUIDLE_FLAG_POLLING;
5557 }
5658 EXPORT_SYMBOL_GPL(cpuidle_poll_state_init);