Commit 4d1be9e7 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

cpuidle, OMAP3: Push RCU-idle into driver

Doing RCU-idle outside the driver, only to then teporarily enable it
again before going idle is suboptimal.

Notably the cpu_pm_*() calls implicitly re-enable RCU for a bit.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Tested-by: default avatarTony Lindgren <tony@atomide.com>
Tested-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Reviewed-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Reviewed-by: default avatarTony Lindgren <tony@atomide.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20230112195539.883561913@infradead.org
parent b3f46658
...@@ -133,7 +133,9 @@ static int omap3_enter_idle(struct cpuidle_device *dev, ...@@ -133,7 +133,9 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
} }
/* Execute ARM wfi */ /* Execute ARM wfi */
ct_idle_enter();
omap_sram_idle(); omap_sram_idle();
ct_idle_exit();
/* /*
* Call idle CPU PM enter notifier chain to restore * Call idle CPU PM enter notifier chain to restore
...@@ -265,6 +267,7 @@ static struct cpuidle_driver omap3_idle_driver = { ...@@ -265,6 +267,7 @@ static struct cpuidle_driver omap3_idle_driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.states = { .states = {
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 2 + 2, .exit_latency = 2 + 2,
.target_residency = 5, .target_residency = 5,
...@@ -272,6 +275,7 @@ static struct cpuidle_driver omap3_idle_driver = { ...@@ -272,6 +275,7 @@ static struct cpuidle_driver omap3_idle_driver = {
.desc = "MPU ON + CORE ON", .desc = "MPU ON + CORE ON",
}, },
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 10 + 10, .exit_latency = 10 + 10,
.target_residency = 30, .target_residency = 30,
...@@ -279,6 +283,7 @@ static struct cpuidle_driver omap3_idle_driver = { ...@@ -279,6 +283,7 @@ static struct cpuidle_driver omap3_idle_driver = {
.desc = "MPU ON + CORE ON", .desc = "MPU ON + CORE ON",
}, },
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 50 + 50, .exit_latency = 50 + 50,
.target_residency = 300, .target_residency = 300,
...@@ -286,6 +291,7 @@ static struct cpuidle_driver omap3_idle_driver = { ...@@ -286,6 +291,7 @@ static struct cpuidle_driver omap3_idle_driver = {
.desc = "MPU RET + CORE ON", .desc = "MPU RET + CORE ON",
}, },
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 1500 + 1800, .exit_latency = 1500 + 1800,
.target_residency = 4000, .target_residency = 4000,
...@@ -293,6 +299,7 @@ static struct cpuidle_driver omap3_idle_driver = { ...@@ -293,6 +299,7 @@ static struct cpuidle_driver omap3_idle_driver = {
.desc = "MPU OFF + CORE ON", .desc = "MPU OFF + CORE ON",
}, },
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 2500 + 7500, .exit_latency = 2500 + 7500,
.target_residency = 12000, .target_residency = 12000,
...@@ -300,6 +307,7 @@ static struct cpuidle_driver omap3_idle_driver = { ...@@ -300,6 +307,7 @@ static struct cpuidle_driver omap3_idle_driver = {
.desc = "MPU RET + CORE RET", .desc = "MPU RET + CORE RET",
}, },
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 3000 + 8500, .exit_latency = 3000 + 8500,
.target_residency = 15000, .target_residency = 15000,
...@@ -307,6 +315,7 @@ static struct cpuidle_driver omap3_idle_driver = { ...@@ -307,6 +315,7 @@ static struct cpuidle_driver omap3_idle_driver = {
.desc = "MPU OFF + CORE RET", .desc = "MPU OFF + CORE RET",
}, },
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 10000 + 30000, .exit_latency = 10000 + 30000,
.target_residency = 30000, .target_residency = 30000,
...@@ -328,6 +337,7 @@ static struct cpuidle_driver omap3430_idle_driver = { ...@@ -328,6 +337,7 @@ static struct cpuidle_driver omap3430_idle_driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.states = { .states = {
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 110 + 162, .exit_latency = 110 + 162,
.target_residency = 5, .target_residency = 5,
...@@ -335,6 +345,7 @@ static struct cpuidle_driver omap3430_idle_driver = { ...@@ -335,6 +345,7 @@ static struct cpuidle_driver omap3430_idle_driver = {
.desc = "MPU ON + CORE ON", .desc = "MPU ON + CORE ON",
}, },
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 106 + 180, .exit_latency = 106 + 180,
.target_residency = 309, .target_residency = 309,
...@@ -342,6 +353,7 @@ static struct cpuidle_driver omap3430_idle_driver = { ...@@ -342,6 +353,7 @@ static struct cpuidle_driver omap3430_idle_driver = {
.desc = "MPU ON + CORE ON", .desc = "MPU ON + CORE ON",
}, },
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 107 + 410, .exit_latency = 107 + 410,
.target_residency = 46057, .target_residency = 46057,
...@@ -349,6 +361,7 @@ static struct cpuidle_driver omap3430_idle_driver = { ...@@ -349,6 +361,7 @@ static struct cpuidle_driver omap3430_idle_driver = {
.desc = "MPU RET + CORE ON", .desc = "MPU RET + CORE ON",
}, },
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 121 + 3374, .exit_latency = 121 + 3374,
.target_residency = 46057, .target_residency = 46057,
...@@ -356,6 +369,7 @@ static struct cpuidle_driver omap3430_idle_driver = { ...@@ -356,6 +369,7 @@ static struct cpuidle_driver omap3430_idle_driver = {
.desc = "MPU OFF + CORE ON", .desc = "MPU OFF + CORE ON",
}, },
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 855 + 1146, .exit_latency = 855 + 1146,
.target_residency = 46057, .target_residency = 46057,
...@@ -363,6 +377,7 @@ static struct cpuidle_driver omap3430_idle_driver = { ...@@ -363,6 +377,7 @@ static struct cpuidle_driver omap3430_idle_driver = {
.desc = "MPU RET + CORE RET", .desc = "MPU RET + CORE RET",
}, },
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 7580 + 4134, .exit_latency = 7580 + 4134,
.target_residency = 484329, .target_residency = 484329,
...@@ -370,6 +385,7 @@ static struct cpuidle_driver omap3430_idle_driver = { ...@@ -370,6 +385,7 @@ static struct cpuidle_driver omap3430_idle_driver = {
.desc = "MPU OFF + CORE RET", .desc = "MPU OFF + CORE RET",
}, },
{ {
.flags = CPUIDLE_FLAG_RCU_IDLE,
.enter = omap3_enter_idle_bm, .enter = omap3_enter_idle_bm,
.exit_latency = 7505 + 15274, .exit_latency = 7505 + 15274,
.target_residency = 484329, .target_residency = 484329,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment