| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/arch/arm/mach-omap2/cpuidle34xx.c |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 16 | 17 | * Richard Woodruff <r-woodruff2@ti.com> |
|---|
| 17 | 18 | * |
|---|
| 18 | 19 | * 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. |
|---|
| 23 | 20 | */ |
|---|
| 24 | 21 | |
|---|
| 25 | 22 | #include <linux/sched.h> |
|---|
| .. | .. |
|---|
| 112 | 109 | int index) |
|---|
| 113 | 110 | { |
|---|
| 114 | 111 | struct omap3_idle_statedata *cx = &omap3_idle_data[index]; |
|---|
| 112 | + int error; |
|---|
| 115 | 113 | |
|---|
| 116 | 114 | if (omap_irq_pending() || need_resched()) |
|---|
| 117 | 115 | goto return_sleep_time; |
|---|
| .. | .. |
|---|
| 128 | 126 | * Call idle CPU PM enter notifier chain so that |
|---|
| 129 | 127 | * VFP context is saved. |
|---|
| 130 | 128 | */ |
|---|
| 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 | + } |
|---|
| 133 | 134 | |
|---|
| 134 | 135 | /* Execute ARM wfi */ |
|---|
| 135 | 136 | omap_sram_idle(); |
|---|
| .. | .. |
|---|
| 142 | 143 | pwrdm_read_prev_pwrst(mpu_pd) == PWRDM_POWER_OFF) |
|---|
| 143 | 144 | cpu_pm_exit(); |
|---|
| 144 | 145 | |
|---|
| 146 | +out_clkdm_set: |
|---|
| 145 | 147 | /* Re-allow idle for C1 */ |
|---|
| 146 | 148 | if (cx->flags & OMAP_CPUIDLE_CX_NO_CLKDM_IDLE) |
|---|
| 147 | 149 | clkdm_allow_idle(mpu_pd->pwrdm_clkdms[0]); |
|---|