aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/cpuidle/Kconfig7
-rw-r--r--drivers/cpuidle/Kconfig.arm1
-rw-r--r--drivers/cpuidle/cpuidle.c2
-rw-r--r--drivers/cpuidle/driver.c11
-rw-r--r--drivers/cpuidle/governors/ladder.c4
-rw-r--r--drivers/cpuidle/governors/menu.c1
-rw-r--r--drivers/cpuidle/sysfs.c2
-rw-r--r--kernel/sched/idle.c4
8 files changed, 7 insertions, 25 deletions
diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig
index 1b96fb91d32c..32748c36c477 100644
--- a/drivers/cpuidle/Kconfig
+++ b/drivers/cpuidle/Kconfig
@@ -15,12 +15,7 @@ config CPU_IDLE
15if CPU_IDLE 15if CPU_IDLE
16 16
17config CPU_IDLE_MULTIPLE_DRIVERS 17config CPU_IDLE_MULTIPLE_DRIVERS
18 bool "Support multiple cpuidle drivers" 18 bool
19 default n
20 help
21 Allows the cpuidle framework to use different drivers for each CPU.
22 This is useful if you have a system with different CPU latencies and
23 states. If unsure say N.
24 19
25config CPU_IDLE_GOV_LADDER 20config CPU_IDLE_GOV_LADDER
26 bool "Ladder governor (for periodic timer tick)" 21 bool "Ladder governor (for periodic timer tick)"
diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm
index b6d69e899f5d..a186dec8e5df 100644
--- a/drivers/cpuidle/Kconfig.arm
+++ b/drivers/cpuidle/Kconfig.arm
@@ -10,6 +10,7 @@ config ARM_ARMADA_370_XP_CPUIDLE
10config ARM_BIG_LITTLE_CPUIDLE 10config ARM_BIG_LITTLE_CPUIDLE
11 bool "Support for ARM big.LITTLE processors" 11 bool "Support for ARM big.LITTLE processors"
12 depends on ARCH_VEXPRESS_TC2_PM 12 depends on ARCH_VEXPRESS_TC2_PM
13 depends on MCPM
13 select ARM_CPU_SUSPEND 14 select ARM_CPU_SUSPEND
14 select CPU_IDLE_MULTIPLE_DRIVERS 15 select CPU_IDLE_MULTIPLE_DRIVERS
15 help 16 help
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index cb7019977c50..ee9df5e3f5eb 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -119,11 +119,13 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
119 ktime_t time_start, time_end; 119 ktime_t time_start, time_end;
120 s64 diff; 120 s64 diff;
121 121
122 trace_cpu_idle_rcuidle(index, dev->cpu);
122 time_start = ktime_get(); 123 time_start = ktime_get();
123 124
124 entered_state = target_state->enter(dev, drv, index); 125 entered_state = target_state->enter(dev, drv, index);
125 126
126 time_end = ktime_get(); 127 time_end = ktime_get();
128 trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);
127 129
128 if (!cpuidle_state_is_coupled(dev, drv, entered_state)) 130 if (!cpuidle_state_is_coupled(dev, drv, entered_state))
129 local_irq_enable(); 131 local_irq_enable();
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
index 9634f20e3926..e431d11abf8d 100644
--- a/drivers/cpuidle/driver.c
+++ b/drivers/cpuidle/driver.c
@@ -182,10 +182,6 @@ static void __cpuidle_driver_init(struct cpuidle_driver *drv)
182static int poll_idle(struct cpuidle_device *dev, 182static int poll_idle(struct cpuidle_device *dev,
183 struct cpuidle_driver *drv, int index) 183 struct cpuidle_driver *drv, int index)
184{ 184{
185 ktime_t t1, t2;
186 s64 diff;
187
188 t1 = ktime_get();
189 local_irq_enable(); 185 local_irq_enable();
190 if (!current_set_polling_and_test()) { 186 if (!current_set_polling_and_test()) {
191 while (!need_resched()) 187 while (!need_resched())
@@ -193,13 +189,6 @@ static int poll_idle(struct cpuidle_device *dev,
193 } 189 }
194 current_clr_polling(); 190 current_clr_polling();
195 191
196 t2 = ktime_get();
197 diff = ktime_to_us(ktime_sub(t2, t1));
198 if (diff > INT_MAX)
199 diff = INT_MAX;
200
201 dev->last_residency = (int) diff;
202
203 return index; 192 return index;
204} 193}
205 194
diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c
index 9f08e8cce1af..044ee0df5871 100644
--- a/drivers/cpuidle/governors/ladder.c
+++ b/drivers/cpuidle/governors/ladder.c
@@ -144,7 +144,7 @@ static int ladder_enable_device(struct cpuidle_driver *drv,
144 144
145 ldev->last_state_idx = CPUIDLE_DRIVER_STATE_START; 145 ldev->last_state_idx = CPUIDLE_DRIVER_STATE_START;
146 146
147 for (i = 0; i < drv->state_count; i++) { 147 for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) {
148 state = &drv->states[i]; 148 state = &drv->states[i];
149 lstate = &ldev->states[i]; 149 lstate = &ldev->states[i];
150 150
@@ -156,7 +156,7 @@ static int ladder_enable_device(struct cpuidle_driver *drv,
156 156
157 if (i < drv->state_count - 1) 157 if (i < drv->state_count - 1)
158 lstate->threshold.promotion_time = state->exit_latency; 158 lstate->threshold.promotion_time = state->exit_latency;
159 if (i > 0) 159 if (i > CPUIDLE_DRIVER_STATE_START)
160 lstate->threshold.demotion_time = state->exit_latency; 160 lstate->threshold.demotion_time = state->exit_latency;
161 } 161 }
162 162
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index c4f80c15a48d..c3732fa74f82 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -35,7 +35,6 @@
35#define RESOLUTION 1024 35#define RESOLUTION 1024
36#define DECAY 8 36#define DECAY 8
37#define MAX_INTERESTING 50000 37#define MAX_INTERESTING 50000
38#define STDDEV_THRESH 400
39 38
40 39
41/* 40/*
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index efe2f175168f..97c5903b4606 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -445,7 +445,7 @@ static void cpuidle_remove_state_sysfs(struct cpuidle_device *device)
445 445
446#define define_one_driver_ro(_name, show) \ 446#define define_one_driver_ro(_name, show) \
447 static struct cpuidle_driver_attr attr_driver_##_name = \ 447 static struct cpuidle_driver_attr attr_driver_##_name = \
448 __ATTR(_name, 0644, show, NULL) 448 __ATTR(_name, 0444, show, NULL)
449 449
450struct cpuidle_driver_kobj { 450struct cpuidle_driver_kobj {
451 struct cpuidle_driver *drv; 451 struct cpuidle_driver *drv;
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index cf009fb0bc25..658a58dc30f4 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -147,8 +147,6 @@ use_default:
147 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu)) 147 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu))
148 goto use_default; 148 goto use_default;
149 149
150 trace_cpu_idle_rcuidle(next_state, dev->cpu);
151
152 /* 150 /*
153 * Enter the idle state previously returned by the governor decision. 151 * Enter the idle state previously returned by the governor decision.
154 * This function will block until an interrupt occurs and will take 152 * This function will block until an interrupt occurs and will take
@@ -156,8 +154,6 @@ use_default:
156 */ 154 */
157 entered_state = cpuidle_enter(drv, dev, next_state); 155 entered_state = cpuidle_enter(drv, dev, next_state);
158 156
159 trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);
160
161 if (broadcast) 157 if (broadcast)
162 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu); 158 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
163 159