mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 17:59:33 +07:00
d90bdb72bb
Pen-locking is meant to block CPU0 if CPU1 wakes up during of entering into LP2 because of some interrupt firing up, preventing unnecessary LP2 enter that will be resumed immediately. Apparently this case doesn't happen often in practice, I checked how often it takes place and found that after ~20 hours of browsing web, managing email, watching videos and idling (15+ hours) there is only a dozen of early LP2 entering abortions and they all happened while device was idling. Thus let's remove the pen-locking and make LP2 entering uninterruptible, simplifying code quite a lot. This will also become very handy for the upcoming unified cpuidle driver, allowing to have a common LP2 code-path across of different hardware generations. Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com> Tested-by: Peter Geis <pgwipeout@gmail.com> Tested-by: Jasper Korten <jja2000@gmail.com> Tested-by: David Heidelberg <david@ixit.cz> Tested-by: Nicolas Chauvet <kwizart@gmail.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
58 lines
1.5 KiB
C
58 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* arch/arm/mach-tegra/reset.h
|
|
*
|
|
* CPU reset dispatcher.
|
|
*
|
|
* Copyright (c) 2011, NVIDIA Corporation.
|
|
*/
|
|
|
|
#ifndef __MACH_TEGRA_RESET_H
|
|
#define __MACH_TEGRA_RESET_H
|
|
|
|
#define TEGRA_RESET_MASK_PRESENT 0
|
|
#define TEGRA_RESET_MASK_LP1 1
|
|
#define TEGRA_RESET_MASK_LP2 2
|
|
#define TEGRA_RESET_STARTUP_SECONDARY 3
|
|
#define TEGRA_RESET_STARTUP_LP2 4
|
|
#define TEGRA_RESET_STARTUP_LP1 5
|
|
#define TEGRA_RESET_TF_PRESENT 6
|
|
#define TEGRA_RESET_DATA_SIZE 7
|
|
|
|
#define RESET_DATA(x) ((TEGRA_RESET_##x)*4)
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#include "irammap.h"
|
|
|
|
extern unsigned long __tegra_cpu_reset_handler_data[TEGRA_RESET_DATA_SIZE];
|
|
|
|
void __tegra_cpu_reset_handler_start(void);
|
|
void __tegra_cpu_reset_handler(void);
|
|
void __tegra20_cpu1_resettable_status_offset(void);
|
|
void __tegra_cpu_reset_handler_end(void);
|
|
|
|
#ifdef CONFIG_PM_SLEEP
|
|
#define tegra_cpu_lp1_mask \
|
|
(IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \
|
|
((u32)&__tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_LP1] - \
|
|
(u32)__tegra_cpu_reset_handler_start)))
|
|
#define tegra_cpu_lp2_mask \
|
|
(IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \
|
|
((u32)&__tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_LP2] - \
|
|
(u32)__tegra_cpu_reset_handler_start)))
|
|
#endif
|
|
|
|
#define tegra_cpu_reset_handler_offset \
|
|
((u32)__tegra_cpu_reset_handler - \
|
|
(u32)__tegra_cpu_reset_handler_start)
|
|
|
|
#define tegra_cpu_reset_handler_size \
|
|
(__tegra_cpu_reset_handler_end - \
|
|
__tegra_cpu_reset_handler_start)
|
|
|
|
void __init tegra_cpu_reset_handler_init(void);
|
|
|
|
#endif
|
|
#endif
|