forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/arch/arm/mach-omap2/cpuidle34xx.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mach-omap2/cpuidle34xx.c
34 *
....@@ -16,10 +17,6 @@
1617 * Richard Woodruff <r-woodruff2@ti.com>
1718 *
1819 * Based on pm.c for omap2
19
- *
20
- * This program is free software; you can redistribute it and/or modify
21
- * it under the terms of the GNU General Public License version 2 as
22
- * published by the Free Software Foundation.
2320 */
2421
2522 #include <linux/sched.h>
....@@ -112,6 +109,7 @@
112109 int index)
113110 {
114111 struct omap3_idle_statedata *cx = &omap3_idle_data[index];
112
+ int error;
115113
116114 if (omap_irq_pending() || need_resched())
117115 goto return_sleep_time;
....@@ -128,8 +126,11 @@
128126 * Call idle CPU PM enter notifier chain so that
129127 * VFP context is saved.
130128 */
131
- if (cx->mpu_state == PWRDM_POWER_OFF)
132
- cpu_pm_enter();
129
+ if (cx->mpu_state == PWRDM_POWER_OFF) {
130
+ error = cpu_pm_enter();
131
+ if (error)
132
+ goto out_clkdm_set;
133
+ }
133134
134135 /* Execute ARM wfi */
135136 omap_sram_idle();
....@@ -142,6 +143,7 @@
142143 pwrdm_read_prev_pwrst(mpu_pd) == PWRDM_POWER_OFF)
143144 cpu_pm_exit();
144145
146
+out_clkdm_set:
145147 /* Re-allow idle for C1 */
146148 if (cx->flags & OMAP_CPUIDLE_CX_NO_CLKDM_IDLE)
147149 clkdm_allow_idle(mpu_pd->pwrdm_clkdms[0]);