cpuidle-tegra.c (a01353cf1896ea5b8a7bbc5e2b2d38feed8b7aaa) cpuidle-tegra.c (69e26b4f43ed396868c6e7645f9eb06c3a0d2fee)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * CPU idle driver for Tegra CPUs
4 *
5 * Copyright (c) 2010-2013, NVIDIA Corporation.
6 * Copyright (c) 2011 Google, Inc.
7 * Author: Colin Cross <ccross@android.com>
8 * Gary King <gking@nvidia.com>

--- 146 unchanged lines hidden (view full) ---

155 cpuidle_coupled_parallel_barrier(dev, &tegra_idle_barrier);
156 atomic_set(&tegra_abort_flag, 0);
157 return -EINTR;
158 }
159
160 return 0;
161}
162
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * CPU idle driver for Tegra CPUs
4 *
5 * Copyright (c) 2010-2013, NVIDIA Corporation.
6 * Copyright (c) 2011 Google, Inc.
7 * Author: Colin Cross <ccross@android.com>
8 * Gary King <gking@nvidia.com>

--- 146 unchanged lines hidden (view full) ---

155 cpuidle_coupled_parallel_barrier(dev, &tegra_idle_barrier);
156 atomic_set(&tegra_abort_flag, 0);
157 return -EINTR;
158 }
159
160 return 0;
161}
162
163static int tegra_cpuidle_state_enter(struct cpuidle_device *dev,
164 int index, unsigned int cpu)
163static __cpuidle int tegra_cpuidle_state_enter(struct cpuidle_device *dev,
164 int index, unsigned int cpu)
165{
166 int err;
167
168 /*
169 * CC6 state is the "CPU cluster power-off" state. In order to
170 * enter this state, at first the secondary CPU cores need to be
171 * parked into offline mode, then the last CPU should clean out
172 * remaining dirty cache lines into DRAM and trigger Flow Controller

--- 48 unchanged lines hidden (view full) ---

221 if (!IS_ENABLED(CONFIG_PM_SLEEP) || num_online_cpus() > 1)
222 index = TEGRA_C1;
223 else
224 index = TEGRA_CC6;
225
226 return index;
227}
228
165{
166 int err;
167
168 /*
169 * CC6 state is the "CPU cluster power-off" state. In order to
170 * enter this state, at first the secondary CPU cores need to be
171 * parked into offline mode, then the last CPU should clean out
172 * remaining dirty cache lines into DRAM and trigger Flow Controller

--- 48 unchanged lines hidden (view full) ---

221 if (!IS_ENABLED(CONFIG_PM_SLEEP) || num_online_cpus() > 1)
222 index = TEGRA_C1;
223 else
224 index = TEGRA_CC6;
225
226 return index;
227}
228
229static int tegra_cpuidle_enter(struct cpuidle_device *dev,
230 struct cpuidle_driver *drv,
231 int index)
229static __cpuidle int tegra_cpuidle_enter(struct cpuidle_device *dev,
230 struct cpuidle_driver *drv,
231 int index)
232{
233 bool do_rcu = drv->states[index].flags & CPUIDLE_FLAG_RCU_IDLE;
234 unsigned int cpu = cpu_logical_map(dev->cpu);
235 int ret;
236
237 index = tegra_cpuidle_adjust_state_index(index, cpu);
238 if (dev->states_usage[index].disable)
239 return -1;

--- 163 unchanged lines hidden ---
232{
233 bool do_rcu = drv->states[index].flags & CPUIDLE_FLAG_RCU_IDLE;
234 unsigned int cpu = cpu_logical_map(dev->cpu);
235 int ret;
236
237 index = tegra_cpuidle_adjust_state_index(index, cpu);
238 if (dev->states_usage[index].disable)
239 return -1;

--- 163 unchanged lines hidden ---